Skip to content
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

Feature/SDK-4921 #1028

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"homepage": "https://github.com/auth0/node-auth0",
"dependencies": {
"jose": "^4.13.2",
"uuid": "^9.0.0",
"undici-types": "^6.15.0"
"undici-types": "^6.15.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/jest": "^29.5.0",
Expand Down
2 changes: 2 additions & 0 deletions src/management/__generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
RolesManager,
RulesManager,
RulesConfigsManager,
SelfServiceProfilesManager,
SessionsManager,
StatsManager,
TenantsManager,
Expand Down Expand Up @@ -66,6 +67,7 @@ export abstract class ManagementClientBase {
public readonly roles = new RolesManager(this.configuration);
public readonly rules = new RulesManager(this.configuration);
public readonly rulesConfigs = new RulesConfigsManager(this.configuration);
public readonly selfServiceProfiles = new SelfServiceProfilesManager(this.configuration);
public readonly sessions = new SessionsManager(this.configuration);
public readonly stats = new StatsManager(this.configuration);
public readonly tenants = new TenantsManager(this.configuration);
Expand Down
1 change: 1 addition & 0 deletions src/management/__generated/managers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export * from './resource-servers-manager.js';
export * from './roles-manager.js';
export * from './rules-manager.js';
export * from './rules-configs-manager.js';
export * from './self-service-profiles-manager.js';
export * from './sessions-manager.js';
export * from './stats-manager.js';
export * from './tenants-manager.js';
Expand Down
184 changes: 184 additions & 0 deletions src/management/__generated/managers/self-service-profiles-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
SsProfile,
SsProfileCreate,
SsProfileList,
SsProfileUpdate,
SsoAccessTicketResponse,
SsoTicketRequestJson,
DeleteSelfServiceProfilesByIdRequest,
GetSelfServiceProfilesByIdRequest,
PatchSelfServiceProfilesByIdRequest,
PostSsoTicketRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;

/**
*
*/
export class SelfServiceProfilesManager extends BaseAPI {
/**
* Deletes a self-service profile by Id.
* Delete a self-service profile by Id
*
* @throws {RequiredError}
*/
async deleteSelfServiceProfiles(
requestParameters: DeleteSelfServiceProfilesByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<void>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/self-service-profiles/{id}`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'DELETE',
},
initOverrides
);

return runtime.VoidApiResponse.fromResponse(response);
}

/**
* Retrieves self-service profiles. Currently only one profile can be created per tenant.
* Retrieve self-service profiles
*
* @throws {RequiredError}
*/
async getSelfServiceProfiles(initOverrides?: InitOverride): Promise<ApiResponse<SsProfileList>> {
const response = await this.request(
{
path: `/self-service-profiles`,
method: 'GET',
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Retrieves a self-service profile by Id.
* Retrieve a self-service profile by Id
*
* @throws {RequiredError}
*/
async getSelfServiceProfilesById(
requestParameters: GetSelfServiceProfilesByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<SsProfile>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/self-service-profiles/{id}`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'GET',
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Updates a self-service profile.
* Update a self-service profile
*
* @throws {RequiredError}
*/
async patchSelfServiceProfiles(
requestParameters: PatchSelfServiceProfilesByIdRequest,
bodyParameters: SsProfileUpdate,
initOverrides?: InitOverride
): Promise<ApiResponse<SsProfile>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

const response = await this.request(
{
path: `/self-service-profiles/{id}`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'PATCH',
headers: headerParameters,
body: bodyParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Creates a self-service profile. Currently only one profile can be created per tenant.
* Create a self-service profile
*
* @throws {RequiredError}
*/
async postSelfServiceProfiles(
bodyParameters: SsProfileCreate,
initOverrides?: InitOverride
): Promise<ApiResponse<SsProfile>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

const response = await this.request(
{
path: `/self-service-profiles`,
method: 'POST',
headers: headerParameters,
body: bodyParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Creates an sso-access ticket to initiate the Self Service SSO Flow using a self-service profile.
* Create an sso-access ticket to initiate the Self Service SSO Flow
*
* @throws {RequiredError}
*/
async postSsoTicket(
requestParameters: PostSsoTicketRequest,
bodyParameters: SsoTicketRequestJson,
initOverrides?: InitOverride
): Promise<ApiResponse<SsoAccessTicketResponse>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

const response = await this.request(
{
path: `/self-service-profiles/{id}/sso-ticket`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'POST',
headers: headerParameters,
body: bodyParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}
}
Loading
Loading