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>

409 lines 18 kB
import * as z from "zod/v3"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { ConnectTriggerConfiguration } from "./connecttriggerconfiguration.js"; import { ConnectTriggerDestination } from "./connecttriggerdestination.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; export declare const CreatedByEnvironment: { readonly Development: "development"; readonly Preview: "preview"; readonly Production: "production"; }; export type CreatedByEnvironment = ClosedEnum<typeof CreatedByEnvironment>; /** * Deployment environment of the project principal. */ export type CreatedByEnvironmentTarget = string | CreatedByEnvironment; /** * Principal that originally created the connector — either a Vercel user (interactive dashboard / CLI flow) or a Vercel deployment (OIDC-authenticated project, used by runtime auto-provisioning). See {@link ConnexPrincipal}. Optional: pre-existing rows from before this shape was introduced may carry no attribution at all. */ export type CreatedBy2 = { /** * Principal kind. */ type: "project"; /** * Vercel project ID. */ id: string; /** * Deployment environment of the project principal. */ environment: string | CreatedByEnvironment; }; /** * Principal that originally created the connector — either a Vercel user (interactive dashboard / CLI flow) or a Vercel deployment (OIDC-authenticated project, used by runtime auto-provisioning). See {@link ConnexPrincipal}. Optional: pre-existing rows from before this shape was introduced may carry no attribution at all. */ export type CreatedBy1 = { /** * Principal kind. */ type: "user"; /** * Vercel user ID. */ id: string; }; /** * Principal that created the connector. */ export type ConnectConnectorCreateResultCreatedBy = CreatedBy1 | CreatedBy2; export declare const UpdatedByEnvironmentTargetUpdatedByEnvironment: { readonly Development: "development"; readonly Preview: "preview"; readonly Production: "production"; }; export type UpdatedByEnvironmentTargetUpdatedByEnvironment = ClosedEnum<typeof UpdatedByEnvironmentTargetUpdatedByEnvironment>; /** * Deployment environment of the project principal. */ export type UpdatedByEnvironmentTarget = string | UpdatedByEnvironmentTargetUpdatedByEnvironment; /** * Principal that most recently mutated the connector. Same shape as {@link createdBy} but tracks the most recent updater, not the original creator. At create time the two fields point at the same principal; they diverge on the first subsequent update. */ export type ConnectConnectorCreateResultUpdatedBy2 = { /** * Principal kind. */ type: "project"; /** * Vercel project ID. */ id: string; /** * Deployment environment of the project principal. */ environment: string | UpdatedByEnvironmentTargetUpdatedByEnvironment; }; /** * Principal that most recently mutated the connector. Same shape as {@link createdBy} but tracks the most recent updater, not the original creator. At create time the two fields point at the same principal; they diverge on the first subsequent update. */ export type ConnectConnectorCreateResultUpdatedBy1 = { /** * Principal kind. */ type: "user"; /** * Vercel user ID. */ id: string; }; /** * Principal that most recently updated the connector. */ export type ConnectConnectorCreateResultUpdatedBy = ConnectConnectorCreateResultUpdatedBy1 | ConnectConnectorCreateResultUpdatedBy2; /** * How the connector row was originally created. New create paths stamp this explicitly; older rows may omit it. */ export declare const ConnectConnectorCreateResultCreationMode: { readonly Managed: "managed"; readonly Manual: "manual"; }; /** * How the connector row was originally created. New create paths stamp this explicitly; older rows may omit it. */ export type ConnectConnectorCreateResultCreationMode = ClosedEnum<typeof ConnectConnectorCreateResultCreationMode>; /** * Managed connector metadata exposed without leaking the manager connector or installation identifiers. */ export type ConnectConnectorCreateResultManaged = { /** * Whether Vercel synchronizes provider-side configuration. */ sync?: boolean | undefined; }; /** * Connector implementation type. */ export declare const ConnectConnectorCreateResultType: { readonly ApiKey: "api-key"; readonly AwsAlpha: "aws-alpha"; readonly Custom: "custom"; readonly Discord: "discord"; readonly Github: "github"; readonly Linear: "linear"; readonly Linq: "linq"; readonly MicrosoftEntra: "microsoft-entra"; readonly MicrosoftTeams: "microsoft-teams"; readonly Oauth: "oauth"; readonly Photon: "photon"; readonly Salesforce: "salesforce"; readonly Sendblue: "sendblue"; readonly Slack: "slack"; readonly Snowflake: "snowflake"; readonly SnowflakeWif: "snowflake-wif"; }; /** * Connector implementation type. */ export type ConnectConnectorCreateResultType = ClosedEnum<typeof ConnectConnectorCreateResultType>; /** * App-token capabilities and known grants for the connector. */ export type ConnectConnectorCreateResultAppTokens = { /** * Whether one app token can be used across installations. */ crossInstallation: boolean; /** * Whether callers can narrow app-token grants per request. */ supportsRefinement: boolean; /** * Whether callers can request resource-specific app tokens. */ supportsResources?: boolean | undefined; /** * True when changing app token grants requires reinstalling the app, so tokens cannot be partitioned independently by requester environment. */ requiresReinstallation?: boolean | undefined; /** * Known allowed app-level scopes. For Slack this is the bot scope set configured on the app; for OAuth it is the connector's enabled `clientCredentials.scopes` configuration. */ scopes?: Array<string> | undefined; /** * Supported OAuth authorization-detail type names. */ supportedAuthorizationDetails?: Array<string> | undefined; /** * Link to the page on the service where this connector's app-level permissions are declared and granted, when the service has one and it differs from `clientUrl`. */ permissionsUrl?: string | undefined; }; /** * User-token capabilities and known grants for the connector. */ export type ConnectConnectorCreateResultUserTokens = { /** * Whether one user token can be used across installations. */ crossInstallation: boolean; /** * Whether callers can narrow user-token grants per request. */ supportsRefinement: boolean; /** * Whether callers can request resource-specific user tokens. */ supportsResources?: boolean | undefined; /** * Known allowed user-level scopes. For Slack this is the user scope set configured on the app; for OAuth it is the connector's enabled `userAuthorization.scopes` configuration. */ scopes?: Array<string> | undefined; /** * Supported OAuth authorization-detail type names. */ supportedAuthorizationDetails?: Array<string> | undefined; /** * User authorization is completed by the Connect consent screen submitting a credential instead of an OAuth redirect. */ manualCredentialInput?: boolean | undefined; }; /** * Whether the connector icon can propagate to the provider. */ export declare const ConnectConnectorCreateResultSupportsIcon: { readonly False: "false"; readonly Maybe: "maybe"; readonly True: "true"; }; /** * Whether the connector icon can propagate to the provider. */ export type ConnectConnectorCreateResultSupportsIcon = ClosedEnum<typeof ConnectConnectorCreateResultSupportsIcon>; /** * Connector created by the request. */ export type ConnectConnectorCreateResult = { /** * Stable `scl_` connector ID. Use this value directly in `{connector}`. */ id: string; /** * Team-scoped UID. URL-encode this value before using it in `{connector}`. */ uid: string; /** * Installation used when a token request does not specify an installation. */ defaultInstallationId?: string | undefined; /** * Creation time in epoch milliseconds. */ createdAt: number; /** * Last update time in epoch milliseconds. */ updatedAt: number; /** * Time when this connector started requiring reinstallation because an installation-affecting app-token grant changed. */ reinstallAt?: number | undefined; /** * Principal that created the connector. */ createdBy?: CreatedBy1 | CreatedBy2 | undefined; /** * Principal that most recently updated the connector. */ updatedBy?: ConnectConnectorCreateResultUpdatedBy1 | ConnectConnectorCreateResultUpdatedBy2 | undefined; /** * How the connector row was originally created. New create paths stamp this explicitly; older rows may omit it. */ creationMode?: ConnectConnectorCreateResultCreationMode | undefined; /** * Managed connector metadata exposed without leaking the manager connector or installation identifiers. */ managed?: ConnectConnectorCreateResultManaged | undefined; /** * Connector implementation type. */ type: ConnectConnectorCreateResultType; /** * Best-effort identifier of the third-party service this connector represents, independent of `type`. Examples: `'slack'`, `'mcp.linear.app'`, and `'auth.example.com'`. Always present in API responses. */ service: string; /** * The connection method this connector was created from, when the create request named one. */ connectionMethod?: string | undefined; /** * Which of the service's products/surfaces this connector points at. */ target?: string | undefined; /** * Connector name within the owning team. */ name: string; /** * Human-readable connector name. */ displayName: string; /** * Provider-side URL for viewing or managing the resource represented by the connector. The destination can be an app, account, phone line, or service instance, depending on the connector type. */ clientUrl?: string | null | undefined; /** * Redirect URI registered with the third-party service for this connector, if any. Used by `startAuthorization`/`startInstallation` to replay the exact URI back to the provider's token endpoint. Absent on connectors created before this field was introduced; those callers fall back to the `https://connect.vercel.com/callback` default. */ redirectUri?: string | undefined; /** * Human-readable name of the connector type. */ typeName: string; /** * Icon identifier supplied by the connector type. */ typeIcon?: string | undefined; /** * Public website for the connected service. */ website?: string | undefined; /** * Developer website for the connected service. */ devsite?: string | undefined; /** * Developer documentation for the connected service. */ docsite?: string | undefined; /** * Connector branding icon. SHA-1 hash that resolves to the uploaded icon through the Vercel avatar service. Consumers render this with `https://vercel.com/api/www/avatar/{icon}`. */ icon?: string | undefined; /** * Hex background color (e.g., `#000000`) for branding. */ backgroundColor?: string | undefined; /** * Hex accent color (e.g., `#000000`) for branding. */ accentColor?: string | undefined; /** * Token subject types supported by the connector. */ supportedSubjectTypes: Array<string>; /** * App-token capabilities and known grants for the connector. */ appTokens?: ConnectConnectorCreateResultAppTokens | undefined; /** * User-token capabilities and known grants for the connector. */ userTokens?: ConnectConnectorCreateResultUserTokens | undefined; /** * Whether the connector supports an installation flow. */ supportsInstallation: boolean; /** * Whether Connect can revoke tokens for this connector. */ supportsRevocation: boolean; /** * Whether this connector type supports trigger webhooks. Derived from the type definition; indicates that `triggers` and `triggerDestinations` may be meaningful for this connector. */ supportsTriggers: boolean; /** * Whether the connector icon can propagate to the provider. */ supportsIcon: ConnectConnectorCreateResultSupportsIcon; /** * Incoming trigger configuration. Only present when enabled. */ triggers?: ConnectTriggerConfiguration | undefined; /** * Known events this connector subscribes to (e.g. Slack bot events, GitHub webhook events). Names are type-specific and validated by the managed-create flow when forwarded to the third-party service. */ events?: Array<string> | undefined; /** * Destinations that incoming triggers should be forwarded to. Limited to 3 entries. Set the initial destination with `triggerDestination` during creation. Replace the complete set with `PATCH /v1/connect/connectors/{connector}/trigger-destinations`. */ triggerDestinations?: Array<ConnectTriggerDestination> | undefined; }; /** @internal */ export declare const CreatedByEnvironment$inboundSchema: z.ZodNativeEnum<typeof CreatedByEnvironment>; /** @internal */ export declare const CreatedByEnvironmentTarget$inboundSchema: z.ZodType<CreatedByEnvironmentTarget, z.ZodTypeDef, unknown>; export declare function createdByEnvironmentTargetFromJSON(jsonString: string): SafeParseResult<CreatedByEnvironmentTarget, SDKValidationError>; /** @internal */ export declare const CreatedBy2$inboundSchema: z.ZodType<CreatedBy2, z.ZodTypeDef, unknown>; export declare function createdBy2FromJSON(jsonString: string): SafeParseResult<CreatedBy2, SDKValidationError>; /** @internal */ export declare const CreatedBy1$inboundSchema: z.ZodType<CreatedBy1, z.ZodTypeDef, unknown>; export declare function createdBy1FromJSON(jsonString: string): SafeParseResult<CreatedBy1, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultCreatedBy$inboundSchema: z.ZodType<ConnectConnectorCreateResultCreatedBy, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultCreatedByFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultCreatedBy, SDKValidationError>; /** @internal */ export declare const UpdatedByEnvironmentTargetUpdatedByEnvironment$inboundSchema: z.ZodNativeEnum<typeof UpdatedByEnvironmentTargetUpdatedByEnvironment>; /** @internal */ export declare const UpdatedByEnvironmentTarget$inboundSchema: z.ZodType<UpdatedByEnvironmentTarget, z.ZodTypeDef, unknown>; export declare function updatedByEnvironmentTargetFromJSON(jsonString: string): SafeParseResult<UpdatedByEnvironmentTarget, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultUpdatedBy2$inboundSchema: z.ZodType<ConnectConnectorCreateResultUpdatedBy2, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultUpdatedBy2FromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultUpdatedBy2, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultUpdatedBy1$inboundSchema: z.ZodType<ConnectConnectorCreateResultUpdatedBy1, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultUpdatedBy1FromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultUpdatedBy1, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultUpdatedBy$inboundSchema: z.ZodType<ConnectConnectorCreateResultUpdatedBy, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultUpdatedByFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultUpdatedBy, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultCreationMode$inboundSchema: z.ZodNativeEnum<typeof ConnectConnectorCreateResultCreationMode>; /** @internal */ export declare const ConnectConnectorCreateResultManaged$inboundSchema: z.ZodType<ConnectConnectorCreateResultManaged, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultManagedFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultManaged, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultType$inboundSchema: z.ZodNativeEnum<typeof ConnectConnectorCreateResultType>; /** @internal */ export declare const ConnectConnectorCreateResultAppTokens$inboundSchema: z.ZodType<ConnectConnectorCreateResultAppTokens, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultAppTokensFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultAppTokens, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultUserTokens$inboundSchema: z.ZodType<ConnectConnectorCreateResultUserTokens, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultUserTokensFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResultUserTokens, SDKValidationError>; /** @internal */ export declare const ConnectConnectorCreateResultSupportsIcon$inboundSchema: z.ZodNativeEnum<typeof ConnectConnectorCreateResultSupportsIcon>; /** @internal */ export declare const ConnectConnectorCreateResult$inboundSchema: z.ZodType<ConnectConnectorCreateResult, z.ZodTypeDef, unknown>; export declare function connectConnectorCreateResultFromJSON(jsonString: string): SafeParseResult<ConnectConnectorCreateResult, SDKValidationError>; //# sourceMappingURL=connectconnectorcreateresult.d.ts.map