From 02bdf7f9652c9f9268da2a7177c0ba4812f35e48 Mon Sep 17 00:00:00 2001 From: Tushar Pandey Date: Fri, 8 Nov 2024 18:48:41 +0530 Subject: [PATCH] added missing forms endpoints and tests --- .../__generated/managers/flows-manager.ts | 320 +++- .../__generated/managers/forms-manager.ts | 35 +- src/management/__generated/models/index.ts | 1281 ++++++++++++++++- test/management/flows.test.ts | 162 ++- 4 files changed, 1701 insertions(+), 97 deletions(-) diff --git a/src/management/__generated/managers/flows-manager.ts b/src/management/__generated/managers/flows-manager.ts index 5cfa12f64..ab8da3bee 100644 --- a/src/management/__generated/managers/flows-manager.ts +++ b/src/management/__generated/managers/flows-manager.ts @@ -2,14 +2,32 @@ import * as runtime from '../../../lib/runtime.js'; import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; import type { GetFlows200Response, + GetFlowsExecutions200Response, + GetFlowsExecutionsByExecutionId200Response, + GetFlowsVaultConnections200Response, PatchFlowsByIdRequest, + PatchFlowsVaultConnectionsByIdRequest, PostFlows201Response, PostFlowsRequest, + PostFlowsVaultConnections201Response, + PostFlowsVaultConnectionsRequest, GetFlows200ResponseOneOf, GetFlows200ResponseOneOfInner, + GetFlowsExecutions200ResponseOneOf, + GetFlowsExecutions200ResponseOneOfInner, + GetFlowsVaultConnections200ResponseOneOf, + GetFlowsVaultConnections200ResponseOneOfInner, + DeleteFlowsByIdRequest, + DeleteFlowsExecutionsByExecutionIdRequest, + DeleteFlowsVaultConnectionsByIdRequest, GetFlowsRequest, GetFlowsByIdRequest, + GetFlowsExecutionsRequest, + GetFlowsExecutionsByExecutionIdRequest, + GetFlowsVaultConnectionsRequest, + GetFlowsVaultConnectionsByIdRequest, PatchFlowsByIdOperationRequest, + PatchFlowsVaultConnectionsByIdOperationRequest, } from '../models/index.js'; const { BaseAPI } = runtime; @@ -18,20 +36,91 @@ const { BaseAPI } = runtime; * */ export class FlowsManager extends BaseAPI { + /** + * Delete a flow + * + * @throws {RequiredError} + */ + async delete( + requestParameters: DeleteFlowsByIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['id']); + + const response = await this.request( + { + path: `/flows/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + }, + initOverrides + ); + + return runtime.VoidApiResponse.fromResponse(response); + } + + /** + * Delete a flow execution + * + * @throws {RequiredError} + */ + async deleteExecution( + requestParameters: DeleteFlowsExecutionsByExecutionIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['flow_id', 'execution_id']); + + const response = await this.request( + { + path: `/flows/{flow_id}/executions/{execution_id}` + .replace('{flow_id}', encodeURIComponent(String(requestParameters.flow_id))) + .replace('{execution_id}', encodeURIComponent(String(requestParameters.execution_id))), + method: 'DELETE', + }, + initOverrides + ); + + return runtime.VoidApiResponse.fromResponse(response); + } + + /** + * Delete a Flows Vault connection + * + * @throws {RequiredError} + */ + async deleteConnection( + requestParameters: DeleteFlowsVaultConnectionsByIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['id']); + + const response = await this.request( + { + path: `/flows/vault/connections/{id}`.replace( + '{id}', + encodeURIComponent(String(requestParameters.id)) + ), + method: 'DELETE', + }, + initOverrides + ); + + return runtime.VoidApiResponse.fromResponse(response); + } + /** * Get flows * * @throws {RequiredError} */ - async getFlows( + async getAll( requestParameters: GetFlowsRequest & { include_totals: true }, initOverrides?: InitOverride ): Promise>; - async getFlows( + async getAll( requestParameters?: GetFlowsRequest, initOverrides?: InitOverride ): Promise>>; - async getFlows( + async getAll( requestParameters: GetFlowsRequest = {}, initOverrides?: InitOverride ): Promise> { @@ -78,7 +167,7 @@ export class FlowsManager extends BaseAPI { * * @throws {RequiredError} */ - async getFlowsById( + async get( requestParameters: GetFlowsByIdRequest, initOverrides?: InitOverride ): Promise> { @@ -106,12 +195,173 @@ export class FlowsManager extends BaseAPI { return runtime.JSONApiResponse.fromResponse(response); } + /** + * Get flow executions + * + * @throws {RequiredError} + */ + async getAllExecutions( + requestParameters: GetFlowsExecutionsRequest & { include_totals: true }, + initOverrides?: InitOverride + ): Promise>; + async getAllExecutions( + requestParameters?: GetFlowsExecutionsRequest, + initOverrides?: InitOverride + ): Promise>>; + async getAllExecutions( + requestParameters: GetFlowsExecutionsRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['flow_id']); + + const queryParameters = runtime.applyQueryParams(requestParameters, [ + { + key: 'page', + config: {}, + }, + { + key: 'per_page', + config: {}, + }, + { + key: 'include_totals', + config: {}, + }, + { + key: 'from', + config: {}, + }, + { + key: 'take', + config: {}, + }, + ]); + + const response = await this.request( + { + path: `/flows/{flow_id}/executions`.replace( + '{flow_id}', + encodeURIComponent(String(requestParameters.flow_id)) + ), + method: 'GET', + query: queryParameters, + }, + initOverrides + ); + + return runtime.JSONApiResponse.fromResponse(response); + } + + /** + * Get a flow execution + * + * @throws {RequiredError} + */ + async getExecution( + requestParameters: GetFlowsExecutionsByExecutionIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['flow_id', 'execution_id']); + + const queryParameters = runtime.applyQueryParams(requestParameters, [ + { + key: 'hydrate', + config: { + isArray: true, + isCollectionFormatMulti: true, + }, + }, + ]); + + const response = await this.request( + { + path: `/flows/{flow_id}/executions/{execution_id}` + .replace('{flow_id}', encodeURIComponent(String(requestParameters.flow_id))) + .replace('{execution_id}', encodeURIComponent(String(requestParameters.execution_id))), + method: 'GET', + query: queryParameters, + }, + initOverrides + ); + + return runtime.JSONApiResponse.fromResponse(response); + } + + /** + * Get Flows Vault connection list + * + * @throws {RequiredError} + */ + async getAllConnections( + requestParameters: GetFlowsVaultConnectionsRequest & { include_totals: true }, + initOverrides?: InitOverride + ): Promise>; + async getAllConnections( + requestParameters?: GetFlowsVaultConnectionsRequest, + initOverrides?: InitOverride + ): Promise>>; + async getAllConnections( + requestParameters: GetFlowsVaultConnectionsRequest = {}, + initOverrides?: InitOverride + ): Promise> { + const queryParameters = runtime.applyQueryParams(requestParameters, [ + { + key: 'page', + config: {}, + }, + { + key: 'per_page', + config: {}, + }, + { + key: 'include_totals', + config: {}, + }, + ]); + + const response = await this.request( + { + path: `/flows/vault/connections`, + method: 'GET', + query: queryParameters, + }, + initOverrides + ); + + return runtime.JSONApiResponse.fromResponse(response); + } + + /** + * Get a Flows Vault connection + * + * @throws {RequiredError} + */ + async getConnection( + requestParameters: GetFlowsVaultConnectionsByIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['id']); + + const response = await this.request( + { + path: `/flows/vault/connections/{id}`.replace( + '{id}', + encodeURIComponent(String(requestParameters.id)) + ), + method: 'GET', + }, + initOverrides + ); + + return runtime.JSONApiResponse.fromResponse(response); + } + /** * Update a flow * * @throws {RequiredError} */ - async patchFlowsById( + async update( requestParameters: PatchFlowsByIdOperationRequest, bodyParameters: PatchFlowsByIdRequest, initOverrides?: InitOverride @@ -135,12 +385,44 @@ export class FlowsManager extends BaseAPI { return runtime.JSONApiResponse.fromResponse(response); } + /** + * Update a Flows Vault connection + * + * @throws {RequiredError} + */ + async updateConnection( + requestParameters: PatchFlowsVaultConnectionsByIdOperationRequest, + bodyParameters: PatchFlowsVaultConnectionsByIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['id']); + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request( + { + path: `/flows/vault/connections/{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( + async create( bodyParameters: PostFlowsRequest, initOverrides?: InitOverride ): Promise> { @@ -160,4 +442,30 @@ export class FlowsManager extends BaseAPI { return runtime.JSONApiResponse.fromResponse(response); } + + /** + * Create a Flows Vault connection + * + * @throws {RequiredError} + */ + async createConnection( + bodyParameters: PostFlowsVaultConnectionsRequest, + initOverrides?: InitOverride + ): Promise> { + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request( + { + path: `/flows/vault/connections`, + method: 'POST', + headers: headerParameters, + body: bodyParameters, + }, + initOverrides + ); + + return runtime.JSONApiResponse.fromResponse(response); + } } diff --git a/src/management/__generated/managers/forms-manager.ts b/src/management/__generated/managers/forms-manager.ts index 89cb280c7..d7b385173 100644 --- a/src/management/__generated/managers/forms-manager.ts +++ b/src/management/__generated/managers/forms-manager.ts @@ -7,6 +7,7 @@ import type { PostFormsRequest, GetForms200ResponseOneOf, GetForms200ResponseOneOfInner, + DeleteFormsByIdRequest, GetFormsRequest, GetFormsByIdRequest, PatchFormsByIdOperationRequest, @@ -18,20 +19,42 @@ const { BaseAPI } = runtime; * */ export class FormsManager extends BaseAPI { + /** + * Delete a form + * + * @throws {RequiredError} + */ + async delete( + requestParameters: DeleteFormsByIdRequest, + initOverrides?: InitOverride + ): Promise> { + runtime.validateRequiredRequestParams(requestParameters, ['id']); + + const response = await this.request( + { + path: `/forms/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + }, + initOverrides + ); + + return runtime.VoidApiResponse.fromResponse(response); + } + /** * Get forms * * @throws {RequiredError} */ - async getForms( + async getAll( requestParameters: GetFormsRequest & { include_totals: true }, initOverrides?: InitOverride ): Promise>; - async getForms( + async getAll( requestParameters?: GetFormsRequest, initOverrides?: InitOverride ): Promise>>; - async getForms( + async getAll( requestParameters: GetFormsRequest = {}, initOverrides?: InitOverride ): Promise> { @@ -74,7 +97,7 @@ export class FormsManager extends BaseAPI { * * @throws {RequiredError} */ - async getFormsById( + async get( requestParameters: GetFormsByIdRequest, initOverrides?: InitOverride ): Promise> { @@ -107,7 +130,7 @@ export class FormsManager extends BaseAPI { * * @throws {RequiredError} */ - async patchFormsById( + async update( requestParameters: PatchFormsByIdOperationRequest, bodyParameters: PatchFormsByIdRequest, initOverrides?: InitOverride @@ -136,7 +159,7 @@ export class FormsManager extends BaseAPI { * * @throws {RequiredError} */ - async postForms( + async create( bodyParameters: PostFormsRequest, initOverrides?: InitOverride ): Promise> { diff --git a/src/management/__generated/models/index.ts b/src/management/__generated/models/index.ts index f43caab4d..3c89ac721 100644 --- a/src/management/__generated/models/index.ts +++ b/src/management/__generated/models/index.ts @@ -5525,6 +5525,195 @@ export interface GetFlows200ResponseOneOfInner { */ executed_at?: string; } +/** + * + */ +export type GetFlowsExecutions200Response = + | Array + | GetFlowsExecutions200ResponseOneOf; +/** + * + */ +export interface GetFlowsExecutions200ResponseOneOf { + /** + */ + start: number; + /** + */ + limit: number; + /** + */ + total: number; + /** + */ + executions: Array; +} +/** + * + */ +export interface GetFlowsExecutions200ResponseOneOfInner { + /** + * Flow execution identifier + * + */ + id: string; + /** + * Trace id + * + */ + trace_id: string; + /** + * Journey id + * + */ + journey_id?: string; + /** + * Execution status + * + */ + status: string; + /** + * The ISO 8601 formatted date when this flow execution was created. + * + */ + created_at: string; + /** + * The ISO 8601 formatted date when this flow execution was updated. + * + */ + updated_at: string; + /** + * The ISO 8601 formatted date when this flow execution started. + * + */ + started_at?: string; + /** + * The ISO 8601 formatted date when this flow execution ended. + * + */ + ended_at?: string; +} +/** + * + */ +export interface GetFlowsExecutionsByExecutionId200Response { + /** + * Flow execution identifier + * + */ + id: string; + /** + * Trace id + * + */ + trace_id: string; + /** + * Journey id + * + */ + journey_id?: string; + /** + * Execution status + * + */ + status: string; + /** + * Flow execution debug. + * + */ + debug?: { [key: string]: any }; + /** + * The ISO 8601 formatted date when this flow execution was created. + * + */ + created_at: string; + /** + * The ISO 8601 formatted date when this flow execution was updated. + * + */ + updated_at: string; + /** + * The ISO 8601 formatted date when this flow execution started. + * + */ + started_at?: string; + /** + * The ISO 8601 formatted date when this flow execution ended. + * + */ + ended_at?: string; +} +/** + * + */ +export type GetFlowsVaultConnections200Response = + | Array + | GetFlowsVaultConnections200ResponseOneOf; +/** + * + */ +export interface GetFlowsVaultConnections200ResponseOneOf { + /** + */ + start: number; + /** + */ + limit: number; + /** + */ + total: number; + /** + */ + connections: Array; +} +/** + * + */ +export interface GetFlowsVaultConnections200ResponseOneOfInner { + /** + * Flows Vault Connection identifier. + * + */ + id: string; + /** + * Flows Vault Connection app identifier. + * + */ + app_id: string; + /** + * Flows Vault Connection name. + * + */ + name: string; + /** + * Flows Vault Connection custom account name. + * + */ + account_name?: string; + /** + * Whether the Flows Vault Connection is configured. + * + */ + ready: boolean; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was created. + * + */ + created_at: string; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was updated. + * + */ + updated_at: string; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + * + */ + refreshed_at?: string; + /** + */ + fingerprint: string; +} /** * */ @@ -8704,6 +8893,37 @@ export interface PatchFlowsByIdRequest { */ actions?: Array; } +/** + * + */ +export interface PatchFlowsVaultConnectionsByIdRequest { + /** + * Flows Vault Connection name. + * + */ + name?: string; + /** + */ + setup?: PatchFlowsVaultConnectionsByIdRequestSetup; +} +/** + * Flows Vault Connection configuration. + */ +export type PatchFlowsVaultConnectionsByIdRequestSetup = + | PostFlowsVaultConnectionsRequestAnyOf11Setup + | PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1 + | PostFlowsVaultConnectionsRequestAnyOf18Setup + | PostFlowsVaultConnectionsRequestAnyOf1Setup + | PostFlowsVaultConnectionsRequestAnyOf2Setup + | PostFlowsVaultConnectionsRequestAnyOf3Setup + | PostFlowsVaultConnectionsRequestAnyOf4Setup + | PostFlowsVaultConnectionsRequestAnyOf5Setup + | PostFlowsVaultConnectionsRequestAnyOf7Setup + | PostFlowsVaultConnectionsRequestAnyOf9Setup + | PostFlowsVaultConnectionsRequestAnyOfSetup; /** * */ @@ -9931,117 +10151,930 @@ export const PostEmailTemplatesRequestTemplateEnum = { change_password: 'change_password', password_reset: 'password_reset', } as const; -export type PostEmailTemplatesRequestTemplateEnum = - (typeof PostEmailTemplatesRequestTemplateEnum)[keyof typeof PostEmailTemplatesRequestTemplateEnum]; +export type PostEmailTemplatesRequestTemplateEnum = + (typeof PostEmailTemplatesRequestTemplateEnum)[keyof typeof PostEmailTemplatesRequestTemplateEnum]; + +/** + * + */ +export interface PostEmailVerification201Response { + [key: string]: any | any; + /** + * URL representing the ticket. + * + */ + ticket: string; +} +/** + * + */ +export interface PostEmailVerificationRequest { + /** + * URL the user will be redirected to in the classic Universal Login experience once the ticket is used. + * + */ + result_url?: string; + /** + * user_id of for whom the ticket should be created. + * + */ + user_id: string; + /** + * ID of the client. If provided for tenants using New Universal Login experience, the user will be prompted to redirect to the default login route of the corresponding application once the ticket is used. See Configuring Default Login Routes for more details. + * + */ + client_id?: string; + /** + * (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. + * + */ + organization_id?: string; + /** + * Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). + * + */ + ttl_sec?: number; + /** + * Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). + * + */ + includeEmailInRedirect?: boolean; + /** + */ + identity?: PostVerificationEmailRequestIdentity; +} +/** + * + */ +export interface PostEnabledConnectionsRequest { + /** + * Single connection ID to add to the organization. + * + */ + connection_id: string; + /** + * When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. + * + */ + assign_membership_on_login?: boolean; + /** + * Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. + * + */ + is_signup_enabled?: boolean; + /** + * Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. + * + */ + show_as_button?: boolean; +} +/** + * + */ +export interface PostFlows201Response { + /** + */ + id: string; + /** + */ + name: string; + /** + */ + actions?: Array; + /** + */ + created_at: string; + /** + */ + updated_at: string; + /** + */ + executed_at?: string; +} +/** + * + */ +export interface PostFlowsRequest { + /** + */ + name: string; + /** + */ + actions?: Array; +} +/** + * + */ +export interface PostFlowsVaultConnections201Response { + /** + * Flows Vault Connection identifier. + * + */ + id: string; + /** + * Flows Vault Connection app identifier. + * + */ + app_id: string; + /** + * Flows Vault Connection environment. + * + */ + environment?: string; + /** + * Flows Vault Connection name. + * + */ + name: string; + /** + * Flows Vault Connection custom account name. + * + */ + account_name?: string; + /** + * Whether the Flows Vault Connection is configured. + * + */ + ready: boolean; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was created. + * + */ + created_at: string; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was updated. + * + */ + updated_at: string; + /** + * The ISO 8601 formatted date when this Flows Vault Connection was refreshed. + * + */ + refreshed_at?: string; + /** + */ + fingerprint: string; +} +/** + * + */ +export type PostFlowsVaultConnectionsRequest = + | PostFlowsVaultConnectionsRequestAnyOf + | PostFlowsVaultConnectionsRequestAnyOf1 + | PostFlowsVaultConnectionsRequestAnyOf10 + | PostFlowsVaultConnectionsRequestAnyOf11 + | PostFlowsVaultConnectionsRequestAnyOf12 + | PostFlowsVaultConnectionsRequestAnyOf13 + | PostFlowsVaultConnectionsRequestAnyOf14 + | PostFlowsVaultConnectionsRequestAnyOf15 + | PostFlowsVaultConnectionsRequestAnyOf16 + | PostFlowsVaultConnectionsRequestAnyOf17 + | PostFlowsVaultConnectionsRequestAnyOf18 + | PostFlowsVaultConnectionsRequestAnyOf19 + | PostFlowsVaultConnectionsRequestAnyOf2 + | PostFlowsVaultConnectionsRequestAnyOf20 + | PostFlowsVaultConnectionsRequestAnyOf3 + | PostFlowsVaultConnectionsRequestAnyOf4 + | PostFlowsVaultConnectionsRequestAnyOf5 + | PostFlowsVaultConnectionsRequestAnyOf6 + | PostFlowsVaultConnectionsRequestAnyOf7 + | PostFlowsVaultConnectionsRequestAnyOf8 + | PostFlowsVaultConnectionsRequestAnyOf9; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOfAppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOfSetup; +} + +export const PostFlowsVaultConnectionsRequestAnyOfAppIdEnum = { + ACTIVECAMPAIGN: 'ACTIVECAMPAIGN', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOfAppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOfAppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOfAppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf1 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf1AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf1Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf1AppIdEnum = { + AIRTABLE: 'AIRTABLE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf1AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf1AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf1AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf10 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf10AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf10Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf10AppIdEnum = { + MAILCHIMP: 'MAILCHIMP', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf10AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf10AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf10AppIdEnum]; + +/** + * + */ +export type PostFlowsVaultConnectionsRequestAnyOf10Setup = + | PostFlowsVaultConnectionsRequestAnyOf4Setup + | PostFlowsVaultConnectionsRequestAnyOf5Setup; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf11 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf11AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf11Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf11AppIdEnum = { + MAILJET: 'MAILJET', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf11AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf11AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf11AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf11Setup { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf11SetupTypeEnum; + /** + */ + api_key: string; + /** + */ + secret_key: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf11SetupTypeEnum = { + API_KEY: 'API_KEY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf11SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf11SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf11SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf12 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf12AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf12Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf12AppIdEnum = { + PIPEDRIVE: 'PIPEDRIVE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf12AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf12AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf12AppIdEnum]; + +/** + * + */ +export type PostFlowsVaultConnectionsRequestAnyOf12Setup = + | PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf5Setup; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOf { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOfTypeEnum; + /** + */ + token: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOfTypeEnum = { + TOKEN: 'TOKEN', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOfTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOfTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOfTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf13 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf13AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf5Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf13AppIdEnum = { + SALESFORCE: 'SALESFORCE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf13AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf13AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf13AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf14 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf14AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf1Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf14AppIdEnum = { + SENDGRID: 'SENDGRID', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf14AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf14AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf14AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf15 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf15AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf15Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf15AppIdEnum = { + SLACK: 'SLACK', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf15AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf15AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf15AppIdEnum]; + +/** + * + */ +export type PostFlowsVaultConnectionsRequestAnyOf15Setup = + | PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf5Setup; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOf { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOfTypeEnum; + /** + */ + url: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOfTypeEnum = { + WEBHOOK: 'WEBHOOK', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOfTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOfTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOfTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf16 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf16AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf16Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf16AppIdEnum = { + STRIPE: 'STRIPE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf16AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf16AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf16AppIdEnum]; + +/** + * + */ +export type PostFlowsVaultConnectionsRequestAnyOf16Setup = + | PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf + | PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOfTypeEnum; + /** + */ + private_key: string; + /** + */ + public_key: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOfTypeEnum = { + KEY_PAIR: 'KEY_PAIR', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOfTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOfTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOfTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1 { + [key: string]: any | any; + /** + */ + type?: PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1TypeEnum; + /** + */ + code?: string; + /** + */ + environment?: PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1EnvironmentEnum; +} + +export const PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1TypeEnum = { + OAUTH_CODE: 'OAUTH_CODE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1TypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1TypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1TypeEnum]; + +export const PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1EnvironmentEnum = { + live: 'live', + test: 'test', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1EnvironmentEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1EnvironmentEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf16SetupAnyOf1EnvironmentEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf17 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf17AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOf; +} + +export const PostFlowsVaultConnectionsRequestAnyOf17AppIdEnum = { + TELEGRAM: 'TELEGRAM', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf17AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf17AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf17AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf18 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf18AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf18Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf18AppIdEnum = { + TWILIO: 'TWILIO', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf18AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf18AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf18AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf18Setup { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf18SetupTypeEnum; + /** + */ + account_id: string; + /** + */ + api_key: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf18SetupTypeEnum = { + API_KEY: 'API_KEY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf18SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf18SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf18SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf19 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf19AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf12SetupAnyOf; +} + +export const PostFlowsVaultConnectionsRequestAnyOf19AppIdEnum = { + WHATSAPP: 'WHATSAPP', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf19AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf19AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf19AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf1Setup { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf1SetupTypeEnum; + /** + */ + api_key: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf1SetupTypeEnum = { + API_KEY: 'API_KEY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf1SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf1SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf1SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf2 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf2AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf2Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf2AppIdEnum = { + AUTH0: 'AUTH0', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf2AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf2AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf2AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf20 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf20AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf15SetupAnyOf; +} + +export const PostFlowsVaultConnectionsRequestAnyOf20AppIdEnum = { + ZAPIER: 'ZAPIER', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf20AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf20AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf20AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf2Setup { + /** + */ + type: PostFlowsVaultConnectionsRequestAnyOf2SetupTypeEnum; + /** + */ + client_id: string; + /** + */ + client_secret: string; + /** + */ + domain: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf2SetupTypeEnum = { + OAUTH_APP: 'OAUTH_APP', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf2SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf2SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf2SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf3 { + [key: string]: any | any; + /** + */ + app_id?: PostFlowsVaultConnectionsRequestAnyOf3AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf3Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf3AppIdEnum = { + BIGQUERY: 'BIGQUERY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf3AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf3AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf3AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf3Setup { + /** + */ + type?: PostFlowsVaultConnectionsRequestAnyOf3SetupTypeEnum; + /** + */ + project_id?: string; + /** + */ + private_key?: string; + /** + */ + client_email?: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf3SetupTypeEnum = { + OAUTH_JWT: 'OAUTH_JWT', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf3SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf3SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf3SetupTypeEnum]; /** * */ -export interface PostEmailVerification201Response { +export interface PostFlowsVaultConnectionsRequestAnyOf4 { [key: string]: any | any; /** - * URL representing the ticket. - * */ - ticket: string; + app_id?: PostFlowsVaultConnectionsRequestAnyOf4AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf4Setup; } + +export const PostFlowsVaultConnectionsRequestAnyOf4AppIdEnum = { + CLEARBIT: 'CLEARBIT', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf4AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf4AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf4AppIdEnum]; + /** * */ -export interface PostEmailVerificationRequest { +export interface PostFlowsVaultConnectionsRequestAnyOf4Setup { /** - * URL the user will be redirected to in the classic Universal Login experience once the ticket is used. - * */ - result_url?: string; + type: PostFlowsVaultConnectionsRequestAnyOf4SetupTypeEnum; /** - * user_id of for whom the ticket should be created. - * */ - user_id: string; + secret_key: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf4SetupTypeEnum = { + API_KEY: 'API_KEY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf4SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf4SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf4SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf5 { + [key: string]: any | any; /** - * ID of the client. If provided for tenants using New Universal Login experience, the user will be prompted to redirect to the default login route of the corresponding application once the ticket is used. See Configuring Default Login Routes for more details. - * */ - client_id?: string; + app_id?: PostFlowsVaultConnectionsRequestAnyOf5AppIdEnum; /** - * (Optional) Organization ID – the ID of the Organization. If provided, organization parameters will be made available to the email template and organization branding will be applied to the prompt. In addition, the redirect link in the prompt will include organization_id and organization_name query string parameters. - * */ - organization_id?: string; + setup?: PostFlowsVaultConnectionsRequestAnyOf5Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf5AppIdEnum = { + DOCUSIGN: 'DOCUSIGN', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf5AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf5AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf5AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf5Setup { + [key: string]: any | any; /** - * Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days). - * */ - ttl_sec?: number; + type?: PostFlowsVaultConnectionsRequestAnyOf5SetupTypeEnum; /** - * Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). - * */ - includeEmailInRedirect?: boolean; + code?: string; +} + +export const PostFlowsVaultConnectionsRequestAnyOf5SetupTypeEnum = { + OAUTH_CODE: 'OAUTH_CODE', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf5SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf5SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf5SetupTypeEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf6 { + [key: string]: any | any; /** */ - identity?: PostVerificationEmailRequestIdentity; + app_id?: PostFlowsVaultConnectionsRequestAnyOf6AppIdEnum; + /** + */ + setup?: PostFlowsVaultConnectionsRequestAnyOf5Setup; } + +export const PostFlowsVaultConnectionsRequestAnyOf6AppIdEnum = { + GOOGLE_SHEETS: 'GOOGLE_SHEETS', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf6AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf6AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf6AppIdEnum]; + /** * */ -export interface PostEnabledConnectionsRequest { +export interface PostFlowsVaultConnectionsRequestAnyOf7 { + [key: string]: any | any; /** - * Single connection ID to add to the organization. - * */ - connection_id: string; + app_id?: PostFlowsVaultConnectionsRequestAnyOf7AppIdEnum; /** - * When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection. - * */ - assign_membership_on_login?: boolean; + setup?: PostFlowsVaultConnectionsRequestAnyOf7Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf7AppIdEnum = { + HTTP: 'HTTP', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf7AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf7AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf7AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf7Setup { /** - * Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false. - * */ - is_signup_enabled?: boolean; + type: PostFlowsVaultConnectionsRequestAnyOf7SetupTypeEnum; /** - * Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true. - * */ - show_as_button?: boolean; + token: string; } + +export const PostFlowsVaultConnectionsRequestAnyOf7SetupTypeEnum = { + BEARER: 'BEARER', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf7SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf7SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf7SetupTypeEnum]; + /** * */ -export interface PostFlows201Response { +export interface PostFlowsVaultConnectionsRequestAnyOf8 { + [key: string]: any | any; /** */ - id: string; + app_id?: PostFlowsVaultConnectionsRequestAnyOf8AppIdEnum; /** */ - name: string; + setup?: PostFlowsVaultConnectionsRequestAnyOf8Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf8AppIdEnum = { + HUBSPOT: 'HUBSPOT', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf8AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf8AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf8AppIdEnum]; + +/** + * + */ +export type PostFlowsVaultConnectionsRequestAnyOf8Setup = + | PostFlowsVaultConnectionsRequestAnyOf1Setup + | PostFlowsVaultConnectionsRequestAnyOf5Setup; +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf9 { + [key: string]: any | any; /** */ - actions?: Array; + app_id?: PostFlowsVaultConnectionsRequestAnyOf9AppIdEnum; /** */ - created_at: string; + setup?: PostFlowsVaultConnectionsRequestAnyOf9Setup; +} + +export const PostFlowsVaultConnectionsRequestAnyOf9AppIdEnum = { + JWT: 'JWT', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf9AppIdEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf9AppIdEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf9AppIdEnum]; + +/** + * + */ +export interface PostFlowsVaultConnectionsRequestAnyOf9Setup { + [key: string]: any | any; /** */ - updated_at: string; + type: PostFlowsVaultConnectionsRequestAnyOf9SetupTypeEnum; /** */ - executed_at?: string; + algorithm: PostFlowsVaultConnectionsRequestAnyOf9SetupAlgorithmEnum; } + +export const PostFlowsVaultConnectionsRequestAnyOf9SetupTypeEnum = { + JWT: 'JWT', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf9SetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf9SetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf9SetupTypeEnum]; + +export const PostFlowsVaultConnectionsRequestAnyOf9SetupAlgorithmEnum = { + HS256: 'HS256', + HS384: 'HS384', + HS512: 'HS512', + RS256: 'RS256', + RS384: 'RS384', + RS512: 'RS512', + ES256: 'ES256', + ES384: 'ES384', + ES512: 'ES512', + PS256: 'PS256', + PS384: 'PS384', + PS512: 'PS512', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOf9SetupAlgorithmEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOf9SetupAlgorithmEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOf9SetupAlgorithmEnum]; + /** * */ -export interface PostFlowsRequest { +export interface PostFlowsVaultConnectionsRequestAnyOfSetup { /** */ - name: string; + type: PostFlowsVaultConnectionsRequestAnyOfSetupTypeEnum; /** */ - actions?: Array; + api_key: string; + /** + */ + base_url?: string; } + +export const PostFlowsVaultConnectionsRequestAnyOfSetupTypeEnum = { + API_KEY: 'API_KEY', +} as const; +export type PostFlowsVaultConnectionsRequestAnyOfSetupTypeEnum = + (typeof PostFlowsVaultConnectionsRequestAnyOfSetupTypeEnum)[keyof typeof PostFlowsVaultConnectionsRequestAnyOfSetupTypeEnum]; + /** * */ @@ -15937,6 +16970,41 @@ export interface GetProviderRequest { */ include_fields?: boolean; } +/** + * + */ +export interface DeleteFlowsByIdRequest { + /** + * Flow id + * + */ + id: string; +} +/** + * + */ +export interface DeleteFlowsExecutionsByExecutionIdRequest { + /** + * Flows id + * + */ + flow_id: string; + /** + * Flow execution identifier + * + */ + execution_id: string; +} +/** + * + */ +export interface DeleteFlowsVaultConnectionsByIdRequest { + /** + * Vault connection id + * + */ + id: string; +} /** * @@ -16001,6 +17069,101 @@ export interface GetFlowsByIdRequest { */ hydrate?: Array; } +/** + * + */ +export interface GetFlowsExecutionsRequest { + /** + * Flow id + * + */ + flow_id: string; + /** + * Page index of the results to return. First page is 0. + * + */ + page?: number; + /** + * Number of results per page. Defaults to 50. + * + */ + per_page?: number; + /** + * Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + * + */ + include_totals?: boolean; + /** + * Optional Id from which to start selection. + * + */ + from?: string; + /** + * Number of results per page. Defaults to 50. + * + */ + take?: number; +} + +/** + * + */ +export const GetFlowsExecutionsByExecutionIdHydrateEnum = { + debug: 'debug', +} as const; +export type GetFlowsExecutionsByExecutionIdHydrateEnum = + (typeof GetFlowsExecutionsByExecutionIdHydrateEnum)[keyof typeof GetFlowsExecutionsByExecutionIdHydrateEnum]; + +/** + * + */ +export interface GetFlowsExecutionsByExecutionIdRequest { + /** + * Flow id + * + */ + flow_id: string; + /** + * Flow execution id + * + */ + execution_id: string; + /** + * Hydration param + * + */ + hydrate?: Array; +} +/** + * + */ +export interface GetFlowsVaultConnectionsRequest { + /** + * Page index of the results to return. First page is 0. + * + */ + page?: number; + /** + * Number of results per page. Defaults to 50. + * + */ + per_page?: number; + /** + * Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). + * + */ + include_totals?: boolean; +} +/** + * + */ +export interface GetFlowsVaultConnectionsByIdRequest { + /** + * Flows Vault connection ID + * + */ + id: string; +} /** * */ @@ -16011,6 +17174,26 @@ export interface PatchFlowsByIdOperationRequest { */ id: string; } +/** + * + */ +export interface PatchFlowsVaultConnectionsByIdOperationRequest { + /** + * Flows Vault connection ID + * + */ + id: string; +} +/** + * + */ +export interface DeleteFormsByIdRequest { + /** + * Form id + * + */ + id: string; +} /** * diff --git a/test/management/flows.test.ts b/test/management/flows.test.ts index 605a27ca5..52092d7b8 100644 --- a/test/management/flows.test.ts +++ b/test/management/flows.test.ts @@ -1,7 +1,6 @@ import { FlowsManager } from '../../src/index.js'; import { ManagementClient } from '../../src/index.js'; import { checkMethod } from './tests.util.js'; -import { GetFlows200Response, PostFlows201Response } from '../../src/index.js'; const DOMAIN = `tenant.auth0.com`; const token = 'TOKEN'; @@ -9,49 +8,140 @@ const token = 'TOKEN'; describe('FlowsManager', () => { const flowsManager: FlowsManager = new ManagementClient({ domain: DOMAIN, token }).flows; - // this is the test for the method getFlows() - // it calls a GET endpoint and does not take any input parameters or body - describe('getFlows', () => { - const operation = flowsManager.getFlows(); - const expectedResponse: GetFlows200Response = {}; - const uri = `/flows`; - const method = 'get'; + describe('flows crud methods', () => { + // this is the test for the method getFlows() + // it calls a GET endpoint and does not take any input parameters or body + describe('getFlows', () => { + const operation = flowsManager.getAll(); + const uri = `/flows`; + const method = 'get'; - checkMethod({ operation, expectedResponse, uri, method }); - }); + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method getFlowsById() + // it calls a GET endpoint and takes input parameters but no input body + describe('getFlowsById', () => { + const operation = flowsManager.get({ id: 'flowId' }); + const uri = `/flows/flowId`; + const method = 'get'; + + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method patchFlowsById() + // it calls a PATCH endpoint and takes input parameters and body + describe('patchFlowsById', () => { + const requestBody: { name: string } = { name: 'flowName' }; + const operation = flowsManager.update({ id: 'flowId' }, requestBody); + const uri = `/flows/flowId`; + const method = 'patch'; + + checkMethod({ operation, uri, method, requestBody }); + }); - // this is the test for the method getFlowsById() - // it calls a GET endpoint and takes input parameters but no input body - describe('getFlowsById', () => { - const operation = flowsManager.getFlowsById({ id: 'flowId' }); - const expectedResponse: PostFlows201Response = {}; - const uri = `/flows/flowId`; - const method = 'get'; + describe('deleteFlowsById', () => { + const operation = flowsManager.delete({ id: 'flowId' }); + const uri = `/flows/flowId`; + const method = 'delete'; - checkMethod({ operation, expectedResponse, uri, method }); + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method postFlows() + // it calls a POST endpoint and takes only a body + describe('postFlows', () => { + const requestBody: { name: string } = { name: 'flowName' }; + const operation = flowsManager.create(requestBody); + const uri = `/flows`; + const method = 'post'; + checkMethod({ operation, uri, method, requestBody }); + }); }); - // this is the test for the method patchFlowsById() - // it calls a PATCH endpoint and takes input parameters and body - describe('patchFlowsById', () => { - const requestBody: { name: string } = { name: 'flowName' }; - const operation = flowsManager.patchFlowsById({ id: 'flowId' }, requestBody); - const expectedResponse: PostFlows201Response = {}; - const uri = `/flows/flowId`; - const method = 'patch'; + describe('connections crud methods', () => { + // this is the test for the method getConnections() + // it calls a GET endpoint and does not take any input parameters or body + describe('getConnections', () => { + const operation = flowsManager.getAllConnections(); + const uri = `/flows/vault/connections`; + const method = 'get'; + + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method getConnectionsById() + // it calls a GET endpoint and takes input parameters but no input body + describe('getConnectionsById', () => { + const operation = flowsManager.getConnection({ id: 'connectionId' }); + const uri = `/flows/vault/connections/connectionId`; + const method = 'get'; + + checkMethod({ operation, uri, method }); + }); - checkMethod({ operation, expectedResponse, uri, method, requestBody }); + // this is the test for the method patchConnectionsById() + // it calls a PATCH endpoint and takes input parameters and body + describe('patchConnectionsById', () => { + const requestBody: { name: string } = { name: 'flowName' }; + const operation = flowsManager.updateConnection({ id: 'connectionId' }, requestBody); + const uri = `/flows/vault/connections/connectionId`; + const method = 'patch'; + + checkMethod({ operation, uri, method, requestBody }); + }); + + describe('deleteConnectionsById', () => { + const operation = flowsManager.deleteConnection({ id: 'connectionId' }); + const uri = `/flows/vault/connections/connectionId`; + const method = 'delete'; + + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method postConnections() + // it calls a POST endpoint and takes only a body + describe('postConnections', () => { + const requestBody: { name: string } = { name: 'flowName' }; + const operation = flowsManager.createConnection(requestBody); + const uri = `/flows/vault/connections`; + const method = 'post'; + checkMethod({ operation, uri, method, requestBody }); + }); }); - // this is the test for the method postFlows() - // it calls a POST endpoint and takes only a body - describe('postFlows', () => { - const requestBody: { name: string } = { name: 'flowName' }; - const operation = flowsManager.postFlows(requestBody); - const expectedResponse: PostFlows201Response = {}; - const uri = `/flows`; - const method = 'post'; + describe('execution crud methods', () => { + // this is the test for the method getAllExecutions() + // it calls a GET endpoint and does not take any input parameters or body + describe('getExecutions', () => { + const operation = flowsManager.getAllExecutions({ flow_id: 'flowId' }); + const uri = `/flows/flowId/executions`; + const method = 'get'; + + checkMethod({ operation, uri, method }); + }); + + // this is the test for the method getExecution() + describe('getExecutionsById', () => { + const operation = flowsManager.getExecution({ + flow_id: 'flowId', + execution_id: 'executionId', + }); + const uri = `/flows/flowId/executions/executionId`; + const method = 'get'; + + checkMethod({ operation, uri, method }); + }); + + describe('deleteExecutionsById', () => { + const operation = flowsManager.deleteExecution({ + flow_id: 'flowId', + execution_id: 'executionId', + }); + const uri = `/flows/flowId/executions/executionId`; + const method = 'delete'; - checkMethod({ operation, expectedResponse, uri, method, requestBody }); + checkMethod({ operation, uri, method }); + }); }); });