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/forms #1045

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This library supports the following tooling versions:

### Installation

Using [npm](https://npmjs.org) in your project directory run the following command:
Using [npm](https://npmjs.org) in your project directory, run the following command:

```bash
npm install auth0
Expand Down
4 changes: 4 additions & 0 deletions src/management/__generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
DeviceCredentialsManager,
EmailTemplatesManager,
EmailsManager,
FlowsManager,
FormsManager,
GrantsManager,
GuardianManager,
HooksManager,
Expand Down Expand Up @@ -53,6 +55,8 @@ export abstract class ManagementClientBase {
public readonly deviceCredentials = new DeviceCredentialsManager(this.configuration);
public readonly emailTemplates = new EmailTemplatesManager(this.configuration);
public readonly emails = new EmailsManager(this.configuration);
public readonly flows = new FlowsManager(this.configuration);
public readonly forms = new FormsManager(this.configuration);
public readonly grants = new GrantsManager(this.configuration);
public readonly guardian = new GuardianManager(this.configuration);
public readonly hooks = new HooksManager(this.configuration);
Expand Down
163 changes: 163 additions & 0 deletions src/management/__generated/managers/flows-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
GetFlows200Response,
PatchFlowsByIdRequest,
PostFlows201Response,
PostFlowsRequest,
GetFlows200ResponseOneOf,
GetFlows200ResponseOneOfInner,
GetFlowsRequest,
GetFlowsByIdRequest,
PatchFlowsByIdOperationRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;

/**
*
*/
export class FlowsManager extends BaseAPI {
/**
* Get flows
*
* @throws {RequiredError}
*/
async getFlows(
requestParameters: GetFlowsRequest & { include_totals: true },
initOverrides?: InitOverride
): Promise<ApiResponse<GetFlows200ResponseOneOf>>;
async getFlows(
requestParameters?: GetFlowsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<Array<GetFlows200ResponseOneOfInner>>>;
async getFlows(
requestParameters: GetFlowsRequest = {},
initOverrides?: InitOverride
): Promise<ApiResponse<GetFlows200Response>> {
const queryParameters = runtime.applyQueryParams(requestParameters, [
{
key: 'page',
config: {},
},
{
key: 'per_page',
config: {},
},
{
key: 'include_totals',
config: {},
},
{
key: 'hydrate',
config: {
isArray: true,
isCollectionFormatMulti: true,
},
},
{
key: 'synchronous',
config: {},
},
]);

const response = await this.request(
{
path: `/flows`,
method: 'GET',
query: queryParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Get a flow
*
* @throws {RequiredError}
*/
async getFlowsById(
requestParameters: GetFlowsByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostFlows201Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const queryParameters = runtime.applyQueryParams(requestParameters, [
{
key: 'hydrate',
config: {
isArray: true,
isCollectionFormatMulti: true,
},
},
]);

const response = await this.request(
{
path: `/flows/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))),
method: 'GET',
query: queryParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Update a flow
*
* @throws {RequiredError}
*/
async patchFlowsById(
requestParameters: PatchFlowsByIdOperationRequest,
bodyParameters: PatchFlowsByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostFlows201Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const headerParameters: runtime.HTTPHeaders = {};

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

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

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Create a flow
*
* @throws {RequiredError}
*/
async postFlows(
bodyParameters: PostFlowsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostFlows201Response>> {
const headerParameters: runtime.HTTPHeaders = {};

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

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

return runtime.JSONApiResponse.fromResponse(response);
}
}
159 changes: 159 additions & 0 deletions src/management/__generated/managers/forms-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
GetForms200Response,
PatchFormsByIdRequest,
PostForms201Response,
PostFormsRequest,
GetForms200ResponseOneOf,
GetForms200ResponseOneOfInner,
GetFormsRequest,
GetFormsByIdRequest,
PatchFormsByIdOperationRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;

/**
*
*/
export class FormsManager extends BaseAPI {
/**
* Get forms
*
* @throws {RequiredError}
*/
async getForms(
requestParameters: GetFormsRequest & { include_totals: true },
initOverrides?: InitOverride
): Promise<ApiResponse<GetForms200ResponseOneOf>>;
async getForms(
requestParameters?: GetFormsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<Array<GetForms200ResponseOneOfInner>>>;
async getForms(
requestParameters: GetFormsRequest = {},
initOverrides?: InitOverride
): Promise<ApiResponse<GetForms200Response>> {
const queryParameters = runtime.applyQueryParams(requestParameters, [
{
key: 'page',
config: {},
},
{
key: 'per_page',
config: {},
},
{
key: 'include_totals',
config: {},
},
{
key: 'hydrate',
config: {
isArray: true,
isCollectionFormatMulti: true,
},
},
]);

const response = await this.request(
{
path: `/forms`,
method: 'GET',
query: queryParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Get a form
*
* @throws {RequiredError}
*/
async getFormsById(
requestParameters: GetFormsByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostForms201Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const queryParameters = runtime.applyQueryParams(requestParameters, [
{
key: 'hydrate',
config: {
isArray: true,
isCollectionFormatMulti: true,
},
},
]);

const response = await this.request(
{
path: `/forms/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))),
method: 'GET',
query: queryParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Update a form
*
* @throws {RequiredError}
*/
async patchFormsById(
requestParameters: PatchFormsByIdOperationRequest,
bodyParameters: PatchFormsByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostForms201Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const headerParameters: runtime.HTTPHeaders = {};

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

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

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Create a form
*
* @throws {RequiredError}
*/
async postForms(
bodyParameters: PostFormsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PostForms201Response>> {
const headerParameters: runtime.HTTPHeaders = {};

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

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

return runtime.JSONApiResponse.fromResponse(response);
}
}
2 changes: 2 additions & 0 deletions src/management/__generated/managers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export * from './custom-domains-manager.js';
export * from './device-credentials-manager.js';
export * from './email-templates-manager.js';
export * from './emails-manager.js';
export * from './flows-manager.js';
export * from './forms-manager.js';
export * from './grants-manager.js';
export * from './guardian-manager.js';
export * from './hooks-manager.js';
Expand Down
Loading
Loading