Browse Source

feat: add account-core/proxy secondary entry point

pull/10086/head
bnymncoskuner 5 years ago
parent
commit
80f808b24c
  1. 7
      npm/ng-packs/packages/account-core/proxy/ng-package.json
  2. 2
      npm/ng-packs/packages/account-core/proxy/src/lib/index.ts
  3. 17
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/README.md
  4. 37
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/account.service.ts
  5. 4
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/index.ts
  6. 21
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/models.ts
  7. 35
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/account.service.ts
  8. 3
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/index.ts
  9. 2
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/index.ts
  10. 11
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.ts
  11. 12
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/models.ts
  12. 2
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/index.ts
  13. 2
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/index.ts
  14. 2
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/index.ts
  15. 5305
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/generate-proxy.json
  16. 1
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/identity/index.ts
  17. 15
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/identity/models.ts
  18. 3
      npm/ng-packs/packages/account-core/proxy/src/lib/proxy/index.ts
  19. 1
      npm/ng-packs/packages/account-core/proxy/src/public-api.ts

7
npm/ng-packs/packages/account-core/proxy/ng-package.json

@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/packages/account-core/proxy",
"lib": {
"entryFile": "src/public-api.ts"
}
}

2
npm/ng-packs/packages/account-core/proxy/src/lib/index.ts

@ -0,0 +1,2 @@
export * from './proxy/account';
export * from './proxy/identity';

17
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/README.md

@ -0,0 +1,17 @@
# Proxy Generation Output
This directory includes the output of the latest proxy generation.
The files and folders in it will be overwritten when proxy generation is run again.
Therefore, please do not place your own content in this folder.
In addition, `generate-proxy.json` works like a lock file.
It includes information used by the proxy generator, so please do not delete or modify it.
Finally, the name of the files and folders should not be changed for two reasons:
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
- ABP Suite generates files which include imports from this folder.
> **Important Notice:** If you are building a module and are planning to publish to npm,
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
> please make sure you export files directly and not from barrel exports. In other words,
> do not include index.ts exports in your public-api.ts exports.

37
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/account.service.ts

@ -0,0 +1,37 @@
import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models';
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { IdentityUserDto } from '../identity/models';
@Injectable({
providedIn: 'root',
})
export class AccountService {
apiName = 'AbpAccount';
register = (input: RegisterDto) =>
this.restService.request<any, IdentityUserDto>({
method: 'POST',
url: '/api/account/register',
body: input,
},
{ apiName: this.apiName });
resetPassword = (input: ResetPasswordDto) =>
this.restService.request<any, void>({
method: 'POST',
url: '/api/account/reset-password',
body: input,
},
{ apiName: this.apiName });
sendPasswordResetCode = (input: SendPasswordResetCodeDto) =>
this.restService.request<any, void>({
method: 'POST',
url: '/api/account/send-password-reset-code',
body: input,
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

4
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/index.ts

@ -0,0 +1,4 @@
import * as Web from './web';
export * from './account.service';
export * from './models';
export { Web };

21
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/models.ts

@ -0,0 +1,21 @@
import type { ExtensibleObject } from '@abp/ng.core';
export interface RegisterDto extends ExtensibleObject {
userName: string;
emailAddress: string;
password: string;
appName: string;
}
export interface ResetPasswordDto {
userId?: string;
resetToken: string;
password: string;
}
export interface SendPasswordResetCodeDto {
email: string;
appName: string;
returnUrl?: string;
returnUrlHash?: string;
}

35
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/account.service.ts

@ -0,0 +1,35 @@
import type { AbpLoginResult, UserLoginInfo } from './models/models';
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class AccountService {
apiName = 'AbpAccount';
checkPasswordByLogin = (login: UserLoginInfo) =>
this.restService.request<any, AbpLoginResult>({
method: 'POST',
url: '/api/account/check-password',
body: login,
},
{ apiName: this.apiName });
loginByLogin = (login: UserLoginInfo) =>
this.restService.request<any, AbpLoginResult>({
method: 'POST',
url: '/api/account/login',
body: login,
},
{ apiName: this.apiName });
logout = () =>
this.restService.request<any, void>({
method: 'GET',
url: '/api/account/logout',
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

3
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/index.ts

@ -0,0 +1,3 @@
import * as Models from './models';
export * from './account.service';
export { Models };

2
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/index.ts

@ -0,0 +1,2 @@
export * from './login-result-type.enum';
export * from './models';

11
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.ts

@ -0,0 +1,11 @@
import { mapEnumToOptions } from '@abp/ng.core';
export enum LoginResultType {
Success = 1,
InvalidUserNameOrPassword = 2,
NotAllowed = 3,
LockedOut = 4,
RequiresTwoFactor = 5,
}
export const loginResultTypeOptions = mapEnumToOptions(LoginResultType);

12
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/models.ts

@ -0,0 +1,12 @@
import type { LoginResultType } from './login-result-type.enum';
export interface AbpLoginResult {
result: LoginResultType;
description?: string;
}
export interface UserLoginInfo {
userNameOrEmailAddress: string;
password: string;
rememberMe: boolean;
}

2
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/account/index.ts

@ -0,0 +1,2 @@
import * as Controllers from './controllers';
export { Controllers };

2
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/areas/index.ts

@ -0,0 +1,2 @@
import * as Account from './account';
export { Account };

2
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/account/web/index.ts

@ -0,0 +1,2 @@
import * as Areas from './areas';
export { Areas };

5305
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/generate-proxy.json

File diff suppressed because it is too large

1
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/identity/index.ts

@ -0,0 +1 @@
export * from './models';

15
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/identity/models.ts

@ -0,0 +1,15 @@
import type { ExtensibleFullAuditedEntityDto } from '@abp/ng.core';
export interface IdentityUserDto extends ExtensibleFullAuditedEntityDto<string> {
tenantId?: string;
userName?: string;
name?: string;
surname?: string;
email?: string;
emailConfirmed: boolean;
phoneNumber?: string;
phoneNumberConfirmed: boolean;
lockoutEnabled: boolean;
lockoutEnd?: string;
concurrencyStamp?: string;
}

3
npm/ng-packs/packages/account-core/proxy/src/lib/proxy/index.ts

@ -0,0 +1,3 @@
import * as Account from './account';
import * as Identity from './identity';
export { Account, Identity };

1
npm/ng-packs/packages/account-core/proxy/src/public-api.ts

@ -0,0 +1 @@
export * from './lib';
Loading…
Cancel
Save