import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DataConnectionError } from "./dataconnectionerror.js"; import { DataConnectionStatus } from "./dataconnectionstatus.js"; /** * The type of platform of the connection. */ export declare const SourceType: { readonly Accounting: "Accounting"; readonly Banking: "Banking"; readonly BankFeed: "BankFeed"; readonly Commerce: "Commerce"; readonly Expense: "Expense"; readonly Other: "Other"; readonly Unknown: "Unknown"; }; /** * The type of platform of the connection. */ export type SourceType = ClosedEnum; /** * A connection represents a [company's](https://docs.codat.io/bank-feeds-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. * * @remarks * * A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: * * - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. * - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. * - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. * Any combination of accounting, banking, and commerce data connections is allowed. * * Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). */ export type Connection = { /** * Unique identifier for a company's data connection. */ id: string; /** * A Codat ID representing the integration. */ integrationId: string; /** * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. */ integrationKey: string; /** * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. */ sourceId: string; /** * The type of platform of the connection. */ sourceType: SourceType; /** * Name of integration connected to company. */ platformName: string; /** * The link URL your customers can use to authorize access to their business application. */ linkUrl: string; /** * The current authorization status of the data connection. */ status: DataConnectionStatus; /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ lastSync?: string | undefined; /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ created: string; dataConnectionErrors?: Array | null | undefined; connectionInfo?: { [k: string]: any; } | null | undefined; }; /** @internal */ export declare const SourceType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Connection$inboundSchema: z.ZodType; export declare function connectionFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=connection.d.ts.map