import * as z from "zod/v3"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AuthType } from "./authtype.js"; import { ConnectionState } from "./connectionstate.js"; import { ConsentRecord } from "./consentrecord.js"; import { ConsentRecordInput, ConsentRecordInput$Outbound } from "./consentrecordinput.js"; import { ConsentState } from "./consentstate.js"; import { CustomMapping } from "./custommapping.js"; import { CustomMappingInput, CustomMappingInput$Outbound } from "./custommappinginput.js"; import { DataScopes } from "./datascopes.js"; import { DataScopesInput, DataScopesInput$Outbound } from "./datascopesinput.js"; import { FormField } from "./formfield.js"; import { FormFieldOption, FormFieldOption$Outbound } from "./formfieldoption.js"; import { IntegrationState } from "./integrationstate.js"; import { OAuthGrantType } from "./oauthgranttype.js"; import { WebhookSubscription } from "./webhooksubscription.js"; /** * Status of the connection. */ export declare const ConnectionStatus: { readonly Live: "live"; readonly Upcoming: "upcoming"; readonly Requested: "requested"; }; /** * Status of the connection. */ export type ConnectionStatus = OpenEnum; /** * Attach your own consumer specific metadata */ export type ConnectionMetadata = { /** * Normalized identifier of the authorized organization, copied from the connector-specific setting (e.g. Xero tenant_id, QuickBooks realm_id, NetSuite account_id). */ companyId?: string | undefined; additionalProperties?: { [k: string]: any; } | undefined; }; export declare const Target: { readonly CustomFields: "custom_fields"; readonly Resource: "resource"; }; export type Target = OpenEnum; export type Value5 = string | number | number; export type ConnectionValue = string | number | number | boolean | Array; export type Defaults = { target?: Target | undefined; id?: string | undefined; options?: Array | undefined; value?: string | number | number | boolean | Array | undefined; }; export type Configuration = { resource?: string | undefined; defaults?: Array | undefined; }; /** * Operational health status of the connection */ export declare const Health: { readonly Revoked: "revoked"; readonly MissingSettings: "missing_settings"; readonly NeedsConsent: "needs_consent"; readonly PendingConfirmation: "pending_confirmation"; readonly NeedsAuth: "needs_auth"; readonly PendingRefresh: "pending_refresh"; readonly Ok: "ok"; readonly Degraded: "degraded"; }; /** * Operational health status of the connection */ export type Health = OpenEnum; export type Connection = { /** * The unique identifier of the connection. */ id?: string | undefined; /** * The ID of the service this connection belongs to. */ serviceId?: string | undefined; /** * The name of the connection */ name?: string | undefined; tagLine?: string | undefined; /** * The unified API category where the connection belongs to. */ unifiedApi?: string | undefined; /** * [Connection state flow](#section/Connection-state) */ state?: ConnectionState | undefined; /** * The current state of the Integration. */ integrationState?: IntegrationState | undefined; /** * Type of authorization used by the connector */ authType?: AuthType | undefined; /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ oauthGrantType?: OAuthGrantType | undefined; /** * Status of the connection. */ status?: ConnectionStatus | undefined; /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ enabled?: boolean | undefined; /** * The website URL of the connection */ website?: string | undefined; /** * A visual icon of the connection, that will be shown in the Vault */ icon?: string | undefined; /** * The logo of the connection, that will be shown in the Vault */ logo?: string | undefined; /** * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ authorizeUrl?: string | null | undefined; /** * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ revokeUrl?: string | null | undefined; /** * Connection settings. Values will persist to `form_fields` with corresponding id */ settings?: { [k: string]: any; } | null | undefined; /** * Attach your own consumer specific metadata */ metadata?: ConnectionMetadata | null | undefined; /** * The settings that are wanted to create a connection. */ formFields?: Array | undefined; configuration?: Array | undefined; configurableResources?: Array | undefined; resourceSchemaSupport?: Array | undefined; resourceSettingsSupport?: Array | undefined; validationSupport?: boolean | undefined; schemaSupport?: boolean | undefined; /** * List of settings that are required to be configured on integration before authorization can occur */ settingsRequiredForAuthorization?: Array | undefined; subscriptions?: Array | undefined; /** * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). */ hasGuide?: boolean | undefined; /** * List of custom mappings configured for this connection */ customMappings?: Array | undefined; /** * The current consent state of the connection */ consentState?: ConsentState | undefined; /** * Immutable array of consent records for compliance and audit purposes */ consents?: Array | undefined; latestConsent?: ConsentRecord | undefined; applicationDataScopes?: DataScopes | undefined; /** * Operational health status of the connection */ health?: Health | undefined; /** * Unix timestamp in milliseconds when credentials will be deleted if token refresh continues to fail. A value of 0 indicates no active retention window (connection is healthy or not using OAuth token refresh). */ credentialsExpireAt?: number | undefined; /** * Unix timestamp in milliseconds of the last failed token refresh attempt. A value of 0 indicates no recent failures. This field is used internally to enforce cooldown periods between retry attempts. */ lastRefreshFailedAt?: number | undefined; /** * Unix timestamp in milliseconds of the last downstream unreachable error (502/504 network class). A value of 0 indicates no active error. Connection remains callable while this is set; health surfaces as 'degraded'. */ lastDownstreamErrorAt?: number | undefined; createdAt?: number | undefined; updatedAt?: number | null | undefined; }; /** * Attach your own consumer specific metadata */ export type ConnectionMetadataInput = { additionalProperties?: { [k: string]: any; } | undefined; }; export type ConnectionDefaults = { id?: string | undefined; options?: Array | undefined; value?: string | number | number | boolean | Array | undefined; }; export type ConnectionConfiguration = { resource?: string | undefined; defaults?: Array | undefined; }; export type ConnectionInput = { /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ enabled?: boolean | undefined; /** * Connection settings. Values will persist to `form_fields` with corresponding id */ settings?: { [k: string]: any; } | null | undefined; /** * Attach your own consumer specific metadata */ metadata?: ConnectionMetadataInput | null | undefined; configuration?: Array | undefined; /** * List of custom mappings configured for this connection */ customMappings?: Array | undefined; /** * The current consent state of the connection */ consentState?: ConsentState | undefined; latestConsent?: ConsentRecordInput | undefined; applicationDataScopes?: DataScopesInput | undefined; }; /** @internal */ export declare const ConnectionStatus$inboundSchema: z.ZodType; /** @internal */ export declare const ConnectionMetadata$inboundSchema: z.ZodType; export declare function connectionMetadataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Target$inboundSchema: z.ZodType; /** @internal */ export declare const Value5$inboundSchema: z.ZodType; /** @internal */ export type Value5$Outbound = string | number | number; /** @internal */ export declare const Value5$outboundSchema: z.ZodType; export declare function value5ToJSON(value5: Value5): string; export declare function value5FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ConnectionValue$inboundSchema: z.ZodType; /** @internal */ export type ConnectionValue$Outbound = string | number | number | boolean | Array; /** @internal */ export declare const ConnectionValue$outboundSchema: z.ZodType; export declare function connectionValueToJSON(connectionValue: ConnectionValue): string; export declare function connectionValueFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Defaults$inboundSchema: z.ZodType; export declare function defaultsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Configuration$inboundSchema: z.ZodType; export declare function configurationFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Health$inboundSchema: z.ZodType; /** @internal */ export declare const Connection$inboundSchema: z.ZodType; export declare function connectionFromJSON(jsonString: string): SafeParseResult; /** @internal */ export type ConnectionMetadataInput$Outbound = { [additionalProperties: string]: unknown; }; /** @internal */ export declare const ConnectionMetadataInput$outboundSchema: z.ZodType; export declare function connectionMetadataInputToJSON(connectionMetadataInput: ConnectionMetadataInput): string; /** @internal */ export type ConnectionDefaults$Outbound = { id?: string | undefined; options?: Array | undefined; value?: string | number | number | boolean | Array | undefined; }; /** @internal */ export declare const ConnectionDefaults$outboundSchema: z.ZodType; export declare function connectionDefaultsToJSON(connectionDefaults: ConnectionDefaults): string; /** @internal */ export type ConnectionConfiguration$Outbound = { resource?: string | undefined; defaults?: Array | undefined; }; /** @internal */ export declare const ConnectionConfiguration$outboundSchema: z.ZodType; export declare function connectionConfigurationToJSON(connectionConfiguration: ConnectionConfiguration): string; /** @internal */ export type ConnectionInput$Outbound = { enabled?: boolean | undefined; settings?: { [k: string]: any; } | null | undefined; metadata?: ConnectionMetadataInput$Outbound | null | undefined; configuration?: Array | undefined; custom_mappings?: Array | undefined; consent_state?: string | undefined; latest_consent?: ConsentRecordInput$Outbound | undefined; application_data_scopes?: DataScopesInput$Outbound | undefined; }; /** @internal */ export declare const ConnectionInput$outboundSchema: z.ZodType; export declare function connectionInputToJSON(connectionInput: ConnectionInput): string; //# sourceMappingURL=connection.d.ts.map