diff --git a/src/FusionAuthClient.ts b/src/FusionAuthClient.ts index 49c8510..9bc42c3 100644 --- a/src/FusionAuthClient.ts +++ b/src/FusionAuthClient.ts @@ -710,6 +710,25 @@ export class FusionAuthClient { .go(); } + /** + * Adds the application tenants for universal applications. + * + * @param {UUID} applicationId The Id of the application that the universal application tenant belongs to. + * @param {UUID} universalApplicationTenantId (Optional) The Id of the universal application tenant. + * @param {UniversalApplicationTenantRequest} request The request object that contains all the information used to create the UniversalApplicationTenants. + * @returns {Promise>} + */ + createUniversalApplicationTenant(applicationId: UUID, universalApplicationTenantId: UUID, request: UniversalApplicationTenantRequest): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment(applicationId) + .withUriSegment("universal-application-tenant") + .withUriSegment(universalApplicationTenantId) + .withJSONBody(request) + .withMethod("POST") + .go(); + } + /** * Creates a user. You can optionally specify an Id for the user, if not provided one will be generated. * @@ -1305,6 +1324,40 @@ export class FusionAuthClient { .go(); } + /** + * Deletes the universal application tenant. + * + * @param {UUID} applicationId The Id of the application that the UniversalApplicationTenant belongs to. + * @param {UUID} universalApplicationTenantId The Id of the UniversalApplicationTenant to delete. + * @returns {Promise>} + */ + deleteUniversalApplicationTenant(applicationId: UUID, universalApplicationTenantId: UUID): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment(applicationId) + .withUriSegment("universal-application-tenant") + .withUriSegment(universalApplicationTenantId) + .withMethod("DELETE") + .go(); + } + + /** + * Removes the specified tenants from the universal application tenants list. + * + * @param {UUID} applicationId The Id of the universal application that the tenants are linked to. + * @param {Array} tenantIds The Ids of the tenants to delete from the universal application tenants list. + * @returns {Promise>} + */ + deleteUniversalApplicationTenants(applicationId: UUID, tenantIds: Array): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment(applicationId) + .withUriSegment("application-tenant") + .withParameter('tenantIds', tenantIds) + .withMethod("DELETE") + .go(); + } + /** * Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated * with the user. @@ -3784,6 +3837,23 @@ export class FusionAuthClient { .go(); } + /** + * Retrieves the universal application tenant. + * + * @param {UUID} applicationId The Id of the universal application that tenant is mapped to + * @param {UUID} universalApplicationTenantId The Id of the universal application tenant. + * @returns {Promise>} + */ + retrieveUniversalApplicationTenant(applicationId: UUID, universalApplicationTenantId: UUID): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment(applicationId) + .withUriSegment("application-tenant") + .withUriSegment(universalApplicationTenantId) + .withMethod("GET") + .go(); + } + /** * Retrieves the user for the given Id. * @@ -4620,6 +4690,22 @@ export class FusionAuthClient { .go(); } + /** + * Searches universal application tenants for the specified applicationId and with the specified criteria and pagination. + * + * @param {UniversalApplicationTenantSearchRequest} request The search criteria and pagination information. + * @returns {Promise>} + */ + searchUniversalApplicationTenants(request: UniversalApplicationTenantSearchRequest): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment("universal-application-tenant") + .withUriSegment("search") + .withJSONBody(request) + .withMethod("POST") + .go(); + } + /** * Searches user comments with the specified criteria and pagination. * @@ -5342,6 +5428,25 @@ export class FusionAuthClient { .go(); } + /** + * Adds the application tenants for universal applications. + * + * @param {UUID} applicationId The Id of the application that the UniversalApplicationTenant belongs to. + * @param {UUID} universalApplicationTenantId The Id of the universal application tenant. + * @param {UniversalApplicationTenantRequest} request The request object that contains all the information used to create the UniversalApplicationTenant. + * @returns {Promise>} + */ + updateUniversalApplicationTenant(applicationId: UUID, universalApplicationTenantId: UUID, request: UniversalApplicationTenantRequest): Promise> { + return this.start() + .withUri('/api/application') + .withUriSegment(applicationId) + .withUriSegment("universal-application-tenant") + .withUriSegment(universalApplicationTenantId) + .withJSONBody(request) + .withMethod("PUT") + .go(); + } + /** * Updates the user with the given Id. * @@ -5791,7 +5896,7 @@ export interface Application { state?: ObjectState; tenantId?: UUID; themeId?: UUID; - universalConfiguration?: UniversalConfiguration; + universalConfiguration?: UniversalApplicationConfiguration; unverified?: RegistrationUnverifiedOptions; verificationEmailTemplateId?: UUID; verificationStrategy?: VerificationStrategy; @@ -5912,12 +6017,6 @@ export enum XMLSignatureLocation { Response = "Response" } -export interface UniversalConfiguration { - applicationTenants?: Array; - global?: boolean; - universal?: boolean; -} - /** * @author Daniel DeGroff */ @@ -11162,8 +11261,69 @@ export interface TwoFactorTrust { /** * @author Lyle Schemmerling */ +export interface UniversalApplicationConfiguration { + global?: boolean; + universal?: boolean; +} + +/** + * An object that represents the mapping between a Universal Application and a Tenant. + * + * @author Lyle Schemmerling + */ export interface UniversalApplicationTenant { + applicationId?: UUID; + data?: Record; + id?: UUID; + insertInstant?: number; + lastUpdateInstant?: number; + tenantId?: UUID; +} + +/** + * The request object for creating or updating a Universal Application Tenant. + * + * @author Lyle Schemmerling + */ +export interface UniversalApplicationTenantRequest { + universalApplicationTenant?: UniversalApplicationTenant; +} + +/** + * The response object for a single Universal Application Tenant. + * + * @author Lyle Schemmerling + */ +export interface UniversalApplicationTenantResponse { + universalApplicationTenant?: UniversalApplicationTenant; +} + +/** + * @author Lyle Schemmerling + */ +export interface UniversalApplicationTenantSearchCriteria extends BaseSearchCriteria { + applicationId?: UUID; tenantId?: UUID; + tenantName?: string; +} + +/** + * The request object with the search criteria for Universal Application Tenants. + * + * @author Lyle Schemmerling + */ +export interface UniversalApplicationTenantSearchRequest { + search?: UniversalApplicationTenantSearchCriteria; +} + +/** + * The response object for Universal Application Tenants search results. + * + * @author Lyle Schemmerling + */ +export interface UniversalApplicationTenantSearchResponse { + total?: number; + universalApplicationTenants?: Array; } /**