Skip to content

add the application-tenant api and move it out of the application object #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feature/unification
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 81 additions & 1 deletion src/FusionAuthClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,23 @@ export class FusionAuthClient {
.go();
}

/**
* Adds the application tenants for universal applications.
*
* @param {UUID} applicationId The Id of the application that the role belongs to.
* @param {UniversalApplicationTenantsRequest} request The request object that contains all the information used to create the Entity.
* @returns {Promise<ClientResponse<UniversalApplicationTenantsResponse>>}
*/
createUniversalApplicationTenants(applicationId: UUID, request: UniversalApplicationTenantsRequest): Promise<ClientResponse<UniversalApplicationTenantsResponse>> {
return this.start<UniversalApplicationTenantsResponse, Errors>()
.withUri('/api/application')
.withUriSegment(applicationId)
.withUriSegment("application-tenant")
.withJSONBody(request)
.withMethod("POST")
.go();
}

/**
* Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
*
Expand Down Expand Up @@ -1305,6 +1322,40 @@ export class FusionAuthClient {
.go();
}

/**
* Removes the specified tenant from the universal application tenants list.
*
* @param {UUID} applicationId The Id of the application that the role belongs to.
* @param {UUID} tenantId The Id of the tenant to delete from the universal application tenants list.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUniversalApplicationTenant(applicationId: UUID, tenantId: UUID): Promise<ClientResponse<void>> {
return this.start<void, Errors>()
.withUri('/api/application')
.withUriSegment(applicationId)
.withUriSegment("application-tenant")
.withUriSegment(tenantId)
.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<string>} tenantIds The Ids of the tenants to delete from the universal application tenants list.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUniversalApplicationTenants(applicationId: UUID, tenantIds: Array<string>): Promise<ClientResponse<void>> {
return this.start<void, Errors>()
.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.
Expand Down Expand Up @@ -3784,6 +3835,21 @@ export class FusionAuthClient {
.go();
}

/**
* Retrieves the application tenants for universal applications.
*
* @param {UUID} applicationId The Id of the application that the role belongs to.
* @returns {Promise<ClientResponse<UniversalApplicationTenantsResponse>>}
*/
retrieveUniversalApplicationTenants(applicationId: UUID): Promise<ClientResponse<UniversalApplicationTenantsResponse>> {
return this.start<UniversalApplicationTenantsResponse, Errors>()
.withUri('/api/application')
.withUriSegment(applicationId)
.withUriSegment("application-tenant")
.withMethod("GET")
.go();
}

/**
* Retrieves the user for the given Id.
*
Expand Down Expand Up @@ -5913,7 +5979,6 @@ export enum XMLSignatureLocation {
}

export interface UniversalConfiguration {
applicationTenants?: Array<UniversalApplicationTenant>;
global?: boolean;
universal?: boolean;
}
Expand Down Expand Up @@ -11163,9 +11228,24 @@ export interface TwoFactorTrust {
* @author Lyle Schemmerling
*/
export interface UniversalApplicationTenant {
applicationId?: UUID;
tenantId?: UUID;
}

/**
* @author Lyle Schemmerling
*/
export interface UniversalApplicationTenantsRequest {
applicationTenants?: Array<UniversalApplicationTenant>;
}

/**
* @author Lyle Schemmerling
*/
export interface UniversalApplicationTenantsResponse {
applicationTenants?: Array<UniversalApplicationTenant>;
}

/**
* Policy for handling unknown OAuth scopes in the request
*
Expand Down