@vrplatform/api 1.3.1-stage.2286 → 1.3.1-stage.2295
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main/{services/api/client.js → client.js} +27 -44
- package/build/main/client.js.map +1 -0
- package/build/main/error.d.ts +22 -0
- package/build/main/{services/api/error.js → error.js} +8 -12
- package/build/main/error.js.map +1 -0
- package/build/main/generated/openapi-fetch.d.ts +224 -0
- package/build/main/generated/openapi-fetch.js +14 -0
- package/build/main/generated/openapi-fetch.js.map +1 -0
- package/build/{module/services/api → main}/generated/v1.d.ts +185 -1168
- package/build/main/{services/api/generated → generated}/v1.js.map +1 -1
- package/build/main/index.d.ts +6 -14
- package/build/main/index.js +3 -19
- package/build/main/index.js.map +1 -1
- package/build/main/tsconfig.main.tsbuildinfo +1 -1
- package/build/main/types.d.ts +61 -0
- package/build/main/types.js.map +1 -0
- package/build/module/client.js +66 -0
- package/build/module/client.js.map +1 -0
- package/build/module/error.d.ts +22 -0
- package/build/module/{services/api/error.js → error.js} +8 -12
- package/build/module/error.js.map +1 -0
- package/build/module/generated/openapi-fetch.d.ts +224 -0
- package/build/module/generated/openapi-fetch.js +2 -0
- package/build/module/generated/openapi-fetch.js.map +1 -0
- package/build/{main/services/api → module}/generated/v1.d.ts +185 -1168
- package/build/module/{services/api/generated → generated}/v1.js.map +1 -1
- package/build/module/index.d.ts +6 -14
- package/build/module/index.js +3 -6
- package/build/module/index.js.map +1 -1
- package/build/module/tsconfig.esm.tsbuildinfo +1 -1
- package/build/module/types.d.ts +61 -0
- package/build/module/types.js.map +1 -0
- package/package.json +7 -39
- package/src/client.ts +99 -0
- package/src/error.ts +71 -0
- package/src/generated/openapi-fetch.ts +433 -0
- package/src/{services/api/generated → generated}/v1.ts +185 -1168
- package/src/index.ts +7 -49
- package/src/types.ts +98 -0
- package/build/main/analytics/client.d.ts +0 -16
- package/build/main/analytics/client.js +0 -81
- package/build/main/analytics/client.js.map +0 -1
- package/build/main/analytics/index.d.ts +0 -2
- package/build/main/analytics/index.js +0 -19
- package/build/main/analytics/index.js.map +0 -1
- package/build/main/analytics/types.d.ts +0 -77
- package/build/main/analytics/types.js.map +0 -1
- package/build/main/service-client.d.ts +0 -15
- package/build/main/service-client.js +0 -90
- package/build/main/service-client.js.map +0 -1
- package/build/main/services/analytics/client.d.ts +0 -16
- package/build/main/services/analytics/client.js +0 -33
- package/build/main/services/analytics/client.js.map +0 -1
- package/build/main/services/analytics/generated/v1.d.ts +0 -359
- package/build/main/services/analytics/generated/v1.js.map +0 -1
- package/build/main/services/api/client.js.map +0 -1
- package/build/main/services/api/error.d.ts +0 -22
- package/build/main/services/api/error.js.map +0 -1
- package/build/main/services/api/generated/v1.js +0 -7
- package/build/main/services/api/index.d.ts +0 -6
- package/build/main/services/api/index.js +0 -20
- package/build/main/services/api/index.js.map +0 -1
- package/build/main/services/api/types.d.ts +0 -128
- package/build/main/services/api/types.js +0 -3
- package/build/main/services/api/types.js.map +0 -1
- package/build/main/services/cache/client.d.ts +0 -16
- package/build/main/services/cache/client.js +0 -33
- package/build/main/services/cache/client.js.map +0 -1
- package/build/main/services/cache/generated/v1.d.ts +0 -1009
- package/build/main/services/cache/generated/v1.js +0 -7
- package/build/main/services/cache/generated/v1.js.map +0 -1
- package/build/main/services/cache/index.d.ts +0 -2
- package/build/main/services/cache/index.js +0 -18
- package/build/main/services/cache/index.js.map +0 -1
- package/build/main/services/control-plane/client.d.ts +0 -17
- package/build/main/services/control-plane/client.js +0 -33
- package/build/main/services/control-plane/client.js.map +0 -1
- package/build/main/services/control-plane/generated/v1.d.ts +0 -2123
- package/build/main/services/control-plane/generated/v1.js +0 -7
- package/build/main/services/control-plane/generated/v1.js.map +0 -1
- package/build/main/services/control-plane/index.d.ts +0 -2
- package/build/main/services/control-plane/index.js +0 -18
- package/build/main/services/control-plane/index.js.map +0 -1
- package/build/main/services/ingest/client.d.ts +0 -16
- package/build/main/services/ingest/client.js +0 -33
- package/build/main/services/ingest/client.js.map +0 -1
- package/build/main/services/ingest/generated/v1.d.ts +0 -1920
- package/build/main/services/ingest/generated/v1.js +0 -7
- package/build/main/services/ingest/generated/v1.js.map +0 -1
- package/build/main/services/ingest/index.d.ts +0 -2
- package/build/main/services/ingest/index.js +0 -18
- package/build/main/services/ingest/index.js.map +0 -1
- package/build/module/analytics/client.d.ts +0 -16
- package/build/module/analytics/client.js +0 -39
- package/build/module/analytics/client.js.map +0 -1
- package/build/module/analytics/index.d.ts +0 -2
- package/build/module/analytics/index.js +0 -3
- package/build/module/analytics/index.js.map +0 -1
- package/build/module/analytics/types.d.ts +0 -77
- package/build/module/analytics/types.js.map +0 -1
- package/build/module/service-client.d.ts +0 -15
- package/build/module/service-client.js +0 -51
- package/build/module/service-client.js.map +0 -1
- package/build/module/services/analytics/client.d.ts +0 -16
- package/build/module/services/analytics/client.js +0 -24
- package/build/module/services/analytics/client.js.map +0 -1
- package/build/module/services/analytics/generated/v1.d.ts +0 -359
- package/build/module/services/analytics/generated/v1.js.map +0 -1
- package/build/module/services/api/client.js +0 -83
- package/build/module/services/api/client.js.map +0 -1
- package/build/module/services/api/error.d.ts +0 -22
- package/build/module/services/api/error.js.map +0 -1
- package/build/module/services/api/generated/v1.js +0 -6
- package/build/module/services/api/index.d.ts +0 -6
- package/build/module/services/api/index.js +0 -4
- package/build/module/services/api/index.js.map +0 -1
- package/build/module/services/api/types.d.ts +0 -128
- package/build/module/services/api/types.js +0 -2
- package/build/module/services/api/types.js.map +0 -1
- package/build/module/services/cache/client.d.ts +0 -16
- package/build/module/services/cache/client.js +0 -24
- package/build/module/services/cache/client.js.map +0 -1
- package/build/module/services/cache/generated/v1.d.ts +0 -1009
- package/build/module/services/cache/generated/v1.js +0 -6
- package/build/module/services/cache/generated/v1.js.map +0 -1
- package/build/module/services/cache/index.d.ts +0 -2
- package/build/module/services/cache/index.js +0 -2
- package/build/module/services/cache/index.js.map +0 -1
- package/build/module/services/control-plane/client.d.ts +0 -17
- package/build/module/services/control-plane/client.js +0 -24
- package/build/module/services/control-plane/client.js.map +0 -1
- package/build/module/services/control-plane/generated/v1.d.ts +0 -2123
- package/build/module/services/control-plane/generated/v1.js +0 -6
- package/build/module/services/control-plane/generated/v1.js.map +0 -1
- package/build/module/services/control-plane/index.d.ts +0 -2
- package/build/module/services/control-plane/index.js +0 -2
- package/build/module/services/control-plane/index.js.map +0 -1
- package/build/module/services/ingest/client.d.ts +0 -16
- package/build/module/services/ingest/client.js +0 -24
- package/build/module/services/ingest/client.js.map +0 -1
- package/build/module/services/ingest/generated/v1.d.ts +0 -1920
- package/build/module/services/ingest/generated/v1.js +0 -6
- package/build/module/services/ingest/generated/v1.js.map +0 -1
- package/build/module/services/ingest/index.d.ts +0 -2
- package/build/module/services/ingest/index.js +0 -2
- package/build/module/services/ingest/index.js.map +0 -1
- package/src/analytics/client.ts +0 -81
- package/src/analytics/index.ts +0 -2
- package/src/analytics/types.ts +0 -83
- package/src/service-client.ts +0 -80
- package/src/services/analytics/client.ts +0 -44
- package/src/services/analytics/generated/v1.ts +0 -360
- package/src/services/api/client.ts +0 -146
- package/src/services/api/error.ts +0 -82
- package/src/services/api/index.ts +0 -8
- package/src/services/api/types.ts +0 -212
- package/src/services/cache/client.ts +0 -44
- package/src/services/cache/generated/v1.ts +0 -1010
- package/src/services/cache/index.ts +0 -2
- package/src/services/control-plane/client.ts +0 -46
- package/src/services/control-plane/generated/v1.ts +0 -2124
- package/src/services/control-plane/index.ts +0 -2
- package/src/services/ingest/client.ts +0 -44
- package/src/services/ingest/generated/v1.ts +0 -1921
- package/src/services/ingest/index.ts +0 -2
- /package/build/main/{services/api/client.d.ts → client.d.ts} +0 -0
- /package/build/main/{services/analytics/generated → generated}/v1.js +0 -0
- /package/build/main/{analytics/types.js → types.js} +0 -0
- /package/build/module/{services/api/client.d.ts → client.d.ts} +0 -0
- /package/build/module/{services/analytics/generated → generated}/v1.js +0 -0
- /package/build/module/{analytics/types.js → types.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"src/","sources":["services/ingest/generated/v1.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n */\n\nexport interface paths {\n \"/health\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n /** @description Health endpoint for ingest worker. */\n get: operations[\"getHealth\"];\n put?: never;\n post?: never;\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/connections/query\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Read multiple ingest connection runtime records and decrypted credential payloads. */\n post: operations[\"postV1ConnectionsQuery\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/connections/{connectionId}\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n /** @description Read an ingest connection runtime record and decrypted credential payload. */\n get: operations[\"getV1ConnectionsByConnectionId\"];\n /** @description Upsert an ingest connection runtime record and encrypted credential payload. */\n put: operations[\"putV1ConnectionsByConnectionId\"];\n post?: never;\n /** @description Delete an ingest connection runtime and credential record. */\n delete: operations[\"deleteV1ConnectionsByConnectionId\"];\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/bank-accounts\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit bank account payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestBankAccounts\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/bank-records\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit bank record payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestBankRecords\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/contacts\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit contact payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestContacts\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/listings\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit listing payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestListings\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/payments\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit payment payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestPayments\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/reservations\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit reservation payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestReservations\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/ingest/transactions\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** @description Submit transaction payloads for ingest apply orchestration. */\n post: operations[\"postV1IngestTransactions\"];\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n \"/v1/runs/{runId}\": {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n /** @description Read ingest run summary by id. */\n get: operations[\"getV1RunsByRunId\"];\n put?: never;\n post?: never;\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n}\nexport type webhooks = Record<string, never>;\nexport interface components {\n schemas: never;\n responses: never;\n parameters: never;\n requestBodies: never;\n headers: never;\n pathItems: never;\n}\nexport type $defs = Record<string, never>;\nexport interface operations {\n getHealth: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody?: never;\n responses: {\n /** @description Service health */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n ok: boolean;\n /** @constant */\n service: \"ingest\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1ConnectionsQuery: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n connectionIds: string[];\n /** @default false */\n includeCredentials?: boolean;\n };\n };\n };\n responses: {\n /** @description Ingest connection list */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n connectionId: string;\n /** Format: uuid */\n tenantId: string;\n appId: string;\n status: string;\n fetchStatus: string;\n lastFetchAt?: string | null;\n nextFetchAt?: string | null;\n errorCode?: string | null;\n errorMessage?: string | null;\n /** Format: date-time */\n updatedAt: string;\n credentials?: {\n [key: string]: unknown;\n };\n }[];\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n getV1ConnectionsByConnectionId: {\n parameters: {\n query?: never;\n header?: never;\n path: {\n connectionId: string;\n };\n cookie?: never;\n };\n requestBody?: never;\n responses: {\n /** @description Ingest connection */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n connectionId: string;\n /** Format: uuid */\n tenantId: string;\n appId: string;\n status: string;\n fetchStatus: string;\n lastFetchAt?: string | null;\n nextFetchAt?: string | null;\n errorCode?: string | null;\n errorMessage?: string | null;\n /** Format: date-time */\n updatedAt: string;\n credentials?: {\n [key: string]: unknown;\n };\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n putV1ConnectionsByConnectionId: {\n parameters: {\n query?: never;\n header?: never;\n path: {\n connectionId: string;\n };\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n appId: string;\n status: string;\n fetchStatus: string;\n lastFetchAt?: string | null;\n nextFetchAt?: string | null;\n errorCode?: string | null;\n errorMessage?: string | null;\n credentials?: {\n [key: string]: unknown;\n };\n };\n };\n };\n responses: {\n /** @description Stored ingest connection */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n connectionId: string;\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n deleteV1ConnectionsByConnectionId: {\n parameters: {\n query?: never;\n header?: never;\n path: {\n connectionId: string;\n };\n cookie?: never;\n };\n requestBody?: never;\n responses: {\n /** @description Delete result */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n deleted: boolean;\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestBankAccounts: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n id?: string | null;\n /** @enum {string} */\n type: \"deposit\" | \"creditCard\";\n /** @enum {string} */\n category: \"trust\" | \"operating\" | \"external\";\n name: string;\n uniqueRef?: string | null;\n sourceId?: string | null;\n currency?: string | null;\n lastDigits?: string | null;\n status?: (\"active\" | \"inactive\") | null;\n accountId?: string | null;\n startDate?: string | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestBankRecords: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n uniqueRef?: string | null;\n date: string;\n /** @enum {string} */\n status?: \"active\" | \"inactive\";\n description?: string | null;\n accountId?: string | null;\n /** @enum {string} */\n type?: \"transaction\" | \"balance\";\n amount?: number;\n balance?: number | null;\n reconciliation?: {\n status?: (\"unpaid\" | \"underpaid\" | \"overpaid\" | \"paid\") | null;\n transactions?: {\n id: string;\n date: string;\n description?: string | null;\n type: string;\n amount: number;\n }[] | null;\n };\n id?: string | null;\n bankAccountRef?: string | null;\n sourceId?: string | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestContacts: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n address?: {\n full?: string | null;\n line1?: string | null;\n line2?: string | null;\n city?: string | null;\n /** @description Deprecated, use stateCode instead */\n state?: string | null;\n postalCode?: string | null;\n stateCode?: string | null;\n countryCode?: string | null;\n } | null;\n /** @enum {string} */\n type: \"owner\" | \"vendor\";\n firstName?: string | null;\n name?: string | null;\n phone?: string | null;\n connectionId?: string | null;\n companyType?: (\"c_corporation\" | \"limited_liability_company\" | \"partnership\" | \"s_corporation\" | \"trust_estate\") | null;\n taxIdentifier?: string | null;\n sourceId?: string | null;\n uniqueRef?: string | null;\n status?: (\"active\" | \"inactive\") | null;\n payoutAccountId?: string | null;\n id?: string | null;\n email?: string | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestListings: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n id?: string | null;\n uniqueRef?: string | null;\n name: string;\n sourceId?: string | null;\n status?: (\"active\" | \"inactive\") | null;\n address?: {\n full?: string | null;\n line1?: string | null;\n line2?: string | null;\n city?: string | null;\n /** @description Deprecated, use stateCode instead */\n state?: string | null;\n postalCode?: string | null;\n stateCode?: string | null;\n countryCode?: string | null;\n } | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestPayments: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n id?: string | null;\n uniqueRef?: string | null;\n etaAt?: string | null;\n paidAt?: string | null;\n /** @description Currency in ISO 4217 format, will be converted to lowercase */\n currency: string;\n description?: string | null;\n metadata?: {\n [key: string]: unknown;\n } | null;\n userdata?: {\n [key: string]: unknown;\n } | null;\n sourceId?: string | null;\n lines: {\n id?: string | null;\n uniqueRef?: string | null;\n type: string;\n description?: string | null;\n reservationId?: string | null;\n reservationRef?: string | null;\n /** @description Value in cents (100 = 1€) */\n amount: number;\n accountId?: string | null;\n accountRef?: string | null;\n connectionId?: string | null;\n metadata?: {\n [key: string]: unknown;\n } | null;\n generalLedgerPostingAt?: string | null;\n }[];\n bankAccountRef?: string | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestReservations: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n currency?: string | null;\n uniqueRef?: string | null;\n guestName?: string | null;\n bookerName?: string | null;\n checkIn?: string | null;\n checkOut?: string | null;\n generalLedgerPostingAt?: string | null;\n listingId?: string | null;\n status?: (\"booked\" | \"cancelled\" | \"canceled\" | \"inquiry\" | \"inactive\") | null;\n bookedAt?: string | null;\n cancelledAt?: string | null;\n bookingPlatform?: string | null;\n confirmationCode?: string | null;\n pmsReferenceCode?: string | null;\n guests?: number | null;\n userdata?: {\n [key: string]: unknown;\n } | null;\n metadata?: {\n [key: string]: unknown;\n } | null;\n sourceId?: string | null;\n source?: {\n type: string;\n uniqueRef?: string | null;\n data: {\n [key: string]: unknown;\n };\n lastWebhookAt?: string | null;\n } | null;\n lines?: {\n id?: string | null;\n uniqueRef?: string | null;\n type: string;\n description?: string | null;\n reservationRef?: string | null;\n /** @description Value in cents (100 = 1€) */\n amount: number;\n accountId?: string | null;\n accountRef?: string | null;\n connectionId?: string | null;\n metadata?: {\n [key: string]: unknown;\n } | null;\n generalLedgerPostingAt?: string | null;\n }[];\n id?: string | null;\n /** @description Total lines amounts, for insert validation purposes */\n lineTotalAmount?: number | null;\n changeId?: string | null;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n postV1IngestTransactions: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n \"application/json\": {\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n requestedScope?: {\n [key: string]: unknown;\n };\n bootstrapFromLegacySource?: boolean;\n writeLegacySource?: boolean;\n items: {\n remoteId: string;\n payload: {\n description: string;\n status?: (\"active\" | \"inactive\") | null;\n accountId?: string | null;\n contactId?: string | null;\n uniqueRef?: string | null;\n isOpeningBalance?: boolean;\n /** @enum {string} */\n type: \"deposit\" | \"expense\" | \"transfer\" | \"payout\";\n date: string;\n currency?: string | null;\n lines: {\n recurringTemplateId?: string | null;\n uniqueRef?: string | null;\n description: string;\n accountId?: string | null;\n assignment?: (\"accountsPayable\" | \"accountsReceivable\" | \"cancellationRevenue\" | \"deferredRevenue\" | \"deposit_channelFee\" | \"deposit_coHostPayout\" | \"deposit_merchantFee\" | \"openingBalance\" | \"deposit_reserve\" | \"deposit_vat\" | \"dueToFromTrust\" | \"expense_markup\" | \"expense_reimbursement\" | \"expense_salesTax\" | \"payout_bankAccount\" | \"payout_distribution\") | null;\n /** @description Value in cents (100 = 1€) */\n amount: number;\n appliedAmount?: {\n taxRateId?: string | null;\n taxBehavior?: (\"excluded\" | \"included\") | null;\n } | null;\n markup?: {\n amount?: number | null;\n taxRateId?: string | null;\n taxBehavior?: (\"excluded\" | \"included\") | null;\n } | null;\n listingId?: string | null;\n reservationId?: string | null;\n ownerStatementId?: string | null;\n party?: (\"owners\" | \"manager\") | null;\n contactId?: string | null;\n matchReservationConfirmationCode?: string | null;\n matchReservationStripeGuestRef?: string | null;\n matchLineTypeClassification?: string | null;\n }[];\n attachmentIds?: string[] | null;\n payment?: {\n bankRecordIds?: string[];\n /** @enum {string} */\n status?: \"unpaid\" | \"underpaid\" | \"overpaid\" | \"paid\";\n date?: string | null;\n lock?: {\n /** @enum {string} */\n status: \"locked\" | \"unlocked\";\n booksClosed?: {\n date: string;\n } | null;\n ownerStatement?: {\n ids: string[];\n } | null;\n reconciled?: {\n bankRecordIds: string[];\n } | null;\n statementPeriod?: {\n hits: {\n /** Format: uuid */\n listingId: string;\n txnAt: string;\n openFrom: string;\n }[];\n } | null;\n } | null;\n } | null;\n sourceId?: string | null;\n recurringTemplateId?: string | null;\n matchBankAccountLast4?: string | null;\n id?: string;\n };\n /** Format: date-time */\n sourceLastWebhookAt?: string;\n description?: string;\n status?: string;\n date?: string;\n /** Format: uuid */\n reservationId?: string;\n }[];\n };\n };\n };\n responses: {\n /** @description Submitted raw ingest run */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n runId: string;\n /** @enum {string} */\n targetRealm: \"vrtrust\" | \"vrintegration\";\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n submitted: number;\n deduped: number;\n enqueued: number;\n skippedJobs: number;\n rawSubmitted: number;\n rawDeduped: number;\n legacyBootstrapMatched: number;\n rawSkippedByWebhook: number;\n rawUploaded: number;\n rawNoop: number;\n legacySourceSubmitted: number;\n legacySourceDeduped: number;\n legacySourceUpserted: number;\n /** @constant */\n status: \"completed\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n getV1RunsByRunId: {\n parameters: {\n query: {\n tenantId: string;\n };\n header?: never;\n path: {\n runId: string;\n };\n cookie?: never;\n };\n requestBody?: never;\n responses: {\n /** @description Ingest run summary */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n /** Format: uuid */\n id: string;\n /** Format: uuid */\n tenantId: string;\n /** Format: uuid */\n connectionId: string;\n /** @enum {string} */\n triggerType: \"manual\" | \"schedule\" | \"webhook\" | \"initial\";\n /** @enum {string} */\n status: \"started\" | \"completed\" | \"failed\";\n /** Format: date-time */\n startedAt: string;\n finishedAt: string | null;\n totalItems: number;\n failedItems: number;\n /** @enum {string} */\n dataRegion: \"us\" | \"eu\" | \"ap\";\n };\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Unauthorized */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Forbidden */\n 403: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Not found */\n 404: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n \"application/json\": {\n code: string;\n message: string;\n };\n };\n };\n };\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["services/ingest/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC","sourcesContent":["export * from './client';\nexport type * from './generated/v1';\n"]}
|
package/src/analytics/client.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import * as Sentry from '@sentry/core';
|
|
2
|
-
import {
|
|
3
|
-
type RetryableFetchParams,
|
|
4
|
-
useRetryableFetch,
|
|
5
|
-
} from '@vrplatform/utils';
|
|
6
|
-
import createClient from 'openapi-fetch';
|
|
7
|
-
import {
|
|
8
|
-
applySentryTraceHeaders,
|
|
9
|
-
type ServiceFetchResponse,
|
|
10
|
-
throwIfServiceError,
|
|
11
|
-
} from '../service-client';
|
|
12
|
-
import type {
|
|
13
|
-
AnalyticsClient,
|
|
14
|
-
AnalyticsClientAuth,
|
|
15
|
-
AnalyticsPaths,
|
|
16
|
-
} from './types';
|
|
17
|
-
|
|
18
|
-
export class AnalyticsApiClientError extends Error {
|
|
19
|
-
constructor(message: string) {
|
|
20
|
-
super(message);
|
|
21
|
-
this.name = 'AnalyticsApiClientError';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function throwIfAnalyticsError<T extends ServiceFetchResponse>(
|
|
26
|
-
responsePromise: Promise<T> | T
|
|
27
|
-
): Promise<{
|
|
28
|
-
data: NonNullable<T['data']>;
|
|
29
|
-
headers: Headers;
|
|
30
|
-
}> {
|
|
31
|
-
return throwIfServiceError(
|
|
32
|
-
responsePromise,
|
|
33
|
-
(message) => new AnalyticsApiClientError(message),
|
|
34
|
-
'Analytics request failed'
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function useAnalyticsClient({
|
|
39
|
-
baseUrl,
|
|
40
|
-
auth,
|
|
41
|
-
headers: h,
|
|
42
|
-
...retryableFetchParams
|
|
43
|
-
}: {
|
|
44
|
-
attempts?: number;
|
|
45
|
-
auth?: AnalyticsClientAuth | (() => AnalyticsClientAuth);
|
|
46
|
-
baseUrl?: string;
|
|
47
|
-
headers?: Record<string, string> | (() => Record<string, string>);
|
|
48
|
-
} & RetryableFetchParams): AnalyticsClient {
|
|
49
|
-
const retryableFetch = useRetryableFetch(retryableFetchParams);
|
|
50
|
-
const trace = Sentry.getTraceData();
|
|
51
|
-
|
|
52
|
-
const client = createClient<AnalyticsPaths>({
|
|
53
|
-
baseUrl: baseUrl ?? 'https://analytics.edge.vrplatform.app',
|
|
54
|
-
fetch(req) {
|
|
55
|
-
return retryableFetch(async () => {
|
|
56
|
-
const clone = new Request(req);
|
|
57
|
-
const resolvedAuth = typeof auth === 'function' ? auth() : auth;
|
|
58
|
-
|
|
59
|
-
if (resolvedAuth?.accessToken) {
|
|
60
|
-
clone.headers.set(
|
|
61
|
-
'Authorization',
|
|
62
|
-
resolvedAuth.accessToken.startsWith('Bearer ')
|
|
63
|
-
? resolvedAuth.accessToken
|
|
64
|
-
: `Bearer ${resolvedAuth.accessToken}`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const additionalHeaders = h ? (typeof h === 'function' ? h() : h) : {};
|
|
69
|
-
for (const key in additionalHeaders) {
|
|
70
|
-
clone.headers.set(key, additionalHeaders[key]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
applySentryTraceHeaders(clone.headers, trace);
|
|
74
|
-
|
|
75
|
-
return clone;
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
return client as AnalyticsClient;
|
|
81
|
-
}
|
package/src/analytics/index.ts
DELETED
package/src/analytics/types.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type createClient from 'openapi-fetch';
|
|
2
|
-
|
|
3
|
-
type OpenApiHeaders = {
|
|
4
|
-
[name: string]: unknown;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
type OpenApiNoParameters = {
|
|
8
|
-
query?: never;
|
|
9
|
-
header?: never;
|
|
10
|
-
path?: never;
|
|
11
|
-
cookie?: never;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
type OpenApiJsonResponse<T> = {
|
|
15
|
-
headers: OpenApiHeaders;
|
|
16
|
-
content: {
|
|
17
|
-
'application/json': T;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type UiAnalyticsEventInput = {
|
|
22
|
-
anonymousId?: string | null;
|
|
23
|
-
event: string;
|
|
24
|
-
properties?: Record<string, unknown> | null;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export interface AnalyticsPaths {
|
|
28
|
-
'/analytics/events': {
|
|
29
|
-
parameters: OpenApiNoParameters;
|
|
30
|
-
get?: never;
|
|
31
|
-
put?: never;
|
|
32
|
-
post: {
|
|
33
|
-
parameters: OpenApiNoParameters;
|
|
34
|
-
requestBody: {
|
|
35
|
-
content: {
|
|
36
|
-
'application/json': UiAnalyticsEventInput;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
responses: {
|
|
40
|
-
200: OpenApiJsonResponse<{
|
|
41
|
-
id: string;
|
|
42
|
-
}>;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
delete?: never;
|
|
46
|
-
options?: never;
|
|
47
|
-
head?: never;
|
|
48
|
-
patch?: never;
|
|
49
|
-
trace?: never;
|
|
50
|
-
};
|
|
51
|
-
'/analytics/events/batch': {
|
|
52
|
-
parameters: OpenApiNoParameters;
|
|
53
|
-
get?: never;
|
|
54
|
-
put?: never;
|
|
55
|
-
post: {
|
|
56
|
-
parameters: OpenApiNoParameters;
|
|
57
|
-
requestBody: {
|
|
58
|
-
content: {
|
|
59
|
-
'application/json': {
|
|
60
|
-
events: UiAnalyticsEventInput[];
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
responses: {
|
|
65
|
-
200: OpenApiJsonResponse<{
|
|
66
|
-
ids: string[];
|
|
67
|
-
total: number;
|
|
68
|
-
}>;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
delete?: never;
|
|
72
|
-
options?: never;
|
|
73
|
-
head?: never;
|
|
74
|
-
patch?: never;
|
|
75
|
-
trace?: never;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export type AnalyticsClientAuth = {
|
|
80
|
-
accessToken?: string;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export type AnalyticsClient = ReturnType<typeof createClient<AnalyticsPaths>>;
|
package/src/service-client.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import * as Sentry from '@sentry/core';
|
|
2
|
-
|
|
3
|
-
export type ServiceFetchResponse<TData = unknown, TError = unknown> = {
|
|
4
|
-
data?: TData;
|
|
5
|
-
error?: TError;
|
|
6
|
-
response: Response;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function createTraceparentHeader(sentryTrace: string | undefined) {
|
|
10
|
-
if (!sentryTrace) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const [traceId, spanId, sampled] = sentryTrace.split('-');
|
|
15
|
-
if (
|
|
16
|
-
!traceId ||
|
|
17
|
-
!spanId ||
|
|
18
|
-
traceId.length !== 32 ||
|
|
19
|
-
spanId.length !== 16 ||
|
|
20
|
-
!/^[0-9a-f]+$/i.test(traceId) ||
|
|
21
|
-
!/^[0-9a-f]+$/i.test(spanId)
|
|
22
|
-
) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return `00-${traceId}-${spanId}-${sampled === '1' ? '01' : '00'}`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function applySentryTraceHeaders(
|
|
30
|
-
headers: Headers,
|
|
31
|
-
trace: ReturnType<typeof Sentry.getTraceData>
|
|
32
|
-
) {
|
|
33
|
-
if (trace['sentry-trace']) {
|
|
34
|
-
headers.set('sentry-trace', trace['sentry-trace']);
|
|
35
|
-
const traceparent = createTraceparentHeader(trace['sentry-trace']);
|
|
36
|
-
if (traceparent) {
|
|
37
|
-
headers.set('traceparent', traceparent);
|
|
38
|
-
} else {
|
|
39
|
-
headers.delete('traceparent');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (trace.baggage) {
|
|
44
|
-
headers.set('baggage', trace.baggage);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function withSentryTrace(request: Request) {
|
|
49
|
-
applySentryTraceHeaders(request.headers, Sentry.getTraceData());
|
|
50
|
-
|
|
51
|
-
return request;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export async function throwIfServiceError<T extends ServiceFetchResponse>(
|
|
55
|
-
responsePromise: Promise<T> | T,
|
|
56
|
-
createError: (message: string) => Error,
|
|
57
|
-
defaultMessage: string,
|
|
58
|
-
options?: {
|
|
59
|
-
serviceUnavailableMessage?: string;
|
|
60
|
-
}
|
|
61
|
-
): Promise<{ data: NonNullable<T['data']>; headers: Headers }> {
|
|
62
|
-
const response = await responsePromise;
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
response.response.status === 503 &&
|
|
66
|
-
options?.serviceUnavailableMessage !== undefined
|
|
67
|
-
) {
|
|
68
|
-
throw createError(options.serviceUnavailableMessage);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const error = response.error as { message?: string } | undefined;
|
|
72
|
-
if (error) {
|
|
73
|
-
throw createError(error.message ?? defaultMessage);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
data: response.data as NonNullable<T['data']>,
|
|
78
|
-
headers: response.response.headers,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import createClient from 'openapi-fetch';
|
|
2
|
-
import {
|
|
3
|
-
type ServiceFetchResponse,
|
|
4
|
-
throwIfServiceError,
|
|
5
|
-
withSentryTrace,
|
|
6
|
-
} from '../../service-client';
|
|
7
|
-
import type { paths } from './generated/v1';
|
|
8
|
-
|
|
9
|
-
export class AnalyticsApiError extends Error {
|
|
10
|
-
constructor(message: string) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.name = 'AnalyticsApiError';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type AnalyticsApiClient = ReturnType<typeof createClient<paths>>;
|
|
17
|
-
|
|
18
|
-
export async function throwIfError<T extends ServiceFetchResponse>(
|
|
19
|
-
responsePromise: Promise<T> | T
|
|
20
|
-
): Promise<{ data: NonNullable<T['data']>; headers: Headers }> {
|
|
21
|
-
return throwIfServiceError(
|
|
22
|
-
responsePromise,
|
|
23
|
-
(message) => new AnalyticsApiError(message),
|
|
24
|
-
'Analytics request failed'
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function useAnalyticsApiClient(args: {
|
|
29
|
-
env: {
|
|
30
|
-
ANALYTICS?: Fetcher;
|
|
31
|
-
};
|
|
32
|
-
}): AnalyticsApiClient {
|
|
33
|
-
const binding = args.env.ANALYTICS;
|
|
34
|
-
if (!binding) {
|
|
35
|
-
throw new AnalyticsApiError('Analytics worker not found');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return createClient<paths>({
|
|
39
|
-
baseUrl: 'http://stub.local',
|
|
40
|
-
fetch(request) {
|
|
41
|
-
return binding.fetch(withSentryTrace(request));
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|