@laiye_packages/uci 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/app/base/index.d.ts +80 -0
  2. package/dist/app/index.d.ts +14 -0
  3. package/dist/app/organization/api/department.d.ts +44 -0
  4. package/dist/app/organization/api/license.d.ts +60 -0
  5. package/dist/app/organization/api/notification.d.ts +98 -0
  6. package/dist/app/organization/api/oem.d.ts +39 -0
  7. package/dist/app/organization/api/open_api.d.ts +78 -0
  8. package/dist/app/organization/api/permission.d.ts +71 -0
  9. package/dist/app/organization/api/session.d.ts +51 -0
  10. package/dist/app/organization/api/sso.d.ts +0 -0
  11. package/dist/app/organization/api/user.d.ts +95 -0
  12. package/dist/app/organization/api/verificationCodes.d.ts +27 -0
  13. package/dist/app/organization/app/index.d.ts +30 -0
  14. package/dist/app/organization/authorizer/base.d.ts +35 -0
  15. package/dist/app/organization/authorizer/direct.d.ts +11 -0
  16. package/dist/app/organization/authorizer/gateway.d.ts +5 -0
  17. package/dist/app/organization/authorizer/redirect.d.ts +18 -0
  18. package/dist/app/organization/authorizer/web.d.ts +25 -0
  19. package/dist/app/organization/index.d.ts +1 -0
  20. package/dist/app/tenant/api/configuration.d.ts +8 -0
  21. package/dist/app/tenant/api/session.d.ts +23 -0
  22. package/dist/app/tenant/api/tenant.d.ts +25 -0
  23. package/dist/app/tenant/api/user.d.ts +27 -0
  24. package/dist/app/tenant/app/index.d.ts +20 -0
  25. package/dist/app/tenant/authorizer/index.d.ts +13 -0
  26. package/dist/app/tenant/index.d.ts +1 -0
  27. package/dist/app/tenant/session/index.d.ts +57 -0
  28. package/dist/config/address.d.ts +5 -0
  29. package/dist/config/app.d.ts +5 -0
  30. package/dist/config/base.d.ts +15 -0
  31. package/dist/config/crypto.d.ts +5 -0
  32. package/dist/config/http.d.ts +14 -0
  33. package/dist/config/index.d.ts +12 -0
  34. package/dist/constants/index.d.ts +1 -0
  35. package/dist/crypto/base.d.ts +14 -0
  36. package/dist/crypto/gm.d.ts +3 -0
  37. package/dist/crypto/index.d.ts +144 -0
  38. package/dist/crypto/sm.d.ts +17 -0
  39. package/dist/env/index.d.ts +76 -0
  40. package/dist/error/index.d.ts +16 -0
  41. package/dist/http/base.d.ts +52 -0
  42. package/dist/http/error.d.ts +34 -0
  43. package/dist/http/index.d.ts +170 -0
  44. package/dist/http/trace.d.ts +1 -0
  45. package/dist/i18n/index.d.ts +50 -0
  46. package/dist/index.d.ts +14 -0
  47. package/dist/index.js +12194 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/logger/index.d.ts +75 -0
  50. package/dist/object/index.d.ts +57 -0
  51. package/dist/observable/index.d.ts +14 -0
  52. package/dist/observable/serializeable.d.ts +86 -0
  53. package/dist/permission/index.d.ts +9 -0
  54. package/dist/session/index.d.ts +74 -0
  55. package/dist/storage/index.d.ts +98 -0
  56. package/package.json +87 -0
