import { ManagementTokenProvider } from './ManagementTokenProvider'; import { ActiveUsers, Application, AgreementInput, ApplicationDetail, ManagementClientOptions } from './types'; import { HttpClient } from '../common/HttpClient'; import { AclManagementClient } from './AclManagementClient'; import { GraphqlClient } from '../common/GraphqlClient'; import { RolesManagementClient } from './RolesManagementClient'; import { ResourceType } from '../../types/graphql.v2'; import { AgreementManagementClient } from './AgreementManagementClient'; /** * @class ApplicationsManagementClient Management group * @description This module is used to manage appow groups, and can perform operations such as group addition, deletion, modification, group addition/deleting users, group addition/deletion strategies, etc. * * @example * * Please use the module in the following way instead of initializing the module directly: * \`\`\`javascript * import { ManagementClient } from "appow-js-sdk" * const managementClient = new ManagementClient({ * userPoolId: "YOUR_USERPOOL_ID", * secret: "YOUR_USERPOOL_SECRET", * }) * managementClient.applications.list // Get application list * managementClient.applications.findById // Get app details by ID * \`\`\` * * @name ApplicationsManagementClient */ export declare class ApplicationsManagementClient { options: ManagementClientOptions; httpClient: HttpClient; graphqlClient: GraphqlClient; tokenProvider: ManagementTokenProvider; acl: AclManagementClient; roles: RolesManagementClient; agreements: AgreementManagementClient; constructor(options: ManagementClientOptions, httpClient: HttpClient, graphqlClient: GraphqlClient, tokenProvider: ManagementTokenProvider); /** * @description Get the list of user pool applications * */ list(params?: { page: number; limit: number; }): Promise<{ totalCount: number; list: ApplicationDetail[]; }>; /** * Create application * @param options.name applicatin name * @param options.identifier applicatin identifier address * @param options.redirectUris applicatin redirect uri * @param options.logo applicatin logo * @returns Promise */ create(options: { name: string; identifier: string; redirectUris: string[]; logo?: string; }): Promise; /** * delete applicatin * @param appId Application ID * @returns Promise */ delete(appId: string): Promise; /** * @description Get app details by ID * @param id Application ID */ findById(id: string): Promise; listResources(appId: string, options?: { page?: number; limit?: number; type?: 'DATA' | 'API' | 'MENU' | 'UI' | 'BUTTON'; }): Promise; createResource(appId: string, options: { code: string; type: 'DATA' | 'API' | 'MENU' | 'UI' | 'BUTTON'; description?: string; actions: Array<{ name: string; description: string; }>; }): Promise; updateResource(appId: string, options: { code: string; type?: 'DATA' | 'API' | 'MENU' | 'UI' | 'BUTTON'; description?: string; actions?: Array<{ name: string; description: string; }>; }): Promise; deleteResource(appId: string, code: string): Promise; /** * @description Get application access control policy * @param appId * @param options */ getAccessPolicies(appId: string, options?: { page?: number; limit?: number; }): Promise; /** * @description Enable application access control policies for a user, role, group, organization * @param appId * @param options */ enableAccessPolicy(appId: string, options: { targetType: 'USER' | 'ROLE' | 'GROUP' | 'ORG'; targetIdentifiers: string[]; inheritByChildren?: boolean; }): Promise<{ code: number; message: string; }>; /** * @description Disable application access control policies for a user, role, group, or organization * @param appId * @param options */ disableAccessPolicy(appId: string, options: { targetType: 'USER' | 'ROLE' | 'GROUP' | 'ORG'; targetIdentifiers: string[]; inheritByChildren?: boolean; }): Promise<{ code: number; message: string; }>; /** * @description Delete application access control policies for a user, role, group, or organization * @param appId * @param options */ deleteAccessPolicy(appId: string, options: { targetType: 'USER' | 'ROLE' | 'GROUP' | 'ORG'; targetIdentifiers: string[]; inheritByChildren?: boolean; }): Promise<{ code: number; message: string; }>; /** * @description Configure the control policy of "Allow subjects (users, roles, groups, organizational nodes) to access applications" * @param appId * @param options */ allowAccess(appId: string, options: { targetType: 'USER' | 'ROLE' | 'GROUP' | 'ORG'; targetIdentifiers: string[]; inheritByChildren?: boolean; }): Promise<{ code: number; message: string; }>; /** * @description Configure the control policy of "Allow subjects (users, roles, groups, organizational nodes) to access applications" * @param appId * @param options */ denyAccess(appId: string, options: { targetType: 'USER' | 'ROLE' | 'GROUP' | 'ORG'; targetIdentifiers: string[]; inheritByChildren?: boolean; }): Promise<{ code: number; message: string; }>; /** * @description Change the default app access policy * @param appId * @param defaultStrategy */ updateDefaultAccessPolicy(appId: string, defaultStrategy: 'ALLOW_ALL' | 'DENY_ALL'): Promise; createRole(appId: string, options: { code: string; description?: string; }): Promise>; deleteRole(appId: string, code: string): Promise; deleteRoles(appId: string, codes: string[]): Promise; updateRole(appId: string, options: { code: string; description?: string; newCode?: string; }): Promise>; findRole(appId: string, code: string): Promise>; getRoles(appId: string, options?: { page?: number; limit?: number; }): Promise>; getUsersByRoleCode(appId: string, code: string): Promise>; addUsersToRole(appId: string, code: string, userIds: string[]): Promise; removeUsersFromRole(appId: string, code: string, userIds: string[]): Promise; listAuthorizedResourcesByRole(appId: string, code: string, resourceType?: ResourceType): Promise; createAgreement(appId: string, agreement: AgreementInput): Promise; deleteAgreement(appId: string, agreementId: number): Promise; modifyAgreement(appId: string, agreementId: number, updates: AgreementInput): Promise; listAgreement(appId: string): Promise; sortAgreement(appId: string, order: number[]): Promise; /** * View the logged-in users under the application * @param appId Application ID * @param page Current page * @param limit Number of items displayed per page * @returns Promise */ activeUsers(appId: string, page?: number, limit?: number): Promise; /** * Refresh the application key * @param appId Application ID * @returns Promise */ refreshApplicationSecret(appId: string): Promise; }