UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

1,766 lines (1,644 loc) 48.1 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../lib/primitives.js"; import { ClosedEnum } from "../types/enums.js"; import { smartUnion } from "../types/smartUnion.js"; export type TypePhoton = { /** * Photon project ID. */ projectId: string; /** * Photon project secret. */ projectSecret: string; /** * Photon webhook verification secret. */ webhookSecret?: string | undefined; }; export type TypeSnowflakeWif = { /** * Snowflake client name. */ clientName?: string | undefined; /** * Snowflake account identifier. */ accountIdentifier?: string | undefined; /** * Additional provider metadata stored with the connector. */ extras?: { [k: string]: any } | undefined; }; export type TypeSnowflake = { /** * Snowflake OAuth client name. */ clientName?: string | undefined; /** * Snowflake account identifier. */ accountIdentifier: string; /** * Default Snowflake role for created sessions. */ defaultSessionRole?: string | undefined; /** * Additional provider metadata stored with the connector. */ extras?: { [k: string]: any } | undefined; }; /** * Slack workspace metadata. */ export type SlackTeam = { /** * Slack workspace ID. */ id: string; /** * Slack workspace name. */ name?: string | undefined; /** * Slack workspace domain. */ domain?: string | undefined; }; export type SlashCommands = { /** * Slash command including its leading slash. */ command: string; /** * Description shown for the slash command in Slack. */ description: string; /** * Optional usage hint shown for the slash command. */ usageHint?: string | undefined; /** * Whether Slack should escape command arguments. */ shouldEscape?: boolean | undefined; }; /** * Where Slack exposes the shortcut. */ export const ConnectConnectorCreateData8Type = { Global: "global", Message: "message", } as const; /** * Where Slack exposes the shortcut. */ export type ConnectConnectorCreateData8Type = ClosedEnum< typeof ConnectConnectorCreateData8Type >; export type Shortcuts = { /** * Where Slack exposes the shortcut. */ type: ConnectConnectorCreateData8Type; /** * Shortcut display name. */ name: string; /** * Identifier included in the shortcut callback. */ callbackId: string; /** * Description shown for the shortcut in Slack. */ description: string; }; export type TypeSlack = { /** * Slack app ID. */ appId: string; /** * Slack app display name. */ appName: string; /** * OAuth client ID assigned by Slack. */ clientId: string; /** * Slack app OAuth client secret. */ clientSecret: string; /** * Slack workspace metadata. */ slackTeam?: SlackTeam | undefined; /** * Slack request signing secret. */ signingSecret?: string | undefined; /** * Legacy Slack webhook verification token. */ verificationToken?: string | undefined; /** * OAuth scopes requested for Slack bot tokens. */ botScopes?: Array<string> | undefined; /** * OAuth scopes requested for Slack user tokens. */ userScopes?: Array<string> | undefined; /** * Slash commands configured for the managed Slack app. */ slashCommands?: Array<SlashCommands> | undefined; /** * Global and message shortcuts configured for the Slack app. */ shortcuts?: Array<Shortcuts> | undefined; /** * Additional provider metadata stored with the connector. */ extras?: { [k: string]: any } | undefined; }; export type TypeSendblue = { /** * Sendblue API key id (`sb-api-key-id`). */ apiKeyId: string; /** * Sendblue API secret key (`sb-api-secret-key`). */ apiSecretKey: string; /** * E.164 Sendblue lines this connector sends and receives on. Used as the connector's display name, and the only lines its webhooks are registered for; an empty array clears them, which also removes the webhook subscription. */ phoneNumbers?: Array<string> | undefined; }; export type TypeSalesforce = { /** * Salesforce connected app consumer key. */ consumerKey: string; /** * Salesforce connected app consumer secret. */ consumerSecret: string; /** * Salesforce login host, such as login.salesforce.com. */ loginHost: string; }; export type TypeLinq = { /** * Linq partner API token for the shared line. */ apiToken: string; phoneNumbers?: Array<string> | undefined; }; /** * Linear organization that owns the OAuth application. */ export type OwnerOrganization = { /** * Linear organization ID. */ id: string; /** * Linear organization slug. */ slug: string; /** * Linear organization name. */ name: string; /** * Linear organization logo URL. */ logoUrl?: string | null | undefined; }; /** * Linear OAuth application metadata. */ export type Application = { /** * Linear OAuth application ID. */ id: string; /** * Linear OAuth client ID. */ clientId: string; /** * Linear OAuth application name. */ name: string; /** * Linear OAuth application description. */ description?: string | null | undefined; /** * Linear OAuth application developer name. */ developer?: string | null | undefined; /** * Linear OAuth application developer URL. */ developerUrl?: string | null | undefined; /** * Linear OAuth application image URL. */ imageUrl?: string | null | undefined; /** * Registered redirect URIs for the Linear OAuth application. */ redirectUris?: Array<string> | undefined; /** * Linear OAuth application distribution mode. */ distribution?: string | null | undefined; /** * Linear resource types delivered to the webhook. */ webhookResourceTypes?: Array<string> | undefined; /** * Linear webhook URL. */ webhookUrl?: string | null | undefined; /** * Whether the Linear webhook is enabled. */ webhookEnabled?: boolean | undefined; /** * Linear OAuth application creation timestamp. */ createdAt?: string | undefined; /** * Linear OAuth application update timestamp. */ updatedAt?: string | undefined; }; export type TypeLinear = { /** * Linear application ID. */ appId?: string | undefined; /** * Linear application name. */ appName?: string | undefined; /** * OAuth client ID assigned by Linear. */ clientId: string; /** * Linear OAuth client secret. */ clientSecret: string; /** * Linear webhook verification secret. */ webhookSecret?: string | undefined; /** * OAuth scopes requested for Linear application tokens. */ appScopes?: Array<string> | undefined; /** * OAuth scopes requested for Linear user tokens. */ userScopes?: Array<string> | undefined; /** * Linear organization that owns the OAuth application. */ ownerOrganization?: OwnerOrganization | undefined; /** * Linear OAuth application metadata. */ application?: Application | undefined; /** * Additional provider metadata stored with the connector. */ extras?: { [k: string]: any } | undefined; }; /** * GitHub App owner type. */ export const ConnectConnectorCreateDataType = { UserLower: "user", OrganizationLower: "organization", UserMixed: "User", OrganizationMixed: "Organization", } as const; /** * GitHub App owner type. */ export type ConnectConnectorCreateDataType = ClosedEnum< typeof ConnectConnectorCreateDataType >; /** * GitHub App owner. */ export type Owner = { /** * GitHub App owner type. */ type: ConnectConnectorCreateDataType; /** * GitHub App owner numeric ID. */ id: number; /** * GitHub App owner login. */ slug: string; /** * GitHub App owner display name. */ name?: string | undefined; }; export type TypeGithub = { /** * GitHub App numeric ID. */ appId: number; /** * GitHub App slug. */ appSlug: string; /** * GitHub App display name. */ appName: string; /** * OAuth client ID assigned by GitHub. */ clientId: string; /** * GitHub App owner. */ owner?: Owner | undefined; /** * GitHub App OAuth client secret. */ clientSecret?: string | undefined; /** * GitHub App private key in PEM format. */ privateKeyPem?: string | undefined; /** * GitHub App webhook secret. */ webhookSecret?: string | undefined; /** * Additional provider metadata stored with the connector. */ extras?: { [k: string]: any } | undefined; }; /** * Which subject the connector issues tokens for. Defaults to \"app\" (connector-level keys). \"user\" connectors store no connector-level values; each user supplies their own key during authorization. */ export const ConnectConnectorCreateDataSubjectType = { App: "app", User: "user", } as const; /** * Which subject the connector issues tokens for. Defaults to \"app\" (connector-level keys). \"user\" connectors store no connector-level values; each user supplies their own key during authorization. */ export type ConnectConnectorCreateDataSubjectType = ClosedEnum< typeof ConnectConnectorCreateDataSubjectType >; export type Values = { /** * API key value. */ value: string; /** * Optional scope associated with the API key value. */ scope?: string | undefined; /** * The timestamp when the API key value expires in milliseconds. */ expiresAt?: number | undefined; }; export type TypeApiKey = { /** * Which subject the connector issues tokens for. Defaults to \"app\" (connector-level keys). \"user\" connectors store no connector-level values; each user supplies their own key during authorization. */ subjectType?: ConnectConnectorCreateDataSubjectType | undefined; /** * Initial API key values stored by the connector. */ values?: Array<Values> | undefined; /** * The HTTPS resources the API key authenticates against. */ serviceUrls?: Array<string> | undefined; /** * Markdown instructions shown to each user on the authorization screen, explaining how to obtain the key they should paste. */ instructions?: string | undefined; }; /** * Intended key use: signing or encryption. */ export const Use = { Sig: "sig", Enc: "enc", } as const; /** * Intended key use: signing or encryption. */ export type Use = ClosedEnum<typeof Use>; export type Keys = { /** * JSON Web Key type. */ kty: string; /** * JSON Web Key identifier. */ kid?: string | undefined; /** * Intended key use: signing or encryption. */ use?: Use | undefined; /** * Operations permitted for this key. */ keyOps?: Array<string> | undefined; /** * Algorithm intended for this key. */ alg?: string | undefined; additionalProperties?: { [k: string]: any } | undefined; }; /** * Inline authorization server JSON Web Key Set. */ export type Jwks = { /** * JSON Web Keys published by the authorization server. */ keys: Array<Keys>; additionalProperties?: { [k: string]: any } | undefined; }; /** * Authorization server metadata. Values override discovered metadata. Empty known string fields remove their stored overrides. */ export type ServerConfig = { /** * Authorization server issuer URL. */ issuer?: string | undefined; /** * OAuth authorization endpoint URL. */ authorizationEndpoint?: string | undefined; /** * OAuth token endpoint URL. */ tokenEndpoint?: string | undefined; /** * OpenID Connect UserInfo endpoint URL. */ userinfoEndpoint?: string | undefined; /** * URL of the authorization server JSON Web Key Set. */ jwksUri?: string | undefined; /** * Inline authorization server JSON Web Key Set. */ jwks?: Jwks | undefined; /** * OAuth token revocation endpoint URL. */ revocationEndpoint?: string | undefined; /** * OAuth token introspection endpoint URL. */ introspectionEndpoint?: string | undefined; /** * OpenID Connect session termination endpoint URL. */ endSessionEndpoint?: string | undefined; /** * OAuth device authorization endpoint URL. */ deviceAuthorizationEndpoint?: string | undefined; /** * OAuth dynamic client registration endpoint URL. */ registrationEndpoint?: string | undefined; /** * OAuth response types supported by the server. */ responseTypesSupported?: Array<string> | undefined; /** * Token endpoint client authentication methods supported by the server. */ tokenEndpointAuthMethodsSupported?: Array<string> | undefined; /** * Signing algorithms supported for token endpoint authentication. */ tokenEndpointAuthSigningAlgValuesSupported?: Array<string> | undefined; /** * OAuth scopes supported by the server. */ scopesSupported?: Array<string> | undefined; /** * OAuth grant types supported by the server. */ grantTypesSupported?: Array<string> | undefined; /** * OAuth response modes supported by the server. */ responseModesSupported?: Array<string> | undefined; /** * OpenID Connect subject identifier types supported by the server. */ subjectTypesSupported?: Array<string> | undefined; /** * Signing algorithms supported for ID tokens. */ idTokenSigningAlgValuesSupported?: Array<string> | undefined; /** * Key management algorithms supported for encrypted ID tokens. */ idTokenEncryptionAlgValuesSupported?: Array<string> | undefined; /** * Content encryption algorithms supported for encrypted ID tokens. */ idTokenEncryptionEncValuesSupported?: Array<string> | undefined; /** * OpenID Connect claim value types supported by the server. */ claimTypesSupported?: Array<string> | undefined; /** * Claims that the authorization server can return. */ claimsSupported?: Array<string> | undefined; /** * PKCE code challenge methods supported by the server. */ codeChallengeMethodsSupported?: Array<string> | undefined; /** * Authorization prompt values supported by the server. */ promptValuesSupported?: Array<string> | undefined; /** * Whether authorization requests can use the claims parameter. */ claimsParameterSupported?: boolean | undefined; /** * Whether authorization requests can use signed request objects. */ requestParameterSupported?: boolean | undefined; /** * Whether authorization requests can use request_uri. */ requestUriParameterSupported?: boolean | undefined; /** * Whether request_uri values must be registered in advance. */ requireRequestUriRegistration?: boolean | undefined; /** * Authorization server documentation URL. */ serviceDocumentation?: string | undefined; /** * Authorization server privacy policy URL. */ opPolicyUri?: string | undefined; /** * Authorization server terms of service URL. */ opTosUri?: string | undefined; /** * Authorization server logo URL. */ logoUri?: string | undefined; /** * Whether the server supports OAuth client ID metadata documents. */ clientIdMetadataDocumentSupported?: boolean | undefined; /** * OAuth authorization-detail types supported by the server. */ authorizationDetailsTypesSupported?: Array<string> | undefined; additionalProperties?: { [k: string]: any } | undefined; }; /** * User authorization grant settings. */ export type UserAuthorization = { /** * Whether this OAuth grant is enabled. */ enabled: boolean; /** * Default scopes to request when token params specify scopes: [\"*\"]. */ scopes?: Array<string> | undefined; }; /** * Refresh token settings. */ export type RefreshTokens = { /** * Whether this OAuth grant is enabled. */ enabled: boolean; }; /** * Client credentials grant settings. */ export type ClientCredentials = { /** * Whether this OAuth grant is enabled. */ enabled: boolean; /** * Default scopes to request when token params specify scopes: [\"*\"]. */ scopes?: Array<string> | undefined; }; /** * Allow-list of extra claims to propagate, keyed by source (idToken). Only claims named here and present in that source are exposed. */ export type ForwardedClaims = { /** * ID token claim names that Connect can expose. */ idToken?: Array<string> | undefined; }; /** * JWT bearer grant settings. */ export type JwtBearer = { /** * Whether JWT bearer grants are enabled. */ enabled?: boolean | undefined; /** * Default scopes to request when token params specify scopes: [\"*\"]. */ scopes?: Array<string> | undefined; /** * Default JWT subject claim. */ sub?: string | undefined; /** * Default JWT issuer claim. */ iss?: string | undefined; /** * Default JWT audience claim. */ aud?: string | undefined; /** * Additional claims included in generated JWT assertions. */ additionalClaims?: { [k: string]: any } | undefined; /** * JWT lifetime in seconds. */ ttl?: number | undefined; /** * Whether JWT bearer requests also use client credentials. */ useClientCredentials?: boolean | undefined; }; /** * `private_key_jwt` client assertion settings. */ export type ClientAssertion = { /** * OAuth client assertion type. Defaults to urn:ietf:params:oauth:client-assertion-type:jwt-bearer. An empty string clears the configured type. */ type?: string | undefined; /** * Client assertion lifetime in seconds. */ ttl?: number | undefined; /** * Additional claims included in the client assertion. */ claims?: { [k: string]: any } | undefined; }; export type TypeOauth = { /** * Authorization server base URL used for discovery. */ serverUrl?: string | undefined; /** * Authorization server metadata. Values override discovered metadata. Empty known string fields remove their stored overrides. */ serverConfig?: ServerConfig | undefined; /** * OAuth client ID assigned by the provider. */ clientId: string; /** * OAuth client name. */ clientName?: string | undefined; /** * OAuth client secret. */ clientSecret?: string | undefined; /** * OAuth token endpoint authentication method. Common values are client_secret_post, client_secret_basic, none, and private_key_jwt. If omitted, Vercel selects a supported method from serverConfig and otherwise uses client_secret_post. */ tokenEndpointAuthMethod?: string | undefined; /** * OAuth authorization response type. Defaults to code. Other provider-supported values are accepted. An empty string clears the configured type. */ responseType?: string | undefined; /** * Whether user authorization must use PKCE. */ pkceRequired?: boolean | undefined; /** * PKCE code challenge method. Supported values are S256 and plain. Vercel prefers S256 when the provider supports it. An empty string clears the configured method. */ codeChallengeMethod?: string | undefined; /** * User authorization grant settings. */ userAuthorization?: UserAuthorization | undefined; /** * Refresh token settings. */ refreshTokens?: RefreshTokens | undefined; /** * Client credentials grant settings. */ clientCredentials?: ClientCredentials | undefined; /** * Allow-list of extra claims to propagate, keyed by source (idToken). Only claims named here and present in that source are exposed. */ forwardedClaims?: ForwardedClaims | undefined; /** * Default audience used when a token request omits one. An empty string clears the default. */ defaultAudience?: string | undefined; /** * Default token lifetime in seconds to use when the token response omits expires_in. */ defaultTokenExpiresIn?: number | undefined; /** * Extra query parameters added to authorization URLs. */ authorizationUrlParams?: { [k: string]: string } | undefined; /** * JWT bearer grant settings. */ jwtBearer?: JwtBearer | undefined; /** * `private_key_jwt` client assertion settings. */ clientAssertion?: ClientAssertion | undefined; }; /** * Provider configuration. With type, provide the complete configuration for that type. With service and connectionMethod, provide only credentials and preferences; Connect supplies the type, endpoints, templates, and defaults. Other connector types accept an arbitrary object. */ export type ConnectConnectorCreateData = | TypeGithub | TypeSlack | TypeSalesforce | TypeLinear | TypeSendblue | TypePhoton | TypeOauth | TypeLinq | TypeSnowflake | TypeApiKey | TypeSnowflakeWif | { [k: string]: any }; /** @internal */ export type TypePhoton$Outbound = { projectId: string; projectSecret: string; webhookSecret?: string | undefined; }; /** @internal */ export const TypePhoton$outboundSchema: z.ZodType< TypePhoton$Outbound, z.ZodTypeDef, TypePhoton > = z.object({ projectId: z.string(), projectSecret: z.string(), webhookSecret: z.string().optional(), }); export function typePhotonToJSON(typePhoton: TypePhoton): string { return JSON.stringify(TypePhoton$outboundSchema.parse(typePhoton)); } /** @internal */ export type TypeSnowflakeWif$Outbound = { clientName?: string | undefined; accountIdentifier?: string | undefined; extras?: { [k: string]: any } | undefined; }; /** @internal */ export const TypeSnowflakeWif$outboundSchema: z.ZodType< TypeSnowflakeWif$Outbound, z.ZodTypeDef, TypeSnowflakeWif > = z.object({ clientName: z.string().optional(), accountIdentifier: z.string().optional(), extras: z.record(z.any()).optional(), }); export function typeSnowflakeWifToJSON( typeSnowflakeWif: TypeSnowflakeWif, ): string { return JSON.stringify( TypeSnowflakeWif$outboundSchema.parse(typeSnowflakeWif), ); } /** @internal */ export type TypeSnowflake$Outbound = { clientName?: string | undefined; accountIdentifier: string; defaultSessionRole?: string | undefined; extras?: { [k: string]: any } | undefined; }; /** @internal */ export const TypeSnowflake$outboundSchema: z.ZodType< TypeSnowflake$Outbound, z.ZodTypeDef, TypeSnowflake > = z.object({ clientName: z.string().optional(), accountIdentifier: z.string(), defaultSessionRole: z.string().optional(), extras: z.record(z.any()).optional(), }); export function typeSnowflakeToJSON(typeSnowflake: TypeSnowflake): string { return JSON.stringify(TypeSnowflake$outboundSchema.parse(typeSnowflake)); } /** @internal */ export type SlackTeam$Outbound = { id: string; name?: string | undefined; domain?: string | undefined; }; /** @internal */ export const SlackTeam$outboundSchema: z.ZodType< SlackTeam$Outbound, z.ZodTypeDef, SlackTeam > = z.object({ id: z.string(), name: z.string().optional(), domain: z.string().optional(), }); export function slackTeamToJSON(slackTeam: SlackTeam): string { return JSON.stringify(SlackTeam$outboundSchema.parse(slackTeam)); } /** @internal */ export type SlashCommands$Outbound = { command: string; description: string; usageHint?: string | undefined; shouldEscape?: boolean | undefined; }; /** @internal */ export const SlashCommands$outboundSchema: z.ZodType< SlashCommands$Outbound, z.ZodTypeDef, SlashCommands > = z.object({ command: z.string(), description: z.string(), usageHint: z.string().optional(), shouldEscape: z.boolean().optional(), }); export function slashCommandsToJSON(slashCommands: SlashCommands): string { return JSON.stringify(SlashCommands$outboundSchema.parse(slashCommands)); } /** @internal */ export const ConnectConnectorCreateData8Type$outboundSchema: z.ZodNativeEnum< typeof ConnectConnectorCreateData8Type > = z.nativeEnum(ConnectConnectorCreateData8Type); /** @internal */ export type Shortcuts$Outbound = { type: string; name: string; callbackId: string; description: string; }; /** @internal */ export const Shortcuts$outboundSchema: z.ZodType< Shortcuts$Outbound, z.ZodTypeDef, Shortcuts > = z.object({ type: ConnectConnectorCreateData8Type$outboundSchema, name: z.string(), callbackId: z.string(), description: z.string(), }); export function shortcutsToJSON(shortcuts: Shortcuts): string { return JSON.stringify(Shortcuts$outboundSchema.parse(shortcuts)); } /** @internal */ export type TypeSlack$Outbound = { appId: string; appName: string; clientId: string; clientSecret: string; slackTeam?: SlackTeam$Outbound | undefined; signingSecret?: string | undefined; verificationToken?: string | undefined; botScopes?: Array<string> | undefined; userScopes?: Array<string> | undefined; slashCommands?: Array<SlashCommands$Outbound> | undefined; shortcuts?: Array<Shortcuts$Outbound> | undefined; extras?: { [k: string]: any } | undefined; }; /** @internal */ export const TypeSlack$outboundSchema: z.ZodType< TypeSlack$Outbound, z.ZodTypeDef, TypeSlack > = z.object({ appId: z.string(), appName: z.string(), clientId: z.string(), clientSecret: z.string(), slackTeam: z.lazy(() => SlackTeam$outboundSchema).optional(), signingSecret: z.string().optional(), verificationToken: z.string().optional(), botScopes: z.array(z.string()).optional(), userScopes: z.array(z.string()).optional(), slashCommands: z.array(z.lazy(() => SlashCommands$outboundSchema)).optional(), shortcuts: z.array(z.lazy(() => Shortcuts$outboundSchema)).optional(), extras: z.record(z.any()).optional(), }); export function typeSlackToJSON(typeSlack: TypeSlack): string { return JSON.stringify(TypeSlack$outboundSchema.parse(typeSlack)); } /** @internal */ export type TypeSendblue$Outbound = { apiKeyId: string; apiSecretKey: string; phoneNumbers?: Array<string> | undefined; }; /** @internal */ export const TypeSendblue$outboundSchema: z.ZodType< TypeSendblue$Outbound, z.ZodTypeDef, TypeSendblue > = z.object({ apiKeyId: z.string(), apiSecretKey: z.string(), phoneNumbers: z.array(z.string()).optional(), }); export function typeSendblueToJSON(typeSendblue: TypeSendblue): string { return JSON.stringify(TypeSendblue$outboundSchema.parse(typeSendblue)); } /** @internal */ export type TypeSalesforce$Outbound = { consumerKey: string; consumerSecret: string; loginHost: string; }; /** @internal */ export const TypeSalesforce$outboundSchema: z.ZodType< TypeSalesforce$Outbound, z.ZodTypeDef, TypeSalesforce > = z.object({ consumerKey: z.string(), consumerSecret: z.string(), loginHost: z.string(), }); export function typeSalesforceToJSON(typeSalesforce: TypeSalesforce): string { return JSON.stringify(TypeSalesforce$outboundSchema.parse(typeSalesforce)); } /** @internal */ export type TypeLinq$Outbound = { apiToken: string; phoneNumbers?: Array<string> | undefined; }; /** @internal */ export const TypeLinq$outboundSchema: z.ZodType< TypeLinq$Outbound, z.ZodTypeDef, TypeLinq > = z.object({ apiToken: z.string(), phoneNumbers: z.array(z.string()).optional(), }); export function typeLinqToJSON(typeLinq: TypeLinq): string { return JSON.stringify(TypeLinq$outboundSchema.parse(typeLinq)); } /** @internal */ export type OwnerOrganization$Outbound = { id: string; slug: string; name: string; logoUrl?: string | null | undefined; }; /** @internal */ export const OwnerOrganization$outboundSchema: z.ZodType< OwnerOrganization$Outbound, z.ZodTypeDef, OwnerOrganization > = z.object({ id: z.string(), slug: z.string(), name: z.string(), logoUrl: z.nullable(z.string()).optional(), }); export function ownerOrganizationToJSON( ownerOrganization: OwnerOrganization, ): string { return JSON.stringify( OwnerOrganization$outboundSchema.parse(ownerOrganization), ); } /** @internal */ export type Application$Outbound = { id: string; clientId: string; name: string; description?: string | null | undefined; developer?: string | null | undefined; developerUrl?: string | null | undefined; imageUrl?: string | null | undefined; redirectUris?: Array<string> | undefined; distribution?: string | null | undefined; webhookResourceTypes?: Array<string> | undefined; webhookUrl?: string | null | undefined; webhookEnabled?: boolean | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; }; /** @internal */ export const Application$outboundSchema: z.ZodType< Application$Outbound, z.ZodTypeDef, Application > = z.object({ id: z.string(), clientId: z.string(), name: z.string(), description: z.nullable(z.string()).optional(), developer: z.nullable(z.string()).optional(), developerUrl: z.nullable(z.string()).optional(), imageUrl: z.nullable(z.string()).optional(), redirectUris: z.array(z.string()).optional(), distribution: z.nullable(z.string()).optional(), webhookResourceTypes: z.array(z.string()).optional(), webhookUrl: z.nullable(z.string()).optional(), webhookEnabled: z.boolean().optional(), createdAt: z.string().optional(), updatedAt: z.string().optional(), }); export function applicationToJSON(application: Application): string { return JSON.stringify(Application$outboundSchema.parse(application)); } /** @internal */ export type TypeLinear$Outbound = { appId?: string | undefined; appName?: string | undefined; clientId: string; clientSecret: string; webhookSecret?: string | undefined; appScopes?: Array<string> | undefined; userScopes?: Array<string> | undefined; ownerOrganization?: OwnerOrganization$Outbound | undefined; application?: Application$Outbound | undefined; extras?: { [k: string]: any } | undefined; }; /** @internal */ export const TypeLinear$outboundSchema: z.ZodType< TypeLinear$Outbound, z.ZodTypeDef, TypeLinear > = z.object({ appId: z.string().optional(), appName: z.string().optional(), clientId: z.string(), clientSecret: z.string(), webhookSecret: z.string().optional(), appScopes: z.array(z.string()).optional(), userScopes: z.array(z.string()).optional(), ownerOrganization: z.lazy(() => OwnerOrganization$outboundSchema).optional(), application: z.lazy(() => Application$outboundSchema).optional(), extras: z.record(z.any()).optional(), }); export function typeLinearToJSON(typeLinear: TypeLinear): string { return JSON.stringify(TypeLinear$outboundSchema.parse(typeLinear)); } /** @internal */ export const ConnectConnectorCreateDataType$outboundSchema: z.ZodNativeEnum< typeof ConnectConnectorCreateDataType > = z.nativeEnum(ConnectConnectorCreateDataType); /** @internal */ export type Owner$Outbound = { type: string; id: number; slug: string; name?: string | undefined; }; /** @internal */ export const Owner$outboundSchema: z.ZodType< Owner$Outbound, z.ZodTypeDef, Owner > = z.object({ type: ConnectConnectorCreateDataType$outboundSchema, id: z.number().int(), slug: z.string(), name: z.string().optional(), }); export function ownerToJSON(owner: Owner): string { return JSON.stringify(Owner$outboundSchema.parse(owner)); } /** @internal */ export type TypeGithub$Outbound = { appId: number; appSlug: string; appName: string; clientId: string; owner?: Owner$Outbound | undefined; clientSecret?: string | undefined; privateKeyPem?: string | undefined; webhookSecret?: string | undefined; extras?: { [k: string]: any } | undefined; }; /** @internal */ export const TypeGithub$outboundSchema: z.ZodType< TypeGithub$Outbound, z.ZodTypeDef, TypeGithub > = z.object({ appId: z.number().int(), appSlug: z.string(), appName: z.string(), clientId: z.string(), owner: z.lazy(() => Owner$outboundSchema).optional(), clientSecret: z.string().optional(), privateKeyPem: z.string().optional(), webhookSecret: z.string().optional(), extras: z.record(z.any()).optional(), }); export function typeGithubToJSON(typeGithub: TypeGithub): string { return JSON.stringify(TypeGithub$outboundSchema.parse(typeGithub)); } /** @internal */ export const ConnectConnectorCreateDataSubjectType$outboundSchema: z.ZodNativeEnum<typeof ConnectConnectorCreateDataSubjectType> = z.nativeEnum( ConnectConnectorCreateDataSubjectType, ); /** @internal */ export type Values$Outbound = { value: string; scope?: string | undefined; expiresAt?: number | undefined; }; /** @internal */ export const Values$outboundSchema: z.ZodType< Values$Outbound, z.ZodTypeDef, Values > = z.object({ value: z.string(), scope: z.string().optional(), expiresAt: z.number().int().optional(), }); export function valuesToJSON(values: Values): string { return JSON.stringify(Values$outboundSchema.parse(values)); } /** @internal */ export type TypeApiKey$Outbound = { subjectType?: string | undefined; values?: Array<Values$Outbound> | undefined; serviceUrls?: Array<string> | undefined; instructions?: string | undefined; }; /** @internal */ export const TypeApiKey$outboundSchema: z.ZodType< TypeApiKey$Outbound, z.ZodTypeDef, TypeApiKey > = z.object({ subjectType: ConnectConnectorCreateDataSubjectType$outboundSchema.optional(), values: z.array(z.lazy(() => Values$outboundSchema)).optional(), serviceUrls: z.array(z.string()).optional(), instructions: z.string().optional(), }); export function typeApiKeyToJSON(typeApiKey: TypeApiKey): string { return JSON.stringify(TypeApiKey$outboundSchema.parse(typeApiKey)); } /** @internal */ export const Use$outboundSchema: z.ZodNativeEnum<typeof Use> = z.nativeEnum( Use, ); /** @internal */ export type Keys$Outbound = { kty: string; kid?: string | undefined; use?: string | undefined; key_ops?: Array<string> | undefined; alg?: string | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const Keys$outboundSchema: z.ZodType<Keys$Outbound, z.ZodTypeDef, Keys> = z.object({ kty: z.string(), kid: z.string().optional(), use: Use$outboundSchema.optional(), keyOps: z.array(z.string()).optional(), alg: z.string().optional(), additionalProperties: z.record(z.any()).optional(), }).transform((v) => { return { ...v.additionalProperties, ...remap$(v, { keyOps: "key_ops", additionalProperties: null, }), }; }); export function keysToJSON(keys: Keys): string { return JSON.stringify(Keys$outboundSchema.parse(keys)); } /** @internal */ export type Jwks$Outbound = { keys: Array<Keys$Outbound>; [additionalProperties: string]: unknown; }; /** @internal */ export const Jwks$outboundSchema: z.ZodType<Jwks$Outbound, z.ZodTypeDef, Jwks> = z.object({ keys: z.array(z.lazy(() => Keys$outboundSchema)), additionalProperties: z.record(z.any()).optional(), }).transform((v) => { return { ...v.additionalProperties, ...remap$(v, { additionalProperties: null, }), }; }); export function jwksToJSON(jwks: Jwks): string { return JSON.stringify(Jwks$outboundSchema.parse(jwks)); } /** @internal */ export type ServerConfig$Outbound = { issuer?: string | undefined; authorization_endpoint?: string | undefined; token_endpoint?: string | undefined; userinfo_endpoint?: string | undefined; jwks_uri?: string | undefined; jwks?: Jwks$Outbound | undefined; revocation_endpoint?: string | undefined; introspection_endpoint?: string | undefined; end_session_endpoint?: string | undefined; device_authorization_endpoint?: string | undefined; registration_endpoint?: string | undefined; response_types_supported?: Array<string> | undefined; token_endpoint_auth_methods_supported?: Array<string> | undefined; token_endpoint_auth_signing_alg_values_supported?: Array<string> | undefined; scopes_supported?: Array<string> | undefined; grant_types_supported?: Array<string> | undefined; response_modes_supported?: Array<string> | undefined; subject_types_supported?: Array<string> | undefined; id_token_signing_alg_values_supported?: Array<string> | undefined; id_token_encryption_alg_values_supported?: Array<string> | undefined; id_token_encryption_enc_values_supported?: Array<string> | undefined; claim_types_supported?: Array<string> | undefined; claims_supported?: Array<string> | undefined; code_challenge_methods_supported?: Array<string> | undefined; prompt_values_supported?: Array<string> | undefined; claims_parameter_supported?: boolean | undefined; request_parameter_supported?: boolean | undefined; request_uri_parameter_supported?: boolean | undefined; require_request_uri_registration?: boolean | undefined; service_documentation?: string | undefined; op_policy_uri?: string | undefined; op_tos_uri?: string | undefined; logo_uri?: string | undefined; client_id_metadata_document_supported?: boolean | undefined; authorization_details_types_supported?: Array<string> | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const ServerConfig$outboundSchema: z.ZodType< ServerConfig$Outbound, z.ZodTypeDef, ServerConfig > = z.object({ issuer: z.string().optional(), authorizationEndpoint: z.string().optional(), tokenEndpoint: z.string().optional(), userinfoEndpoint: z.string().optional(), jwksUri: z.string().optional(), jwks: z.lazy(() => Jwks$outboundSchema).optional(), revocationEndpoint: z.string().optional(), introspectionEndpoint: z.string().optional(), endSessionEndpoint: z.string().optional(), deviceAuthorizationEndpoint: z.string().optional(), registrationEndpoint: z.string().optional(), responseTypesSupported: z.array(z.string()).optional(), tokenEndpointAuthMethodsSupported: z.array(z.string()).optional(), tokenEndpointAuthSigningAlgValuesSupported: z.array(z.string()).optional(), scopesSupported: z.array(z.string()).optional(), grantTypesSupported: z.array(z.string()).optional(), responseModesSupported: z.array(z.string()).optional(), subjectTypesSupported: z.array(z.string()).optional(), idTokenSigningAlgValuesSupported: z.array(z.string()).optional(), idTokenEncryptionAlgValuesSupported: z.array(z.string()).optional(), idTokenEncryptionEncValuesSupported: z.array(z.string()).optional(), claimTypesSupported: z.array(z.string()).optional(), claimsSupported: z.array(z.string()).optional(), codeChallengeMethodsSupported: z.array(z.string()).optional(), promptValuesSupported: z.array(z.string()).optional(), claimsParameterSupported: z.boolean().optional(), requestParameterSupported: z.boolean().optional(), requestUriParameterSupported: z.boolean().optional(), requireRequestUriRegistration: z.boolean().optional(), serviceDocumentation: z.string().optional(), opPolicyUri: z.string().optional(), opTosUri: z.string().optional(), logoUri: z.string().optional(), clientIdMetadataDocumentSupported: z.boolean().optional(), authorizationDetailsTypesSupported: z.array(z.string()).optional(), additionalProperties: z.record(z.any()).optional(), }).transform((v) => { return { ...v.additionalProperties, ...remap$(v, { authorizationEndpoint: "authorization_endpoint", tokenEndpoint: "token_endpoint", userinfoEndpoint: "userinfo_endpoint", jwksUri: "jwks_uri", revocationEndpoint: "revocation_endpoint", introspectionEndpoint: "introspection_endpoint", endSessionEndpoint: "end_session_endpoint", deviceAuthorizationEndpoint: "device_authorization_endpoint", registrationEndpoint: "registration_endpoint", responseTypesSupported: "response_types_supported", tokenEndpointAuthMethodsSupported: "token_endpoint_auth_methods_supported", tokenEndpointAuthSigningAlgValuesSupported: "token_endpoint_auth_signing_alg_values_supported", scopesSupported: "scopes_supported", grantTypesSupported: "grant_types_supported", responseModesSupported: "response_modes_supported", subjectTypesSupported: "subject_types_supported", idTokenSigningAlgValuesSupported: "id_token_signing_alg_values_supported", idTokenEncryptionAlgValuesSupported: "id_token_encryption_alg_values_supported", idTokenEncryptionEncValuesSupported: "id_token_encryption_enc_values_supported", claimTypesSupported: "claim_types_supported", claimsSupported: "claims_supported", codeChallengeMethodsSupported: "code_challenge_methods_supported", promptValuesSupported: "prompt_values_supported", claimsParameterSupported: "claims_parameter_supported", requestParameterSupported: "request_parameter_supported", requestUriParameterSupported: "request_uri_parameter_supported", requireRequestUriRegistration: "require_request_uri_registration", serviceDocumentation: "service_documentation", opPolicyUri: "op_policy_uri", opTosUri: "op_tos_uri", logoUri: "logo_uri", clientIdMetadataDocumentSupported: "client_id_metadata_document_supported", authorizationDetailsTypesSupported: "authorization_details_types_supported", additionalProperties: null, }), }; }); export function serverConfigToJSON(serverConfig: ServerConfig): string { return JSON.stringify(ServerConfig$outboundSchema.parse(serverConfig)); } /** @internal */ export type UserAuthorization$Outbound = { enabled: boolean; scopes?: Array<string> | undefined; }; /** @internal */ export const UserAuthorization$outboundSchema: z.ZodType< UserAuthorization$Outbound, z.ZodTypeDef, UserAuthorization > = z.object({ enabled: z.boolean(), scopes: z.array(z.string()).optional(), }); export function userAuthorizationToJSON( userAuthorization: UserAuthorization, ): string { return JSON.stringify( UserAuthorization$outboundSchema.parse(userAuthorization), ); } /** @internal */ export type RefreshTokens$Outbound = { enabled: boolean; }; /** @internal */ export const RefreshTokens$outboundSchema: z.ZodType< RefreshTokens$Outbound, z.ZodTypeDef, RefreshTokens > = z.object({ enabled: z.boolean(), }); export function refreshTokensToJSON(refreshTokens: RefreshTokens): string { return JSON.stringify(RefreshTokens$outboundSchema.parse(refreshTokens)); } /** @internal */ export type ClientCredentials$Outbound = { enabled: boolean; scopes?: Array<string> | undefined; }; /** @internal */ export const ClientCredentials$outboundSchema: z.ZodType< ClientCredentials$Outbound, z.ZodTypeDef, ClientCredentials > = z.object({ enabled: z.boolean(), scopes: z.array(z.string()).optional(), }); export function clientCredentialsToJSON( clientCredentials: ClientCredentials, ): string { return JSON.stringify( ClientCredentials$outboundSchema.parse(clientCredentials), ); } /** @internal */ export type ForwardedClaims$Outbound = { idToken?: Array<string> | undefined; }; /** @internal */ export const ForwardedClaims$outboundSchema: z.ZodType< ForwardedClaims$Outbound, z.ZodTypeDef, ForwardedClaims > = z.object({ idToken: z.array(z.string()).optional(), }); export function forwardedClaimsToJSON( forwardedClaims: ForwardedClaims, ): string { return JSON.stringify(ForwardedClaims$outboundSchema.parse(forwardedClaims)); } /** @internal */ export type JwtBearer$Outbound = { enabled?: boolean | undefined; scopes?: Array<string> | undefined; sub?: string | undefined; iss?: string | undefined; aud?: string | undefined; additionalClaims?: { [k: string]: any } | undefined; ttl?: number | undefined; useClientCredentials?: boolean | undefined; }; /** @internal */ export const JwtBearer$outboundSchema: z.ZodType< JwtBearer$Outbound, z.ZodTypeDef, JwtBearer > = z.object({ enabled: z.boolean().optional(), scopes: z.array(z.string()).optional(), sub: z.string().optional(), iss: z.string().optional(), aud: z.string().optional(), additionalClaims: z.record(z.any()).optional(), ttl: z.number().optional(), useClientCredentials: z.boolean().optional(), }); export function jwtBearerToJSON(jwtBearer: JwtBearer): string { return JSON.stringify(JwtBearer$outboundSchema.parse(jwtBearer)); } /** @internal */ export type ClientAssertion$Outbound = { type?: string | undefined; ttl?: number | undefined; claims?: { [k: string]: any } | undefined; }; /** @internal */ export const ClientAssertion$outboundSchema: z.ZodType< ClientAssertion$Outbound, z.ZodTypeDef, ClientAssertion > = z.object({ type: z.string().optional(), ttl: z.number().optional(), claims: z.record(z.any()).optional(), }); export function clientAssertionToJSON( clientAssertion: ClientAssertion, ): string { return JSON.stringify(ClientAssertion$outboundSchema.parse(clientAssertion)); } /** @internal */ export type TypeOauth$Outbound = { serverUrl?: string | undefined; serverConfig?: ServerConfig$Outbound | undefined; clientId: string; clientName?: string | undefined; clientSecret?: string | undefined; tokenEndpointAuthMethod?: string | undefined; responseType?: string | undefined; pkceRequired?: boolean | undefined; codeChallengeMethod?: string | undefined; userAuthorization?: UserAuthorization$Outbound | undefined; refreshTokens?: RefreshTokens$Outbound | undefined; clientCredentials?: ClientCredentials$Outbound | undefined; forwardedClaims?: ForwardedClaims$Outbound | undefined; defaultAudience?: string | undefined; defaultTokenExpiresIn?: number | undefined; authorizationUrlParams?: { [k: string]: string } | undefined; jwtBearer?: JwtBearer$Outbound | undefined; clientAssertion?: ClientAssertion$Outbound | undefined; }; /** @internal */ export const TypeOauth$outboundSchema: z.ZodType< TypeOauth$Outbound, z.ZodTypeDef, TypeOauth > = z.object({ serverUrl: z.string().optional(), serverConfig: z.lazy(() => ServerConfig$outboundSchema).optional(), clientId: z.string(), clientName: z.string().optional(), clientSecret: z.string().optional(), tokenEndpointAuthMethod: z.string().optional(), responseType: z.string().optional(), pkceRequired: z.boolean().optional(), codeChallengeMethod: z.string().optional(), userAuthorization: z.lazy(() => UserAuthorization$outboundSchema).optional(), refreshTokens: z.lazy(() => RefreshTokens$outboundSchema).optional(), clientCredentials: z.lazy(() => ClientCredentials$outboundSchema).optional(), forwardedClaims: z.lazy(() => ForwardedClaims$outboundSchema).optional(), defaultAudience: z.string().optional(), defaultTokenExpiresIn: z.number().optional(), authorizationUrlParams: z.record(z.string()).optional(), jwtBearer: z.lazy(() => JwtBearer$outboundSchema).optional(), clientAssertion: z.lazy(() => ClientAssertion$outboundSchema).optional(), }); export function typeOauthToJSON(typeOauth: TypeOauth): string { return JSON.stringify(TypeOauth$outboundSchema.parse(typeOauth)); } /** @internal */ export type ConnectConnectorCreateData$Outbound = | TypeGithub$Outbound | TypeSlack$Outbound | TypeSalesforce$Outbound | TypeLinear$Outbound | TypeSendblue$Outbound | TypePhoton$Outbound | TypeOauth$Outbound | TypeLinq$Outbound | TypeSnowflake$Outbound | TypeApiKey$Outbound | TypeSnowflakeWif$Outbound | { [k: string]: any }; /** @internal */ export const ConnectConnectorCreateData$outboundSchema: z.ZodType< ConnectConnectorCreateData$Outbound, z.ZodTypeDef, ConnectConnectorCreateData > = smartUnion([ z.lazy(() => TypeGithub$outboundSchema), z.lazy(() => TypeSlack$outboundSchema), z.lazy(() => TypeSalesforce$outboundSchema), z.lazy(() => TypeLinear$outboundSchema), z.lazy(() => TypeSendblue$outboundSchema), z.lazy(() => TypePhoton$outboundSchema), z.lazy(() => TypeOauth$outboundSchema), z.lazy(() => TypeLinq$outboundSchema), z.lazy(() => TypeSnowflake$outboundSchema), z.lazy(() => TypeApiKey$outboundSchema), z.lazy(() => TypeSnowflakeWif$outboundSchema), z.record(z.any()), ]); export function connectConnectorCreateDataToJSON( connectConnectorCreateData: ConnectConnectorCreateData, ): string { return JSON.stringify( ConnectConnectorCreateData$outboundSchema.parse(connectConnectorCreateData), ); }