@@ -0,0 +1,80 @@
1
+ import { LYObject } from '../../object';
2
+ import { LYAppHttpClient, LYTenantHttpClient, type IHeaderProvider } from '../../http';
3
+ import type { LYAppPermission } from '../../permission';
4
+ import { LYi18n, ILYi18n, LYKeyofLang } from '../../i18n';
5
+ import { ILYStorageSync, ILYStorage } from '../../storage';
6
+ import { LYEnv } from '../../env';
7
+ export declare const TENANT_APP_NAME = "tenant";
8
+ export declare const ORGANIZATION_APP_NAME = "organization";
9
+ export interface LYAppRemoteModule<Host, LYComponents> {
10
+ default(host: Host): LYComponents | Promise<LYComponents>;
11
+ }
12
+ export type ILanguageResources = {
13
+ [key in LYKeyofLang]: Object;
14
+ };
15
+ export interface ILYAppProvider {
16
+ provideI18nResource: (app: LYBaseApp) => Promise<ILanguageResources>;
17
+ provideI18nResourcePath: (app: LYBaseApp, lang?: string) => string;
18
+ }
19
+ export declare class LYDefaultAppProvider extends LYObject implements ILYAppProvider {
20
+ provideI18nResourcePath(app: LYBaseApp, lang?: string): string;
21
+ provideI18nResource(app: LYBaseApp): Promise<ILanguageResources>;
22
+ }
23
+ export declare class LYBaseApp extends LYObject {
24
+ private static _apps;
25
+ private static _headerProvider;
26
+ private static _initLock;
27
+ static get apps(): Record<string, LYBaseApp>;
28
+ /**
29
+ * 根据应用名称动态生成对应的类名
30
+ * 例如: agent_system -> LYAgentSystemApp
31
+ */
32
+ private static getAppClassName;
33
+ static init(config_url?: string): Promise<void>;
34
+ protected _name: string;
35
+ protected _version: string;
36
+ protected _description: string;
37
+ protected _httpClient: LYAppHttpClient;
38
+ protected _isLoaded: boolean;
39
+ protected _i18n: LYi18n;
40
+ protected _localStore: ILYStorageSync;
41
+ protected _sessionStore: ILYStorageSync;
42
+ protected _cloudStore: ILYStorage;
43
+ protected _provider: ILYAppProvider;
44
+ protected _env: LYEnv;
45
+ protected _tenantName: string;
46
+ protected _isLoadingComponent: boolean;
47
+ protected _remoteComponents: {
48
+ [name: string]: any;
49
+ };
50
+ static getAll(): Record<string, LYBaseApp>;
51
+ static get<T extends LYBaseApp = LYBaseApp>(name: string): T;
52
+ static setHeaderProvider(headerProvider: IHeaderProvider): void;
53
+ static getHeaderProvider(): IHeaderProvider;
54
+ constructor(name: string, version: string, description: string);
55
+ get location(): string;
56
+ get name(): string;
57
+ get tenantName(): string;
58
+ get version(): string;
59
+ get description(): string;
60
+ get httpClient(): LYAppHttpClient;
61
+ get permission(): LYAppPermission;
62
+ get provider(): ILYAppProvider;
63
+ get i18n(): ILYi18n;
64
+ get localStore(): ILYStorageSync;
65
+ get sessionStore(): ILYStorageSync;
66
+ get cloudStore(): ILYStorage;
67
+ get isLoaded(): boolean;
68
+ get env(): LYEnv;
69
+ protected _createHttpClient(): LYAppHttpClient;
70
+ load(): Promise<void>;
71
+ private getBaseUrl;
72
+ protected doLoad(): Promise<void>;
73
+ private initI18n;
74
+ getI18nResourceUrl(relativeUrl: string, lang?: LYKeyofLang): string;
75
+ getComponent<T>(componentName: string): Promise<T>;
76
+ private loadRemoteComponents;
77
+ }
78
+ export declare class LYBaseTenantApp extends LYBaseApp {
79
+ protected _createHttpClient(): LYTenantHttpClient;
80
+ }
@@ -0,0 +1,14 @@
1
+ import { LYEnv } from '../env';
2
+ import { LYBaseApp, LYBaseTenantApp, ORGANIZATION_APP_NAME, TENANT_APP_NAME } from './base';
3
+ import { LYOrganizationApp, SSOConfig } from './organization';
4
+ import { LYTenantApp } from './tenant';
5
+ import { LYTenantSession } from './tenant/session';
6
+ import { LYWebAuthorizer } from './organization/authorizer/web';
7
+ import { LYGatewayAuthorizer } from './organization/authorizer/gateway';
8
+ import { LYDirectAuthorizer } from './organization/authorizer/direct';
9
+ import { LYRedirectAuthorizer } from './organization/authorizer/redirect';
10
+ import { LYTenantAuthorizer } from './tenant/authorizer';
11
+ declare class LYApp extends LYBaseTenantApp {
12
+ }
13
+ export type { SSOConfig };
14
+ export { LYApp, LYBaseApp, LYTenantApp, LYOrganizationApp, LYTenantSession, TENANT_APP_NAME, ORGANIZATION_APP_NAME, LYEnv, LYWebAuthorizer, LYGatewayAuthorizer, LYDirectAuthorizer, LYRedirectAuthorizer, LYTenantAuthorizer };
@@ -0,0 +1,44 @@
1
+ import type { LYRangeQueryParams, LYAppHttpClient, LYBaseResponse, LYListResponse } from '../../../http';
2
+ interface LYDepartmentQueryParams extends LYRangeQueryParams {
3
+ name_or_code?: string;
4
+ parent_id?: string;
5
+ user_id?: string;
6
+ manager_only?: boolean;
7
+ }
8
+ interface LYDepartmentResponse extends LYBaseResponse {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ parent_id: string;
13
+ path: string;
14
+ code: string;
15
+ sort: number;
16
+ }
17
+ interface LYDepartmentParentRequest {
18
+ id: string;
19
+ path: string;
20
+ }
21
+ interface LYDepartmentPostRequest {
22
+ name: string;
23
+ description?: string;
24
+ code?: string;
25
+ sort?: number;
26
+ parent?: LYDepartmentParentRequest;
27
+ }
28
+ interface LYDepartmentPatchRequest {
29
+ name?: string;
30
+ description?: string;
31
+ code?: string;
32
+ sort?: number;
33
+ parent?: LYDepartmentParentRequest;
34
+ }
35
+ export declare class LYDepartmentApi {
36
+ private _httpClient;
37
+ constructor(httpClient: LYAppHttpClient);
38
+ query(params: LYDepartmentQueryParams): Promise<LYListResponse<LYDepartmentResponse>>;
39
+ get(id: string): Promise<LYDepartmentResponse | undefined>;
40
+ add(department: LYDepartmentPostRequest): Promise<string>;
41
+ update(id: string, department: LYDepartmentPatchRequest): Promise<number>;
42
+ remove(id: string): Promise<number>;
43
+ }
44
+ export {};
@@ -0,0 +1,60 @@
1
+ import type { LYBasicResultCode } from '../../../http/error';
2
+ import type { LYAppHttpClient, LYBaseResponse, LYListResponse } from '../../../http';
3
+ export type LYLicenseResultCode = LYBasicResultCode | 'not_match';
4
+ interface LYLicenseFileResponse extends LYBaseResponse {
5
+ id: string;
6
+ file_name: string;
7
+ }
8
+ interface LYLicenseContentResponse extends LYBaseResponse {
9
+ signature: string;
10
+ id: string;
11
+ app_name: string;
12
+ app_version: string;
13
+ name: string;
14
+ activation_at: string;
15
+ expiration_at: string;
16
+ usage_period: number;
17
+ quantity: number;
18
+ counter: number;
19
+ }
20
+ interface LYLicenseFileContentResponse extends LYBaseResponse {
21
+ id: string;
22
+ file_name: string;
23
+ customer: string;
24
+ env_code: string;
25
+ items: LYLicenseContentResponse[];
26
+ }
27
+ interface LYLicensePostRequest {
28
+ content: string;
29
+ }
30
+ interface LYLicenseTokenResponse extends LYBaseResponse {
31
+ id: string;
32
+ license_id: string;
33
+ ordinal: number;
34
+ acquire_id: string;
35
+ expire_at: string;
36
+ message: string;
37
+ }
38
+ interface LYLicenseLogResponse extends LYBaseResponse {
39
+ id: string;
40
+ action: string;
41
+ failed: boolean;
42
+ message: string;
43
+ inner_message: string;
44
+ license_id: string;
45
+ license_token_id: string;
46
+ }
47
+ export declare class LYLicenseApi {
48
+ private _httpClient;
49
+ constructor(httpClient: LYAppHttpClient);
50
+ queryFiles(): Promise<LYListResponse<LYLicenseFileResponse>>;
51
+ getFileContent(id: string): Promise<LYLicenseFileContentResponse | undefined>;
52
+ add(license: LYLicensePostRequest): Promise<string>;
53
+ getAll(): Promise<LYListResponse<LYLicenseContentResponse>>;
54
+ get(id: string): Promise<LYLicenseContentResponse | undefined>;
55
+ remove(id: string): Promise<number>;
56
+ getTokens(): Promise<LYListResponse<LYLicenseTokenResponse>>;
57
+ getToken(id: string): Promise<LYLicenseTokenResponse | undefined>;
58
+ getLogs(licenseId: string, tokenId?: string): Promise<LYListResponse<LYLicenseLogResponse>>;
59
+ }
60
+ export {};
@@ -0,0 +1,98 @@
1
+ import type { LYRangeQueryParams, LYAppHttpClient, LYBaseResponse, LYListResponse } from '../../../http';
2
+ export type LYChannelType = 'email' | 'inbox' | 'external';
3
+ interface LYChannelQueryParams extends LYRangeQueryParams {
4
+ name?: string;
5
+ type?: LYChannelType;
6
+ enabled?: boolean;
7
+ }
8
+ interface LYChannelResponse extends LYBaseResponse {
9
+ id: string;
10
+ created_at: Date;
11
+ updated_at: Date;
12
+ updated_by: string;
13
+ name: string;
14
+ description: string;
15
+ type: LYChannelType;
16
+ config: Record<string, any>;
17
+ enabled: boolean;
18
+ }
19
+ interface LYChannelPostRequest {
20
+ name: string;
21
+ description: string;
22
+ type: string;
23
+ config: Record<string, any>;
24
+ enabled: boolean;
25
+ }
26
+ interface LYChannelPatchRequest {
27
+ name: string;
28
+ description: string;
29
+ type: string;
30
+ config: Record<string, any>;
31
+ enabled: boolean;
32
+ }
33
+ export declare class LYChannelApi {
34
+ private _httpClient;
35
+ constructor(httpClient: LYAppHttpClient);
36
+ query(params: LYChannelQueryParams): Promise<LYListResponse<LYChannelResponse>>;
37
+ get(id: string): Promise<LYChannelResponse | undefined>;
38
+ add(channel: LYChannelPostRequest): Promise<string>;
39
+ update(id: string, channel: LYChannelPatchRequest): Promise<number>;
40
+ remove(id: string): Promise<number>;
41
+ }
42
+ interface LYNotificationVariableResponse extends LYBaseResponse {
43
+ name: string;
44
+ caption: string;
45
+ description: string;
46
+ }
47
+ interface LYNotificationMetaInfoResponse extends LYBaseResponse {
48
+ type_caption: string;
49
+ variables: LYNotificationVariableResponse[];
50
+ }
51
+ interface LYNotificationMetaResponse extends LYBaseResponse {
52
+ id: string;
53
+ created_at: Date;
54
+ updated_at: Date;
55
+ updated_by: string;
56
+ type: string;
57
+ meta: LYNotificationMetaInfoResponse;
58
+ }
59
+ interface LYNotificationTemplateQueryParams extends LYRangeQueryParams {
60
+ user_id: string;
61
+ name?: string;
62
+ type?: string;
63
+ language?: string;
64
+ }
65
+ interface LYNotificationTemplateResponse extends LYBaseResponse {
66
+ user_id: string;
67
+ name: string;
68
+ description: string;
69
+ type: string;
70
+ language: string;
71
+ content: string;
72
+ }
73
+ interface LYNotificationTemplatePostRequest {
74
+ user_id: string;
75
+ name: string;
76
+ description: string;
77
+ type: string;
78
+ language: string;
79
+ content: string;
80
+ }
81
+ interface LYNotificationTemplatePatchRequest {
82
+ name: string;
83
+ description: string;
84
+ type: string;
85
+ language: string;
86
+ content: string;
87
+ }
88
+ export declare class LYNotificationApi {
89
+ private _httpClient;
90
+ constructor(httpClient: LYAppHttpClient);
91
+ getMeta(): Promise<LYNotificationMetaResponse | undefined>;
92
+ queryTemplates(params: LYNotificationTemplateQueryParams): Promise<LYListResponse<LYNotificationTemplateResponse>>;
93
+ getTemplate(id: string): Promise<LYNotificationTemplateResponse | undefined>;
94
+ addTemplate(template: LYNotificationTemplatePostRequest): Promise<string>;
95
+ updateTemplate(id: string, template: LYNotificationTemplatePatchRequest): Promise<number>;
96
+ removeTemplate(id: string): Promise<number>;
97
+ }
98
+ export {};
@@ -0,0 +1,39 @@
1
+ import { LYAppHttpClient, LYBaseResponse } from "../../../http";
2
+ interface LYTerm {
3
+ language: string;
4
+ name: string;
5
+ }
6
+ interface LYGetTermRequest {
7
+ name?: string;
8
+ }
9
+ interface LYGetTermResponse extends LYTerm, LYBaseResponse {
10
+ content: string;
11
+ }
12
+ interface LYCreateTermRequest extends LYTerm {
13
+ content: string;
14
+ }
15
+ interface LYCreateTermResponse extends LYTerm, LYBaseResponse {
16
+ content: string;
17
+ }
18
+ interface LYBaseResource extends LYTerm {
19
+ content_type: string;
20
+ url: string;
21
+ }
22
+ export declare class LYOEMApi {
23
+ private _httpClient;
24
+ constructor(httpClient: LYAppHttpClient);
25
+ getTerm(request?: LYGetTermRequest): Promise<LYGetTermResponse>;
26
+ createTerm(request: LYCreateTermRequest): Promise<LYCreateTermResponse>;
27
+ batchUpdate(request: Record<string, string>): Promise<LYCreateTermResponse>;
28
+ update(request: LYCreateTermRequest): Promise<LYCreateTermResponse>;
29
+ delete(request: LYTerm): Promise<{
30
+ count: number;
31
+ }>;
32
+ getResource(request?: LYGetTermRequest): Promise<LYBaseResource>;
33
+ createResource(request: LYBaseResource): Promise<LYBaseResource>;
34
+ updateResource(request: LYBaseResource): Promise<LYBaseResource>;
35
+ deleteResource(request: LYTerm): Promise<{
36
+ count: number;
37
+ }>;
38
+ }
39
+ export {};
@@ -0,0 +1,78 @@
1
+ import type { LYAppHttpClient } from '../../../http';
2
+ import { SortType } from './permission';
3
+ type LYGetAccessorsRequset = {
4
+ name: string;
5
+ enabled: boolean | null;
6
+ offset: number;
7
+ size: number;
8
+ sort: SortType[];
9
+ };
10
+ type AccessorItem = {
11
+ id?: string;
12
+ name: string;
13
+ description: string;
14
+ create_at?: string;
15
+ updated_at?: string;
16
+ enabled: boolean;
17
+ expires_at: string;
18
+ ref_id: string;
19
+ ref_type: string;
20
+ permissions: Record<string, any>;
21
+ rate_limit: number;
22
+ rate_limit_period: number;
23
+ secret_key: string;
24
+ access_key: string;
25
+ ip_whitelist: string[];
26
+ debug: boolean;
27
+ };
28
+ type LYGetAccessorsResponse = {
29
+ range: {
30
+ offset: number;
31
+ size: number;
32
+ total: number;
33
+ };
34
+ list: AccessorItem[];
35
+ };
36
+ type LYAccessorWebhook = {
37
+ id?: string;
38
+ created_at?: string;
39
+ updated_at?: string;
40
+ accessor_id: string;
41
+ enabled: boolean;
42
+ url: string;
43
+ secret: string;
44
+ events: string[];
45
+ headers: Record<string, any>;
46
+ timeout_per_retry: number;
47
+ stop_after_delay: number;
48
+ retry_delay_min: number;
49
+ retry_delay_max: number;
50
+ retry_delay_multiplier: number;
51
+ failures_threshold: number;
52
+ };
53
+ export declare class LYOpenApi {
54
+ private _httpClient;
55
+ constructor(httpClient: LYAppHttpClient);
56
+ getAccessors(request: LYGetAccessorsRequset): Promise<LYGetAccessorsResponse>;
57
+ create(request: AccessorItem): Promise<{
58
+ id: string;
59
+ }>;
60
+ getAccessor(id: string): Promise<AccessorItem>;
61
+ del(id: string): Promise<{
62
+ count: number;
63
+ }>;
64
+ update(id: string, request: AccessorItem): Promise<{
65
+ count: number;
66
+ }>;
67
+ getAccessorWebHook(id: string): Promise<LYAccessorWebhook>;
68
+ createWebhook(request: LYAccessorWebhook): Promise<{
69
+ id: string;
70
+ }>;
71
+ delWebhook(id: string): Promise<{
72
+ count: number;
73
+ }>;
74
+ updateWebhook(id: string, request: LYAccessorWebhook): Promise<{
75
+ count: number;
76
+ }>;
77
+ }
78
+ export {};
@@ -0,0 +1,71 @@
1
+ import type { LYAppHttpClient } from '../../../http';
2
+ export type SortType = 'created_at' | 'tenant_id' | 'updated_by' | 'acquire_id' | 'source' | 'reserved_2' | 'description' | 'name' | 'updated_at' | 'deleted' | 'reserved_1' | 'id' | 'acquire_expire';
3
+ type LYGetRolsRequest = {
4
+ name: string;
5
+ offset: number;
6
+ size: number;
7
+ sort: SortType[];
8
+ };
9
+ type RoleItem = {
10
+ id?: string;
11
+ name: string;
12
+ description: string;
13
+ source?: "builtin";
14
+ permission_codes: Record<string, any>;
15
+ };
16
+ type LYGetRolsRespnose = {
17
+ range: {
18
+ offset: number;
19
+ size: number;
20
+ total: number | null;
21
+ };
22
+ list: RoleItem[];
23
+ };
24
+ type EntityBase = {
25
+ attributes: Record<string, Attribute>;
26
+ };
27
+ type Entity = EntityBase & {
28
+ type: "entity";
29
+ relations: Record<string, Relation>;
30
+ };
31
+ type UserAttribute = {
32
+ type: "none" | string;
33
+ name: string;
34
+ caption: string;
35
+ };
36
+ type Relation = EntityBase & {
37
+ type: "relation";
38
+ };
39
+ type Attribute = {
40
+ caption: string;
41
+ type: "unknown" | string;
42
+ options: string[];
43
+ };
44
+ type CodeItem = {
45
+ actions: string[];
46
+ caption: string;
47
+ description: string;
48
+ };
49
+ type Domain = {
50
+ codes: Record<string, CodeItem>;
51
+ entities: Record<string, Entity>;
52
+ user_attributes: Record<string, UserAttribute>;
53
+ };
54
+ type LYRoleMetaData = Record<string, Domain>;
55
+ export declare class LYPermissionApi {
56
+ private _httpClient;
57
+ constructor(httpClient: LYAppHttpClient);
58
+ getRoles(request: LYGetRolsRequest): Promise<LYGetRolsRespnose>;
59
+ addRole(request: RoleItem): Promise<{
60
+ id: string;
61
+ }>;
62
+ getRole(id: string): Promise<RoleItem>;
63
+ del(id: string): Promise<{
64
+ count: number;
65
+ }>;
66
+ update(id: string, role: RoleItem): Promise<{
67
+ count: number;
68
+ }>;
69
+ getMeta(type: "web" | "open"): Promise<LYRoleMetaData>;
70
+ }
71
+ export {};
@@ -0,0 +1,51 @@
1
+ import type { LYBasicResultCode } from '../../../http/error';
2
+ import type { LYAppHttpClient, LYBaseResponse } from '../../../http';
3
+ export type LYSessionAddResultCode = LYBasicResultCode | 'user_locked';
4
+ export interface LYSessionResponse extends LYBaseResponse {
5
+ id: string;
6
+ access_token: string;
7
+ token_type: string;
8
+ user_id: string;
9
+ user_name: string;
10
+ expires_in: number;
11
+ claims: Record<string, any>;
12
+ permission_codes: Record<string, any>;
13
+ is_first_login?: boolean;
14
+ display_name: string;
15
+ email: string;
16
+ phone: string;
17
+ country_code: string;
18
+ }
19
+ export interface LYSessionPostRequest {
20
+ name?: string;
21
+ password?: string;
22
+ email?: string;
23
+ phone?: string;
24
+ country_code?: string;
25
+ account_type?: "email" | "phone";
26
+ verification_code?: string;
27
+ verification_code_id?: string;
28
+ }
29
+ export type SSOConfig = {
30
+ id: string;
31
+ name: string;
32
+ description: string;
33
+ authentication_type: string;
34
+ icon: string;
35
+ auth_url: string;
36
+ enabled: boolean;
37
+ };
38
+ export interface LYLoginWays {
39
+ allow_phone_login: boolean;
40
+ allow_email_login: boolean;
41
+ allow_username_login: boolean;
42
+ sso_list: SSOConfig[];
43
+ }
44
+ export declare class LYSessionApi {
45
+ private _httpClient;
46
+ constructor(httpClient: LYAppHttpClient);
47
+ create(request: LYSessionPostRequest): Promise<LYSessionResponse>;
48
+ update(id: string): Promise<LYSessionResponse>;
49
+ delete(id: string): Promise<number>;
50
+ getLoginWays(): Promise<LYLoginWays>;
51
+ }
File without changes
@@ -0,0 +1,95 @@
1
+ import type { LYRangeQueryParams, LYAppHttpClient, LYBaseResponse, LYListResponse } from '../../../http';
2
+ type LYSourceType = 'builtin' | 'web' | 'sso' | string;
3
+ interface LYUserQueryParams extends LYRangeQueryParams {
4
+ name?: string;
5
+ role_id?: string;
6
+ email?: string;
7
+ phone?: string;
8
+ department_id?: string;
9
+ manager_only?: boolean;
10
+ }
11
+ interface LYAccountCheckRequest {
12
+ email?: string;
13
+ phone?: string;
14
+ account_type?: "email" | "phone";
15
+ country_code?: string;
16
+ }
17
+ interface LYUserRegisterResonse extends LYBaseResponse {
18
+ user_id: string;
19
+ message: string;
20
+ email_verified: boolean;
21
+ phone_verified: boolean;
22
+ }
23
+ interface LYUserResponse extends LYBaseResponse {
24
+ id: string;
25
+ name: string;
26
+ role_id: string;
27
+ source: LYSourceType;
28
+ email: string;
29
+ phone: string;
30
+ is_super_admin: boolean;
31
+ description: string;
32
+ is_locked: boolean;
33
+ locked_at: string;
34
+ locked_by: string;
35
+ login_failures: number;
36
+ last_login_at: string;
37
+ last_login_ip: string;
38
+ last_login_location: string;
39
+ last_login_device: string;
40
+ last_login_browser: string;
41
+ last_login_os: string;
42
+ }
43
+ interface LYUserListResponse extends LYListResponse<LYUserResponse> {
44
+ }
45
+ interface LYUserPostRequest {
46
+ name: string;
47
+ password: string;
48
+ description?: string;
49
+ role_id?: string;
50
+ email?: string;
51
+ phone?: string;
52
+ }
53
+ interface LYUserPatchRequest {
54
+ password?: string;
55
+ description?: string;
56
+ is_locked?: boolean;
57
+ role_id?: string;
58
+ email?: string;
59
+ phone?: string;
60
+ }
61
+ interface LYRegisterRequest {
62
+ email?: string;
63
+ phone?: string;
64
+ country_code?: string;
65
+ account_type: string;
66
+ password: string;
67
+ display_name?: string;
68
+ }
69
+ interface LYResetPasswordRequest {
70
+ account_type: "email" | "phone";
71
+ verification_code_id: string;
72
+ new_password: string;
73
+ email?: string;
74
+ country_code?: string;
75
+ phone?: string;
76
+ }
77
+ export declare class LYUserApi {
78
+ private _httpClient;
79
+ constructor(httpClient: LYAppHttpClient);
80
+ query(params: LYUserQueryParams): Promise<LYUserListResponse>;
81
+ get(name: string): Promise<LYUserResponse | undefined>;
82
+ add(user: LYUserPostRequest): Promise<string>;
83
+ update(name: string, user: LYUserPatchRequest): Promise<number>;
84
+ remove(name: string): Promise<number>;
85
+ accountCheck(request: LYAccountCheckRequest): Promise<boolean>;
86
+ register(request: LYRegisterRequest): Promise<LYUserRegisterResonse>;
87
+ userNameCheck(name: string): Promise<boolean>;
88
+ changePassword(currentPassword: string, newPassword: string): Promise<{
89
+ message: string;
90
+ }>;
91
+ resetPassword(request: LYResetPasswordRequest): Promise<{
92
+ message: string;
93
+ }>;
94
+ }
95
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { LYAppHttpClient, LYBaseResponse } from '../../../http';
2
+ interface LYVerificationCodeRequest {
3
+ email?: string;
4
+ phone?: string;
5
+ country_code?: string;
6
+ account_type: "email" | "phone";
7
+ purpose: 'register' | 'login' | 'reset_password';
8
+ verification_code_id?: string;
9
+ verification_code?: string;
10
+ }
11
+ interface LYVerificationCodesResponse extends LYBaseResponse {
12
+ message: string;
13
+ cooldown_seconds: number;
14
+ expires_in: number;
15
+ verification_code_id: string;
16
+ }
17
+ export declare class LYVerificationCodesApi {
18
+ private _httpClient;
19
+ constructor(httpClient: LYAppHttpClient);
20
+ send(request: LYVerificationCodeRequest): Promise<LYVerificationCodesResponse>;
21
+ check(request: LYVerificationCodeRequest): Promise<{
22
+ verified: boolean;
23
+ verification_code_id: string;
24
+ expires_at: string;
25
+ }>;
26
+ }
27
+ export {};