From 40ff0fdcd5adcacbdfc865c3f290ac0e148389ba Mon Sep 17 00:00:00 2001 From: Ampersand Ops Date: Tue, 14 Jul 2026 00:38:04 +0000 Subject: [PATCH] [auto] Update openapi to 2e1dd6eef338426a1aa4a4f0fea94792cde50025 --- .../api/.openapi-generator/FILES | 6 + .../api/src/apis/ConnectionApi.ts | 73 +++++++++ .../src/models/CustomAuthConnectRequest.ts | 153 ++++++++++++++++++ .../src/models/CustomAuthConnectResponse.ts | 65 ++++++++ .../models/CustomAuthConnectResponseOneOf.ts | 73 +++++++++ .../models/CustomAuthConnectResponseOneOf1.ts | 73 +++++++++ .../api/src/models/CustomAuthInput.ts | 35 ++++ .../api/src/models/CustomAuthInputOption.ts | 75 +++++++++ .../api/src/models/CustomAuthOpts.ts | 16 ++ .../api/src/models/RedirectResponse.ts | 75 +++++++++ generated-sources/api/src/models/index.ts | 6 + 11 files changed, 650 insertions(+) create mode 100644 generated-sources/api/src/models/CustomAuthConnectRequest.ts create mode 100644 generated-sources/api/src/models/CustomAuthConnectResponse.ts create mode 100644 generated-sources/api/src/models/CustomAuthConnectResponseOneOf.ts create mode 100644 generated-sources/api/src/models/CustomAuthConnectResponseOneOf1.ts create mode 100644 generated-sources/api/src/models/CustomAuthInputOption.ts create mode 100644 generated-sources/api/src/models/RedirectResponse.ts diff --git a/generated-sources/api/.openapi-generator/FILES b/generated-sources/api/.openapi-generator/FILES index 883772189..0174c7108 100644 --- a/generated-sources/api/.openapi-generator/FILES +++ b/generated-sources/api/.openapi-generator/FILES @@ -93,8 +93,13 @@ src/models/CreateProviderAppRequest.ts src/models/CreateRevisionRequest.ts src/models/CreateTopicDestinationRouteRequest.ts src/models/CreateTopicRequest.ts +src/models/CustomAuthConnectRequest.ts +src/models/CustomAuthConnectResponse.ts +src/models/CustomAuthConnectResponseOneOf.ts +src/models/CustomAuthConnectResponseOneOf1.ts src/models/CustomAuthHeader.ts src/models/CustomAuthInput.ts +src/models/CustomAuthInputOption.ts src/models/CustomAuthOpts.ts src/models/CustomAuthQueryParam.ts src/models/DefaultPeriod.ts @@ -198,6 +203,7 @@ src/models/ReadConfig.ts src/models/ReadConfigAllOf.ts src/models/ReadConfigObject.ts src/models/ReadFilter.ts +src/models/RedirectResponse.ts src/models/Revision.ts src/models/SearchOperators.ts src/models/SearchSupport.ts diff --git a/generated-sources/api/src/apis/ConnectionApi.ts b/generated-sources/api/src/apis/ConnectionApi.ts index 44119163b..91c1e809d 100644 --- a/generated-sources/api/src/apis/ConnectionApi.ts +++ b/generated-sources/api/src/apis/ConnectionApi.ts @@ -17,6 +17,8 @@ import * as runtime from '../runtime'; import type { ApiProblem, Connection, + CustomAuthConnectRequest, + CustomAuthConnectResponse, GenerateConnectionRequest, InputValidationProblem, UpdateConnectionRequest, @@ -26,6 +28,10 @@ import { ApiProblemToJSON, ConnectionFromJSON, ConnectionToJSON, + CustomAuthConnectRequestFromJSON, + CustomAuthConnectRequestToJSON, + CustomAuthConnectResponseFromJSON, + CustomAuthConnectResponseToJSON, GenerateConnectionRequestFromJSON, GenerateConnectionRequestToJSON, InputValidationProblemFromJSON, @@ -34,6 +40,10 @@ import { UpdateConnectionRequestToJSON, } from '../models'; +export interface CustomAuthConnectOperationRequest { + customAuthConnectParams: CustomAuthConnectRequest; +} + export interface DeleteConnectionRequest { projectIdOrName: string; connectionId: string; @@ -72,6 +82,22 @@ export interface UpdateConnectionOperationRequest { * @interface ConnectionApiInterface */ export interface ConnectionApiInterface { + /** + * Drives a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls). Call it once with the flow inputs to start; if the response contains a redirect, open it, then call again with the returned sessionId and the provider\'s callback params to continue. Repeat until the response contains a connection. Used by the prebuilt UI components; only providers whose ProviderInfo has customOpts.multiStep present can use this endpoint. + * @summary Start or continue a multi-step custom auth flow + * @param {CustomAuthConnectRequest} customAuthConnectParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionApiInterface + */ + customAuthConnectRaw(requestParameters: CustomAuthConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + + /** + * Drives a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls). Call it once with the flow inputs to start; if the response contains a redirect, open it, then call again with the returned sessionId and the provider\'s callback params to continue. Repeat until the response contains a connection. Used by the prebuilt UI components; only providers whose ProviderInfo has customOpts.multiStep present can use this endpoint. + * Start or continue a multi-step custom auth flow + */ + customAuthConnect(requestParameters: CustomAuthConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** * * @summary Delete a connection @@ -167,6 +193,53 @@ export interface ConnectionApiInterface { */ export class ConnectionApi extends runtime.BaseAPI implements ConnectionApiInterface { + /** + * Drives a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls). Call it once with the flow inputs to start; if the response contains a redirect, open it, then call again with the returned sessionId and the provider\'s callback params to continue. Repeat until the response contains a connection. Used by the prebuilt UI components; only providers whose ProviderInfo has customOpts.multiStep present can use this endpoint. + * Start or continue a multi-step custom auth flow + */ + async customAuthConnectRaw(requestParameters: CustomAuthConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.customAuthConnectParams === null || requestParameters.customAuthConnectParams === undefined) { + throw new runtime.RequiredError('customAuthConnectParams','Required parameter requestParameters.customAuthConnectParams was null or undefined when calling customAuthConnect.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // APIKeyHeader authentication + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("Bearer", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/custom-auth/connect`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CustomAuthConnectRequestToJSON(requestParameters.customAuthConnectParams), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomAuthConnectResponseFromJSON(jsonValue)); + } + + /** + * Drives a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls). Call it once with the flow inputs to start; if the response contains a redirect, open it, then call again with the returned sessionId and the provider\'s callback params to continue. Repeat until the response contains a connection. Used by the prebuilt UI components; only providers whose ProviderInfo has customOpts.multiStep present can use this endpoint. + * Start or continue a multi-step custom auth flow + */ + async customAuthConnect(requestParameters: CustomAuthConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.customAuthConnectRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Delete a connection */ diff --git a/generated-sources/api/src/models/CustomAuthConnectRequest.ts b/generated-sources/api/src/models/CustomAuthConnectRequest.ts new file mode 100644 index 000000000..2f2c9dee0 --- /dev/null +++ b/generated-sources/api/src/models/CustomAuthConnectRequest.ts @@ -0,0 +1,153 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { ProviderMetadataInfo } from './ProviderMetadataInfo'; +import { + ProviderMetadataInfoFromJSON, + ProviderMetadataInfoFromJSONTyped, + ProviderMetadataInfoToJSON, +} from './ProviderMetadataInfo'; + +/** + * Request body for the /custom-auth/connect endpoint. The first call supplies the flow inputs; subsequent calls supply sessionId and callbackParams to resume after a redirect. + * @export + * @interface CustomAuthConnectRequest + */ +export interface CustomAuthConnectRequest { + /** + * The Ampersand project ID or project name. Required on the first call. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + projectIdOrName: string; + /** + * The provider that this app connects to. Required on the first call (when sessionId is not present); ignored on resume calls. Conditional requirement is enforced at the application layer. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + provider?: string; + /** + * Your application's identifier for the organization or workspace that this connection belongs to. Supplied on the first call; ignored on resume calls (the parked flow's identity is used). + * @type {string} + * @memberof CustomAuthConnectRequest + */ + groupRef?: string; + /** + * The display name for the group. Defaults to groupRef if not provided. Supplied on the first call; ignored on resume calls. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + groupName?: string; + /** + * The ID that your app uses to identify the user whose SaaS credential will be used. Supplied on the first call; ignored on resume calls (the parked flow's identity is used). + * @type {string} + * @memberof CustomAuthConnectRequest + */ + consumerRef?: string; + /** + * The display name for the consumer. Defaults to consumerRef if not provided. Supplied on the first call; ignored on resume calls. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + consumerName?: string; + /** + * + * @type {{ [key: string]: ProviderMetadataInfo; }} + * @memberof CustomAuthConnectRequest + */ + providerMetadata?: { [key: string]: ProviderMetadataInfo; }; + /** + * ID of the provider app. If omitted, the default provider app set up on the Dashboard is assumed. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + providerAppId?: string; + /** + * The consumer-supplied custom auth inputs (keyed by CustomAuthInput.name). Supplied on the first call (when sessionId is not present). + * @type {{ [key: string]: any; }} + * @memberof CustomAuthConnectRequest + */ + customAuth?: { [key: string]: any; }; + /** + * Identifies an in-progress flow to resume after a redirect. Returned in a prior redirect response. When present, provider and customAuth are not required. + * @type {string} + * @memberof CustomAuthConnectRequest + */ + sessionId?: string; + /** + * The query/body params the provider sent to the callback, forwarded to resume the flow. + * @type {{ [key: string]: string; }} + * @memberof CustomAuthConnectRequest + */ + callbackParams?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CustomAuthConnectRequest interface. + */ +export function instanceOfCustomAuthConnectRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "projectIdOrName" in value; + + return isInstance; +} + +export function CustomAuthConnectRequestFromJSON(json: any): CustomAuthConnectRequest { + return CustomAuthConnectRequestFromJSONTyped(json, false); +} + +export function CustomAuthConnectRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomAuthConnectRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'projectIdOrName': json['projectIdOrName'], + 'provider': !exists(json, 'provider') ? undefined : json['provider'], + 'groupRef': !exists(json, 'groupRef') ? undefined : json['groupRef'], + 'groupName': !exists(json, 'groupName') ? undefined : json['groupName'], + 'consumerRef': !exists(json, 'consumerRef') ? undefined : json['consumerRef'], + 'consumerName': !exists(json, 'consumerName') ? undefined : json['consumerName'], + 'providerMetadata': !exists(json, 'providerMetadata') ? undefined : (mapValues(json['providerMetadata'], ProviderMetadataInfoFromJSON)), + 'providerAppId': !exists(json, 'providerAppId') ? undefined : json['providerAppId'], + 'customAuth': !exists(json, 'customAuth') ? undefined : json['customAuth'], + 'sessionId': !exists(json, 'sessionId') ? undefined : json['sessionId'], + 'callbackParams': !exists(json, 'callbackParams') ? undefined : json['callbackParams'], + }; +} + +export function CustomAuthConnectRequestToJSON(value?: CustomAuthConnectRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'projectIdOrName': value.projectIdOrName, + 'provider': value.provider, + 'groupRef': value.groupRef, + 'groupName': value.groupName, + 'consumerRef': value.consumerRef, + 'consumerName': value.consumerName, + 'providerMetadata': value.providerMetadata === undefined ? undefined : (mapValues(value.providerMetadata, ProviderMetadataInfoToJSON)), + 'providerAppId': value.providerAppId, + 'customAuth': value.customAuth, + 'sessionId': value.sessionId, + 'callbackParams': value.callbackParams, + }; +} + diff --git a/generated-sources/api/src/models/CustomAuthConnectResponse.ts b/generated-sources/api/src/models/CustomAuthConnectResponse.ts new file mode 100644 index 000000000..80b871604 --- /dev/null +++ b/generated-sources/api/src/models/CustomAuthConnectResponse.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { + CustomAuthConnectResponseOneOf, + instanceOfCustomAuthConnectResponseOneOf, + CustomAuthConnectResponseOneOfFromJSON, + CustomAuthConnectResponseOneOfFromJSONTyped, + CustomAuthConnectResponseOneOfToJSON, +} from './CustomAuthConnectResponseOneOf'; +import { + CustomAuthConnectResponseOneOf1, + instanceOfCustomAuthConnectResponseOneOf1, + CustomAuthConnectResponseOneOf1FromJSON, + CustomAuthConnectResponseOneOf1FromJSONTyped, + CustomAuthConnectResponseOneOf1ToJSON, +} from './CustomAuthConnectResponseOneOf1'; + +/** + * @type CustomAuthConnectResponse + * Response from /custom-auth/connect. Exactly one of redirect or connection is set. A redirect means the client should open the URL and call again with sessionId + callbackParams; a connection means the flow is complete. + * @export + */ +export type CustomAuthConnectResponse = CustomAuthConnectResponseOneOf | CustomAuthConnectResponseOneOf1; + +export function CustomAuthConnectResponseFromJSON(json: any): CustomAuthConnectResponse { + return CustomAuthConnectResponseFromJSONTyped(json, false); +} + +export function CustomAuthConnectResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomAuthConnectResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { ...CustomAuthConnectResponseOneOfFromJSONTyped(json, true), ...CustomAuthConnectResponseOneOf1FromJSONTyped(json, true) }; +} + +export function CustomAuthConnectResponseToJSON(value?: CustomAuthConnectResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + + if (instanceOfCustomAuthConnectResponseOneOf(value)) { + return CustomAuthConnectResponseOneOfToJSON(value as CustomAuthConnectResponseOneOf); + } + if (instanceOfCustomAuthConnectResponseOneOf1(value)) { + return CustomAuthConnectResponseOneOf1ToJSON(value as CustomAuthConnectResponseOneOf1); + } + + return {}; +} + diff --git a/generated-sources/api/src/models/CustomAuthConnectResponseOneOf.ts b/generated-sources/api/src/models/CustomAuthConnectResponseOneOf.ts new file mode 100644 index 000000000..4e1a5f274 --- /dev/null +++ b/generated-sources/api/src/models/CustomAuthConnectResponseOneOf.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { RedirectResponse } from './RedirectResponse'; +import { + RedirectResponseFromJSON, + RedirectResponseFromJSONTyped, + RedirectResponseToJSON, +} from './RedirectResponse'; + +/** + * + * @export + * @interface CustomAuthConnectResponseOneOf + */ +export interface CustomAuthConnectResponseOneOf { + /** + * + * @type {RedirectResponse} + * @memberof CustomAuthConnectResponseOneOf + */ + redirect: RedirectResponse; +} + +/** + * Check if a given object implements the CustomAuthConnectResponseOneOf interface. + */ +export function instanceOfCustomAuthConnectResponseOneOf(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "redirect" in value; + + return isInstance; +} + +export function CustomAuthConnectResponseOneOfFromJSON(json: any): CustomAuthConnectResponseOneOf { + return CustomAuthConnectResponseOneOfFromJSONTyped(json, false); +} + +export function CustomAuthConnectResponseOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomAuthConnectResponseOneOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'redirect': RedirectResponseFromJSON(json['redirect']), + }; +} + +export function CustomAuthConnectResponseOneOfToJSON(value?: CustomAuthConnectResponseOneOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'redirect': RedirectResponseToJSON(value.redirect), + }; +} + diff --git a/generated-sources/api/src/models/CustomAuthConnectResponseOneOf1.ts b/generated-sources/api/src/models/CustomAuthConnectResponseOneOf1.ts new file mode 100644 index 000000000..f96a36b9e --- /dev/null +++ b/generated-sources/api/src/models/CustomAuthConnectResponseOneOf1.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Connection } from './Connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, +} from './Connection'; + +/** + * + * @export + * @interface CustomAuthConnectResponseOneOf1 + */ +export interface CustomAuthConnectResponseOneOf1 { + /** + * + * @type {Connection} + * @memberof CustomAuthConnectResponseOneOf1 + */ + connection: Connection; +} + +/** + * Check if a given object implements the CustomAuthConnectResponseOneOf1 interface. + */ +export function instanceOfCustomAuthConnectResponseOneOf1(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "connection" in value; + + return isInstance; +} + +export function CustomAuthConnectResponseOneOf1FromJSON(json: any): CustomAuthConnectResponseOneOf1 { + return CustomAuthConnectResponseOneOf1FromJSONTyped(json, false); +} + +export function CustomAuthConnectResponseOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomAuthConnectResponseOneOf1 { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'connection': ConnectionFromJSON(json['connection']), + }; +} + +export function CustomAuthConnectResponseOneOf1ToJSON(value?: CustomAuthConnectResponseOneOf1 | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'connection': ConnectionToJSON(value.connection), + }; +} + diff --git a/generated-sources/api/src/models/CustomAuthInput.ts b/generated-sources/api/src/models/CustomAuthInput.ts index 10895417a..57c1d2984 100644 --- a/generated-sources/api/src/models/CustomAuthInput.ts +++ b/generated-sources/api/src/models/CustomAuthInput.ts @@ -13,6 +13,13 @@ */ import { exists, mapValues } from '../runtime'; +import type { CustomAuthInputOption } from './CustomAuthInputOption'; +import { + CustomAuthInputOptionFromJSON, + CustomAuthInputOptionFromJSONTyped, + CustomAuthInputOptionToJSON, +} from './CustomAuthInputOption'; + /** * A custom input field for authentication. This is used by the frontend to dynamically render input fields for custom auth. The backend will not interpret this. It will however receive the value of this field before making a request (in the connection secrets). * @export @@ -43,8 +50,32 @@ export interface CustomAuthInput { * @memberof CustomAuthInput */ docsURL?: string; + /** + * How the frontend should render this input. "fieldTypeText" is an unmasked field (not sensitive), "fieldTypePassword" is a masked field (sensitive), and "fieldTypeSelect" is a dropdown populated from options. Defaults to "fieldTypePassword" when omitted. + * @type {string} + * @memberof CustomAuthInput + */ + fieldType?: CustomAuthInputFieldTypeEnum; + /** + * The dropdown options, used only when fieldType is "select". + * @type {Array} + * @memberof CustomAuthInput + */ + options?: Array; } + +/** + * @export + */ +export const CustomAuthInputFieldTypeEnum = { + FieldTypeText: 'fieldTypeText', + FieldTypePassword: 'fieldTypePassword', + FieldTypeSelect: 'fieldTypeSelect' +} as const; +export type CustomAuthInputFieldTypeEnum = typeof CustomAuthInputFieldTypeEnum[keyof typeof CustomAuthInputFieldTypeEnum]; + + /** * Check if a given object implements the CustomAuthInput interface. */ @@ -70,6 +101,8 @@ export function CustomAuthInputFromJSONTyped(json: any, ignoreDiscriminator: boo 'displayName': json['displayName'], 'prompt': !exists(json, 'prompt') ? undefined : json['prompt'], 'docsURL': !exists(json, 'docsURL') ? undefined : json['docsURL'], + 'fieldType': !exists(json, 'fieldType') ? undefined : json['fieldType'], + 'options': !exists(json, 'options') ? undefined : ((json['options'] as Array).map(CustomAuthInputOptionFromJSON)), }; } @@ -86,6 +119,8 @@ export function CustomAuthInputToJSON(value?: CustomAuthInput | null): any { 'displayName': value.displayName, 'prompt': value.prompt, 'docsURL': value.docsURL, + 'fieldType': value.fieldType, + 'options': value.options === undefined ? undefined : ((value.options as Array).map(CustomAuthInputOptionToJSON)), }; } diff --git a/generated-sources/api/src/models/CustomAuthInputOption.ts b/generated-sources/api/src/models/CustomAuthInputOption.ts new file mode 100644 index 000000000..b4f09c73a --- /dev/null +++ b/generated-sources/api/src/models/CustomAuthInputOption.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * A selectable option for a custom auth input whose fieldType is "select". + * @export + * @interface CustomAuthInputOption + */ +export interface CustomAuthInputOption { + /** + * The value stored when this option is selected. + * @type {string} + * @memberof CustomAuthInputOption + */ + value: string; + /** + * The human-readable label shown for this option. + * @type {string} + * @memberof CustomAuthInputOption + */ + label: string; +} + +/** + * Check if a given object implements the CustomAuthInputOption interface. + */ +export function instanceOfCustomAuthInputOption(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "value" in value; + isInstance = isInstance && "label" in value; + + return isInstance; +} + +export function CustomAuthInputOptionFromJSON(json: any): CustomAuthInputOption { + return CustomAuthInputOptionFromJSONTyped(json, false); +} + +export function CustomAuthInputOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomAuthInputOption { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'value': json['value'], + 'label': json['label'], + }; +} + +export function CustomAuthInputOptionToJSON(value?: CustomAuthInputOption | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'value': value.value, + 'label': value.label, + }; +} + diff --git a/generated-sources/api/src/models/CustomAuthOpts.ts b/generated-sources/api/src/models/CustomAuthOpts.ts index f9333cca4..d1b3208f6 100644 --- a/generated-sources/api/src/models/CustomAuthOpts.ts +++ b/generated-sources/api/src/models/CustomAuthOpts.ts @@ -56,6 +56,18 @@ export interface CustomAuthOpts { * @memberof CustomAuthOpts */ inputs?: Array; + /** + * Input fields the builder configures on their provider app (e.g. client secrets, subscription keys) rather than the consumer. Routed to storage by fieldType. Optional. + * @type {Array} + * @memberof CustomAuthOpts + */ + providerInputs?: Array; + /** + * Whether this provider uses a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls) driven by the /custom-auth/connect endpoint, rather than static header/query-param injection. The step definitions and handlers live in the connectors library, not the catalog; this flag is the signal that lets clients tell "multi-step custom" apart from plain "custom" at a glance. + * @type {boolean} + * @memberof CustomAuthOpts + */ + multiStep?: boolean; } /** @@ -80,6 +92,8 @@ export function CustomAuthOptsFromJSONTyped(json: any, ignoreDiscriminator: bool 'headers': !exists(json, 'headers') ? undefined : ((json['headers'] as Array).map(CustomAuthHeaderFromJSON)), 'queryParams': !exists(json, 'queryParams') ? undefined : ((json['queryParams'] as Array).map(CustomAuthQueryParamFromJSON)), 'inputs': !exists(json, 'inputs') ? undefined : ((json['inputs'] as Array).map(CustomAuthInputFromJSON)), + 'providerInputs': !exists(json, 'providerInputs') ? undefined : ((json['providerInputs'] as Array).map(CustomAuthInputFromJSON)), + 'multiStep': !exists(json, 'multiStep') ? undefined : json['multiStep'], }; } @@ -95,6 +109,8 @@ export function CustomAuthOptsToJSON(value?: CustomAuthOpts | null): any { 'headers': value.headers === undefined ? undefined : ((value.headers as Array).map(CustomAuthHeaderToJSON)), 'queryParams': value.queryParams === undefined ? undefined : ((value.queryParams as Array).map(CustomAuthQueryParamToJSON)), 'inputs': value.inputs === undefined ? undefined : ((value.inputs as Array).map(CustomAuthInputToJSON)), + 'providerInputs': value.providerInputs === undefined ? undefined : ((value.providerInputs as Array).map(CustomAuthInputToJSON)), + 'multiStep': value.multiStep, }; } diff --git a/generated-sources/api/src/models/RedirectResponse.ts b/generated-sources/api/src/models/RedirectResponse.ts new file mode 100644 index 000000000..50f7fb3ab --- /dev/null +++ b/generated-sources/api/src/models/RedirectResponse.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Ampersand public API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * Instructs the client to open a URL (e.g. in a popup) to continue a custom auth flow, then resume by calling /custom-auth/connect with the sessionId. + * @export + * @interface RedirectResponse + */ +export interface RedirectResponse { + /** + * The URL the client should open to continue the flow. + * @type {string} + * @memberof RedirectResponse + */ + url: string; + /** + * The flow identifier to pass back to /custom-auth/connect once the provider redirects to the callback. + * @type {string} + * @memberof RedirectResponse + */ + sessionId: string; +} + +/** + * Check if a given object implements the RedirectResponse interface. + */ +export function instanceOfRedirectResponse(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "url" in value; + isInstance = isInstance && "sessionId" in value; + + return isInstance; +} + +export function RedirectResponseFromJSON(json: any): RedirectResponse { + return RedirectResponseFromJSONTyped(json, false); +} + +export function RedirectResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RedirectResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'url': json['url'], + 'sessionId': json['sessionId'], + }; +} + +export function RedirectResponseToJSON(value?: RedirectResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'url': value.url, + 'sessionId': value.sessionId, + }; +} + diff --git a/generated-sources/api/src/models/index.ts b/generated-sources/api/src/models/index.ts index cf883acc0..185627f82 100644 --- a/generated-sources/api/src/models/index.ts +++ b/generated-sources/api/src/models/index.ts @@ -70,8 +70,13 @@ export * from './CreateProviderAppRequest'; export * from './CreateRevisionRequest'; export * from './CreateTopicDestinationRouteRequest'; export * from './CreateTopicRequest'; +export * from './CustomAuthConnectRequest'; +export * from './CustomAuthConnectResponse'; +export * from './CustomAuthConnectResponseOneOf'; +export * from './CustomAuthConnectResponseOneOf1'; export * from './CustomAuthHeader'; export * from './CustomAuthInput'; +export * from './CustomAuthInputOption'; export * from './CustomAuthOpts'; export * from './CustomAuthQueryParam'; export * from './DefaultPeriod'; @@ -175,6 +180,7 @@ export * from './ReadConfig'; export * from './ReadConfigAllOf'; export * from './ReadConfigObject'; export * from './ReadFilter'; +export * from './RedirectResponse'; export * from './Revision'; export * from './SearchOperators'; export * from './SearchSupport';