From 01723c955d81fd993b38327e549022b42b7b51a0 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 22 Jul 2026 16:41:10 +0000 Subject: [PATCH] ## Typescript SDK Changes: * `codatplatform.companies.list()`: `response.results[].ownerUserIds` **Added** * `codatplatform.companies.create()`: `response.ownerUserIds` **Added** * `codatplatform.companies.get()`: `response.ownerUserIds` **Added** * `codatplatform.companies.replace()`: `response.ownerUserIds` **Added** * `codatplatform.companies.update()`: `response.ownerUserIds` **Added** --- .speakeasy/workflow.lock | 12 +- platform/.speakeasy/gen.lock | 287 +++++------------- platform/.speakeasy/gen.yaml | 6 +- platform/FUNCTIONS.md | 4 +- platform/RELEASES.md | 12 +- .../models/shared/clientratelimitwebhook.md | 25 -- .../shared/clientratelimitwebhookpayload.md | 19 -- platform/docs/sdk/models/shared/company.md | 4 + .../docs/sdk/models/shared/companydetails.md | 45 --- .../docs/sdk/models/shared/companywebhook.md | 43 --- .../sdk/models/shared/connectionwebhook.md | 42 --- .../models/shared/connectionwebhookpayload.md | 35 --- .../sdk/models/shared/datatypereadsummary.md | 38 --- .../sdk/models/shared/datatypewritewebhook.md | 32 -- .../shared/datatypewritewebhookpayload.md | 32 -- .../shared/datatypewritewebhookrecord.md | 15 - platform/docs/sdk/models/shared/issue.md | 31 -- platform/docs/sdk/models/shared/issuelinks.md | 24 -- .../sdk/models/shared/readcompletedwebhook.md | 51 ---- .../shared/readcompletedwebhookpayload.md | 46 --- .../docs/sdk/models/shared/writestatus.md | 17 -- platform/docs/sdk/models/shared/writetype.md | 17 -- platform/examples/package-lock.json | 2 +- platform/jsr.json | 2 +- platform/package-lock.json | 4 +- platform/package.json | 2 +- platform/src/funcs/validateWebhook.ts | 78 ----- platform/src/hooks/hooks.ts | 3 - platform/src/hooks/types.ts | 3 +- platform/src/lib/config.ts | 6 +- platform/src/lib/dlv.ts | 53 ---- platform/src/lib/encodings.ts | 2 +- platform/src/lib/http.ts | 4 +- platform/src/lib/is-plain-object.ts | 43 --- platform/src/lib/matchers.ts | 2 +- platform/src/lib/primitives.ts | 16 + platform/src/lib/retries.ts | 8 + platform/src/lib/sdks.ts | 71 +++-- platform/src/lib/security.ts | 15 +- .../models/shared/clientratelimitwebhook.ts | 96 ------ .../shared/clientratelimitwebhookpayload.ts | 88 ------ platform/src/sdk/models/shared/company.ts | 5 + .../src/sdk/models/shared/companydetails.ts | 161 ---------- .../src/sdk/models/shared/companyreference.ts | 48 --- .../src/sdk/models/shared/companywebhook.ts | 92 ------ platform/src/sdk/models/shared/connection.ts | 48 +-- .../sdk/models/shared/connectionwebhook.ts | 96 ------ .../models/shared/connectionwebhookpayload.ts | 81 ----- .../sdk/models/shared/dataconnectionerror.ts | 33 -- .../sdk/models/shared/datatypereadsummary.ts | 98 ------ .../sdk/models/shared/datatypewritewebhook.ts | 96 ------ .../shared/datatypewritewebhookpayload.ts | 164 ---------- .../shared/datatypewritewebhookrecord.ts | 54 ---- platform/src/sdk/models/shared/index.ts | 15 - platform/src/sdk/models/shared/issue.ts | 117 ------- .../sdk/models/shared/readcompletedwebhook.ts | 96 ------ .../shared/readcompletedwebhookpayload.ts | 94 ------ platform/src/sdk/models/shared/sourcetype.ts | 3 - platform/src/sdk/models/shared/status.ts | 3 - platform/src/sdk/models/shared/writestatus.ts | 27 -- platform/src/sdk/models/shared/writetype.ts | 27 -- platform/src/sdk/sdk.ts | 26 -- platform/src/sdk/types/async.ts | 15 +- platform/src/sdk/types/index.ts | 1 - platform/src/sdk/types/webhooks.ts | 7 - 65 files changed, 215 insertions(+), 2527 deletions(-) delete mode 100644 platform/docs/sdk/models/shared/clientratelimitwebhook.md delete mode 100644 platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md delete mode 100644 platform/docs/sdk/models/shared/companydetails.md delete mode 100644 platform/docs/sdk/models/shared/companywebhook.md delete mode 100644 platform/docs/sdk/models/shared/connectionwebhook.md delete mode 100644 platform/docs/sdk/models/shared/connectionwebhookpayload.md delete mode 100644 platform/docs/sdk/models/shared/datatypereadsummary.md delete mode 100644 platform/docs/sdk/models/shared/datatypewritewebhook.md delete mode 100644 platform/docs/sdk/models/shared/datatypewritewebhookpayload.md delete mode 100644 platform/docs/sdk/models/shared/datatypewritewebhookrecord.md delete mode 100644 platform/docs/sdk/models/shared/issue.md delete mode 100644 platform/docs/sdk/models/shared/issuelinks.md delete mode 100644 platform/docs/sdk/models/shared/readcompletedwebhook.md delete mode 100644 platform/docs/sdk/models/shared/readcompletedwebhookpayload.md delete mode 100644 platform/docs/sdk/models/shared/writestatus.md delete mode 100644 platform/docs/sdk/models/shared/writetype.md delete mode 100644 platform/src/funcs/validateWebhook.ts delete mode 100644 platform/src/lib/dlv.ts delete mode 100644 platform/src/lib/is-plain-object.ts delete mode 100644 platform/src/sdk/models/shared/clientratelimitwebhook.ts delete mode 100644 platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts delete mode 100644 platform/src/sdk/models/shared/companydetails.ts delete mode 100644 platform/src/sdk/models/shared/companywebhook.ts delete mode 100644 platform/src/sdk/models/shared/connectionwebhook.ts delete mode 100644 platform/src/sdk/models/shared/connectionwebhookpayload.ts delete mode 100644 platform/src/sdk/models/shared/datatypereadsummary.ts delete mode 100644 platform/src/sdk/models/shared/datatypewritewebhook.ts delete mode 100644 platform/src/sdk/models/shared/datatypewritewebhookpayload.ts delete mode 100644 platform/src/sdk/models/shared/datatypewritewebhookrecord.ts delete mode 100644 platform/src/sdk/models/shared/issue.ts delete mode 100644 platform/src/sdk/models/shared/readcompletedwebhook.ts delete mode 100644 platform/src/sdk/models/shared/readcompletedwebhookpayload.ts delete mode 100644 platform/src/sdk/models/shared/writestatus.ts delete mode 100644 platform/src/sdk/models/shared/writetype.ts delete mode 100644 platform/src/sdk/types/webhooks.ts diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 410bf2b73..c54ac3ea8 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.761.9 +speakeasyVersion: 1.790.3 sources: bank-feeds-source: sourceNamespace: bank-feeds-source @@ -16,8 +16,8 @@ sources: - 3.0.0 platform-source: sourceNamespace: platform-source - sourceRevisionDigest: sha256:e176a344718f8e9b036c29d8cc197e5e384ee61b1fdc4894ca4e4b8ddaf643c1 - sourceBlobDigest: sha256:dbc37e7b61a982a8097e6bfaaba3b147d363cc0bd352179022b2db432b7e5c15 + sourceRevisionDigest: sha256:e8ec4f71a97b6ec2ac2f74acde6b7391999129f59ff269a16efc023d2c8951a1 + sourceBlobDigest: sha256:7933accbbdac16ddc1fe5a895b1b7130143aca77a578aa8aadfd3d17e1c5ba30 tags: - latest - 3.0.0 @@ -76,10 +76,10 @@ targets: platform-library: source: platform-source sourceNamespace: platform-source - sourceRevisionDigest: sha256:e176a344718f8e9b036c29d8cc197e5e384ee61b1fdc4894ca4e4b8ddaf643c1 - sourceBlobDigest: sha256:dbc37e7b61a982a8097e6bfaaba3b147d363cc0bd352179022b2db432b7e5c15 + sourceRevisionDigest: sha256:e8ec4f71a97b6ec2ac2f74acde6b7391999129f59ff269a16efc023d2c8951a1 + sourceBlobDigest: sha256:7933accbbdac16ddc1fe5a895b1b7130143aca77a578aa8aadfd3d17e1c5ba30 codeSamplesNamespace: platform-source-typescript-code-samples - codeSamplesRevisionDigest: sha256:c0fc3047e77de93217a1f264d3441d5886738caaacf14449b513a87c3c4f8b15 + codeSamplesRevisionDigest: sha256:f735c2439f565e3ff8907758668f60468940e8331ec47d2cf0a3c4569654f225 sync-for-commerce-library: source: sync-for-commerce-source sourceNamespace: sync-for-commerce-source diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock index cb04fa99a..ee989619c 100755 --- a/platform/.speakeasy/gen.lock +++ b/platform/.speakeasy/gen.lock @@ -1,44 +1,44 @@ lockVersion: 2.0.0 id: 6a970e30-8d0a-42f0-a8ce-621dfe880a1d management: - docChecksum: 06ba849c9ac83fe0fe9cc654586af59a + docChecksum: 0ea67fb2d3fd958231cc460d8b93f8f6 docVersion: 3.0.0 - speakeasyVersion: 1.761.9 - generationVersion: 2.881.4 - releaseVersion: 6.2.1 - configChecksum: f460c0890a9b6f2407df1de9bfe1a247 + speakeasyVersion: 1.790.3 + generationVersion: 2.918.4 + releaseVersion: 6.3.0 + configChecksum: 293b07adc69469b731886b5ac19c5c3b repoURL: https://github.com/codatio/client-sdk-typescript.git repoSubDirectory: platform installationURL: https://github.com/codatio/client-sdk-typescript published: true persistentEdits: - generation_id: 1e5c2c34-5e88-4101-ad9a-0194c9f33fae - pristine_commit_hash: 929ab8f40a3b964e741a74fda14eeb0adc7c0874 - pristine_tree_hash: 10ea2c757743203d3553b8644bca4898f993f699 + generation_id: 662adb96-f640-4b7a-bfe0-f287d377b8fd + pristine_commit_hash: 4ee5469844d4ea49a6402d3bf51fe6ca8e9bc237 + pristine_tree_hash: 7163d49ede5ff4eeddc5580a478b53e3b28c64a6 features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.14 - core: 3.26.49 + core: 3.31.4 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 - examples: 2.82.5 + examples: 2.82.6 globalSecurity: 2.82.16 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.1 globalServerURLs: 2.83.1 groups: 2.81.3 ignores: 2.81.1 + inputOutputModels: 2.82.1 methodArguments: 0.1.2 nameOverrides: 2.81.4 nullables: 0.1.1 responseFormat: 0.3.0 - retries: 2.83.0 + retries: 2.83.1 sdkHooks: 0.4.0 serverEventsSentinels: 0.1.0 - webhooks: 1.5.1 trackedFiles: .gitattributes: id: 24139dae6567 @@ -50,8 +50,8 @@ trackedFiles: pristine_git_object: 670ac0a62d7e568c9d44a14f5deafb8442a255d8 FUNCTIONS.md: id: 21b9df02aaeb - last_write_checksum: sha1:938315963767d45cd74bf194d14ac0a110dc2965 - pristine_git_object: 295b579ad6fb1e62cd81821e28650dc18cb7b8f0 + last_write_checksum: sha1:22826c767271a109f9927929d4d8affdd0f7b0fb + pristine_git_object: b43b5af740a879280763e3518ce51fae8a4d3979 RUNTIMES.md: id: 620c490847b6 last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 @@ -268,30 +268,18 @@ trackedFiles: id: 3e8c57c4fa11 last_write_checksum: sha1:03d0512fa97a0626c83f3b04f38867027e4a7d1f pristine_git_object: 25a2446de268d7538a63e1d1258d0dac34f6f96a - docs/sdk/models/shared/clientratelimitwebhook.md: - id: 2ad187176bc8 - last_write_checksum: sha1:ebd275556ea62a86059000f01bde2066499a2c18 - pristine_git_object: ef7ee9b1b2052fb4c2740bdb38cf820a60f299b8 - docs/sdk/models/shared/clientratelimitwebhookpayload.md: - id: 455bfe8fe625 - last_write_checksum: sha1:10d4238db1b064db8a30273ca84e38010c178981 - pristine_git_object: 7441544a601b2b72878200607f1d76ae32947a1e docs/sdk/models/shared/companies.md: id: d934c193ecb6 last_write_checksum: sha1:7ccac58b68a139518f5895fafb03ae49fbc59b66 pristine_git_object: 013469d05fb95d96331d239a1e8e2384695d5bfc docs/sdk/models/shared/company.md: id: fb5206b144df - last_write_checksum: sha1:f3780b6b057e19d4415c5f6ae3126516b8d3a537 - pristine_git_object: 02fcbcca268b1a4e3f2801e962e16a71cadebc4c + last_write_checksum: sha1:3734bc29034b2fdf2e84b76c6394b19cfce75138 + pristine_git_object: 00c6056fd2dbc5ebe3418b01ba6027490277a0e1 docs/sdk/models/shared/companyaccesstoken.md: id: 094c5ef713ca last_write_checksum: sha1:851d3ebb747dd553e90f64c68c7d0d16214ba791 pristine_git_object: 411ab1ac5d68d8afa2a24500dcd45f99e7cc5e09 - docs/sdk/models/shared/companydetails.md: - id: 3dc092ebb5e0 - last_write_checksum: sha1:574542307741cb0dd38c74a82f9a9dafad00ec25 - pristine_git_object: 68e95c243e87888ddbac4d1d1b48b50ce7ea4f68 docs/sdk/models/shared/companyreference.md: id: eb83cae3df56 last_write_checksum: sha1:9626066fcdc1ed3ffb8db6f78603017bd75c34f4 @@ -312,10 +300,6 @@ trackedFiles: id: cef525a660f4 last_write_checksum: sha1:441a113bc2bad87a2f8f15f14c20425bc341847c pristine_git_object: 24e3e56cfb9477f8b9c5b91befda7b5e10067c69 - docs/sdk/models/shared/companywebhook.md: - id: d93ac665d3ba - last_write_checksum: sha1:741d008a03cf95928a315d553e079b6f75e41573 - pristine_git_object: 0d565c3cbf0efa3788ae64f8ee58d45c0c170f9d docs/sdk/models/shared/connection.md: id: 1c171381dd82 last_write_checksum: sha1:a0c116fa2b5c9798d341b1d2633c10ee5a0be549 @@ -332,14 +316,6 @@ trackedFiles: id: c39072f6f8dc last_write_checksum: sha1:1935700b6a8efdd439462e1b3bb40453b2b5c8a0 pristine_git_object: e6ab70132c0200f64980a3ae47cf798651145c69 - docs/sdk/models/shared/connectionwebhook.md: - id: bdcd5563b0ad - last_write_checksum: sha1:dbdab2081ab2efac1a36e3f62f7242b14402a96c - pristine_git_object: 520672a2308fffdcd800ace2ef96078dcfa505c4 - docs/sdk/models/shared/connectionwebhookpayload.md: - id: ed86887e7a96 - last_write_checksum: sha1:4435a8c9c2e1c0f1ab8873ad9f7a5dfd56284553 - pristine_git_object: 687c1c7ce8aa04241e53ef91c6613d368e85f81c docs/sdk/models/shared/content.md: id: 639d69d2341a last_write_checksum: sha1:9f01abb46a4f113614db0c4d8887b407bdc7508d @@ -388,26 +364,10 @@ trackedFiles: id: b7f230c48a58 last_write_checksum: sha1:a20ca632329813508051576666d8d2c9334360e6 pristine_git_object: 36ab7bf33b29fa315e26530b1b6568741ea776f1 - docs/sdk/models/shared/datatypereadsummary.md: - id: 5cdac300f1b0 - last_write_checksum: sha1:c3774e2ef3de8bda886948cc87b3f1853e426b30 - pristine_git_object: 80c8f08770566927d870afb5b6199953d0bc23c1 docs/sdk/models/shared/datatypes.md: id: 673024637a09 last_write_checksum: sha1:9941d0049e2a35613eb091ef904f370ffe017056 pristine_git_object: 02ef4d2029c2f9b632266369f2f2430b0f6f4e33 - docs/sdk/models/shared/datatypewritewebhook.md: - id: d180d7dc0fab - last_write_checksum: sha1:1f37bc604a5593cfd800185c1c8b68249e23c293 - pristine_git_object: 917940babe3a09ebae52c005c89981dccb19d9fe - docs/sdk/models/shared/datatypewritewebhookpayload.md: - id: 52690d53389d - last_write_checksum: sha1:246f5c9e148a42c049173dad200397cbdec78920 - pristine_git_object: e3f3be19fc845cdc1b752414e254e1078e6a8a6f - docs/sdk/models/shared/datatypewritewebhookrecord.md: - id: fb94a0fc6195 - last_write_checksum: sha1:d0a4f19d07729ec318341fa2600a8a944afb0681 - pristine_git_object: 95e308b9e96cc0eb11ae620b864214750444111a docs/sdk/models/shared/errormessage.md: id: e0c030bde2a1 last_write_checksum: sha1:1b2a3432758237f5b0b9d363e380f5f7d5b22c6e @@ -448,14 +408,6 @@ trackedFiles: id: de72eaf18510 last_write_checksum: sha1:dea9aae1f987ab2bc9ca6d0de830f02bea8e5b8e pristine_git_object: ae7d91bc8ed2e31ebd38f09fdcfeb3371b93187f - docs/sdk/models/shared/issue.md: - id: 588b36b37bcf - last_write_checksum: sha1:98725cec6e100dc55c037ab3b7173f7c4a8a16bd - pristine_git_object: 0e7948ed77b34379a1b4900f707cea98d79063a1 - docs/sdk/models/shared/issuelinks.md: - id: cfc1bca25fbe - last_write_checksum: sha1:be03245c93620c042d6e99fda03724d3e9271494 - pristine_git_object: d648c6caf114a537d94f7cf1aab9ee3fd702d393 docs/sdk/models/shared/links.md: id: fa66a5b5f260 last_write_checksum: sha1:33d2c450025f12062570c5dcd38bb3f1f904f7a6 @@ -524,14 +476,6 @@ trackedFiles: id: 10ddca1b4793 last_write_checksum: sha1:e5cc51b70173ae084f9153f94c128d126506b125 pristine_git_object: 976ca04d3b3a142d573fd4490a2a15dcd6380a43 - docs/sdk/models/shared/readcompletedwebhook.md: - id: a91e8b0fc864 - last_write_checksum: sha1:f80de9771f8a9050c770f572333937d153b18372 - pristine_git_object: cb71ac729c19a3a2d61965b2d8d55da295ef898d - docs/sdk/models/shared/readcompletedwebhookpayload.md: - id: 361b1e8834fa - last_write_checksum: sha1:aff751dff2b8d9219ff60039b222fcc4c02f3e0d - pristine_git_object: fb29e779be729bb81c57dbcc8d3ebdf1eb457b88 docs/sdk/models/shared/schemadatatype.md: id: f1b5bb65132f last_write_checksum: sha1:156d97e699ef61cbc015aba9c37f6e57e5f2f4be @@ -600,14 +544,6 @@ trackedFiles: id: ef422dd75135 last_write_checksum: sha1:b13b969dce035fcd12f4dea2e63c2cd81c0bc6c0 pristine_git_object: 55769a98692d5fbf9075ac7aff8f2e72f47aa60d - docs/sdk/models/shared/writestatus.md: - id: d3e63098fe46 - last_write_checksum: sha1:2fe60dd8faa9ccaeca2bbdbde4e2ede7135b4e18 - pristine_git_object: df9cbc79764e9223bc4a251ff0aca56bf41d4c2f - docs/sdk/models/shared/writetype.md: - id: 1c5eac249c35 - last_write_checksum: sha1:7c0585f0f4000d80981b257a32eb8501d4441d46 - pristine_git_object: 0a3c6740cf2a913cbd3202417095c29b3db99147 docs/sdks/companies/README.md: id: 67e8a49afa67 last_write_checksum: sha1:35ad7d67eac9e0640780fed30e99919767d72465 @@ -678,12 +614,12 @@ trackedFiles: pristine_git_object: 5dc8c25718e9c3667d8095c7d068cbbcc4f03bf1 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:c0a5343d5c855f069d8af938762419f6cfbdb064 - pristine_git_object: a06825c1dd042d965b20e8c422817df0a0948fab + last_write_checksum: sha1:beffdeda0e18af4c9dcc62ab30009591ae570391 + pristine_git_object: f2cdc1e2b83dcd26e344b5ae033f62076e223859 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:dd497a0dc1648f13fc46570b8733e5b3e5e6cf61 - pristine_git_object: 57d35bf9d43a1017669ea1b11175b8b16d20f1d3 + last_write_checksum: sha1:89406b176f2775e44882c7d2edacd7d18d547a81 + pristine_git_object: 286fae1708c678a61beefb88153eab07e5199fc5 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:9744ded3fe595398f8cf7c12fd4f17a418f65f2f @@ -880,10 +816,6 @@ trackedFiles: id: 25d74eb1540d last_write_checksum: sha1:f9e5ad113350c8f29d09d96a0ac2d684bf4f913f pristine_git_object: 9e464a0a75de1ff12bb574a5d8eb4e1bdca5c6b0 - src/funcs/validateWebhook.ts: - id: f3ebc1bebb84 - last_write_checksum: sha1:a69b4ed9c001056dca4762f9f9208451a685ed76 - pristine_git_object: 02c1297b448f2c2779574e2372277913f93562f2 src/funcs/webhooksCreateConsumer.ts: id: d756d12323be last_write_checksum: sha1:81bc59392d140c215a9c0a30acc09f659fc6c369 @@ -898,16 +830,16 @@ trackedFiles: pristine_git_object: acad565e252f1c183be7e127528ca754e8d2d147 src/hooks/hooks.ts: id: a2463fc6f69b - last_write_checksum: sha1:9a569ea8f3177ddcdfe6cd903feaf5c2d2c36a9a - pristine_git_object: d34c88497fb1cfb22a725e52b4c218f36d0b5c8e + last_write_checksum: sha1:646c1538dbffb2552af9d7516de64c339b5e96c2 + pristine_git_object: fc9b13b25900a363b2123d2bad90f541e1d5d176 src/hooks/index.ts: id: 5f2dab62b520 last_write_checksum: sha1:1a11c073a6cd792932218e1d4ed36b8567bad8ef pristine_git_object: f60ec7acd76141a71d78008c5a362eb0236d8335 src/hooks/types.ts: id: 2a02d86ec24f - last_write_checksum: sha1:a2145ca7943102b61791b4b067fb593f221349b3 - pristine_git_object: 494395f66d0a6de6f6cd8b1dc918557843158c1d + last_write_checksum: sha1:da18f72efc4b8bef7912bc70fc6166b4be2f8a95 + pristine_git_object: 5ffda46a9def49d060911f29656c75d88095bcdd src/index.ts: id: c5fb850250c7 last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 @@ -918,56 +850,48 @@ trackedFiles: pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:143e475811a58b2b47433624e49b4a4d9e6ce150 - pristine_git_object: abccc40d2aba0ae4bbccfd0f7b3ab431b19a691a - src/lib/dlv.ts: - id: b1988214835a - last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 - pristine_git_object: e81091f5e536f82739f71379b1fddc2d147c49e2 + last_write_checksum: sha1:a6fba5358d1ae3bbcb9705640d3ea2fd1b6ea6bc + pristine_git_object: 8beee996596e22baf15fd39b09cd049832da4f66 src/lib/encodings.ts: id: 3bd8ead98afd - last_write_checksum: sha1:d47614c415b37e092965c34cb668562195701004 - pristine_git_object: 2791d25bc4f7cf6eec17a65f899851e225fa3deb + last_write_checksum: sha1:50d9b187dcfc3cca8d3bbd9fe074f865d715d2b0 + pristine_git_object: dcab511b4b4d98f1e4b7dd94866e2b41c478b7f0 src/lib/files.ts: id: e5efa54fcb95 last_write_checksum: sha1:795c14026405d547bfc47012f7ad9666e530fa7f pristine_git_object: 6ca6b37d35a12448da176ee2517cc036db12c81c src/lib/http.ts: id: 63a80782d37e - last_write_checksum: sha1:797cbf16d3c7c4d62d3ba0eedb08617524938457 - pristine_git_object: 13cf1fd7894a89f727b8d2db2ad24313a94f68c7 - src/lib/is-plain-object.ts: - id: b9862591096a - last_write_checksum: sha1:df687f25a9590b6fd95d39df41a652ae3fd4e517 - pristine_git_object: 61070d3d7c7e5e95b1ed7e7ea21869eb0767db77 + last_write_checksum: sha1:a56435907625a816051aa2131d60909c59f1da27 + pristine_git_object: 6b7a6cf3e281cae246708b1aca4a27730e08fe61 src/lib/logger.ts: id: 7ee7741a02bf last_write_checksum: sha1:0ec9d3a2a34c362746b767e4f9a746c055d57a7b pristine_git_object: d181f2937d4128afbe9b0327e0f81d1fa9c877b7 src/lib/matchers.ts: id: d54b2253b719 - last_write_checksum: sha1:4775ae173392e86f356bb1ffd0d16f3c2d7b0d54 - pristine_git_object: b096d6f201a8f1b24dea405dc0cb1c75efdf4c97 + last_write_checksum: sha1:5925cc961da3dbb353edccc6597fd080a9992486 + pristine_git_object: ffdb0e03aea66f0aff1354755a5f7944f1b04ad8 src/lib/primitives.ts: id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 + last_write_checksum: sha1:fe3abb7d6b61596e346873519bcec9b2eaa61467 + pristine_git_object: 8ce65db0f7c0d6b68f5edc3ebf518121e284e954 src/lib/retries.ts: id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b + last_write_checksum: sha1:42c8f6cc4c875be236230a8c760f4f32d8c1ab68 + pristine_git_object: 21a647e1e9ae64817fcd63b5dd6bb5a51b63d225 src/lib/schemas.ts: id: deb4b531fae1 last_write_checksum: sha1:b8517a14d3043f488f44e3b10ddd6cabdd22242f pristine_git_object: dc2510e330727b01894e4d3954ea92a62c962e5d src/lib/sdks.ts: id: 8a6d91f1218d - last_write_checksum: sha1:fe94d4c4f88fbe0d549e5d0411b2aa9cfdf740eb - pristine_git_object: cef4177db76f7c16ed5e1907f58d9cc861e0fd12 + last_write_checksum: sha1:a2d6c1cb4d9ebc490a53aeb1887156e670fb3d1d + pristine_git_object: 6c0727f0e34d4c400f64b3eeddf6de539480d533 src/lib/security.ts: id: 0502afa7922e - last_write_checksum: sha1:808e939964cd1393080c8b6428dabf33f746bae5 - pristine_git_object: 3da8e733b499dfb3c174dab84751a95ebc42324a + last_write_checksum: sha1:4aabb40980ce255074e37d88f5afbf3561165bec + pristine_git_object: b14be0e03370c19ad94fe8d66620e123a59ffbd9 src/lib/url.ts: id: b0057e24ed76 last_write_checksum: sha1:3bceadd74bf0b31adf13eb06b7531077c3e07d65 @@ -1212,34 +1136,22 @@ trackedFiles: id: 1a42433a17a0 last_write_checksum: sha1:60b9d50fb4ff59f938f794ff55992ec92a40dc10 pristine_git_object: 1a8fe7ee8b76eb34824148b67e2d799589cd01ad - src/sdk/models/shared/clientratelimitwebhook.ts: - id: c691f6d7f890 - last_write_checksum: sha1:873cdc12f8278470e382ae879c4bb2eb17f7f029 - pristine_git_object: cdc40c0b87eb15c3725596b713a38dec90aa9083 - src/sdk/models/shared/clientratelimitwebhookpayload.ts: - id: d068d62c8d39 - last_write_checksum: sha1:e9a21951c06c14ff5a39fd7379cd1c3bafc314d1 - pristine_git_object: 72605d6242434c3e2be999f0006634d5a193e129 src/sdk/models/shared/companies.ts: id: a4b81f9ba7c8 last_write_checksum: sha1:81432b885d166aad72ebfcdf5b25eb9c822545b4 pristine_git_object: 0f308542ebb67c7b1d3262721bbe236d1176ef3c src/sdk/models/shared/company.ts: id: 8f41ac6a5b4f - last_write_checksum: sha1:db581f1815189c40f98da9b60de6d329bd07a873 - pristine_git_object: e48fca2fb2e59ab159cb06516f76996ed74f595b + last_write_checksum: sha1:004de6f1a64d03feff406a133b860136e59fc7af + pristine_git_object: d9f6cf298d9aad46eac10b02c2955cdf01c46dc2 src/sdk/models/shared/companyaccesstoken.ts: id: de9d8c6237e5 last_write_checksum: sha1:8bbef263606dc3c3a1981ba4f21ffc2d9bb74ae6 pristine_git_object: 456b2749690603ad7beb11af880bbc444140633c - src/sdk/models/shared/companydetails.ts: - id: 9ecf68722fba - last_write_checksum: sha1:4936e5767c2c315a3f7fec2ef05d2c6341d9d337 - pristine_git_object: bf84c6f436b420bab17f2faa8b5773f191dd499d src/sdk/models/shared/companyreference.ts: id: f80ee466bdc7 - last_write_checksum: sha1:a13593197e2c55252dac28abfd5493a76a400e5b - pristine_git_object: e40af5e267211b26d0d3b0296484b7450c485126 + last_write_checksum: sha1:18f872a5210839d73dd540c541ef0b29609d6197 + pristine_git_object: 403e37ef74b8b1d3bff9075c509287ed96f84752 src/sdk/models/shared/companyrequestbody.ts: id: 9e2dd8b2247d last_write_checksum: sha1:a3027f00426e9affb8b7f8d930db63b89c197607 @@ -1252,14 +1164,10 @@ trackedFiles: id: 9a4400207ec8 last_write_checksum: sha1:371f7f83676f4130f9885c506c8184c53e202390 pristine_git_object: 442b7a78cb3fde01477e7bb5cec5626c06a9a58b - src/sdk/models/shared/companywebhook.ts: - id: 84c27c4ca6e6 - last_write_checksum: sha1:f7e6934a9c94099f4685cbe340bddba898600baf - pristine_git_object: 08dcc2eeb592e8c7c8dfd56e30f93d6658be6831 src/sdk/models/shared/connection.ts: id: 18ea99cdadfb - last_write_checksum: sha1:e4da7791a747d34add6b5844b576e92887f7b2b1 - pristine_git_object: d0a2d40ab34a0cf002030b3262868565d0440ccb + last_write_checksum: sha1:31ca568d8f022fbf138d12a46260ee2bb755b4d9 + pristine_git_object: 212086d2eaba2bd89ab772f06bdf9440c3227265 src/sdk/models/shared/connectionmanagementaccesstoken.ts: id: 3523a921aaf9 last_write_checksum: sha1:4e7936ea1723de05717404632eba593a3e1c2c20 @@ -1272,14 +1180,6 @@ trackedFiles: id: 221acd1ae99a last_write_checksum: sha1:ef2d949a3163430d3095303bf231c18b7dc93c9c pristine_git_object: 1278d54c36183c06f6113dd14c25f115be7a6465 - src/sdk/models/shared/connectionwebhook.ts: - id: fea4929e3c54 - last_write_checksum: sha1:40e294cc6743aeabcb6faddc1fa2a8f93ba31b0b - pristine_git_object: e44a554396cd23fbfcec0f3f54235b7a55e0a864 - src/sdk/models/shared/connectionwebhookpayload.ts: - id: eb3ffbfb1804 - last_write_checksum: sha1:46e08960b22539759c63d2803d9a4ff55ad7d0ee - pristine_git_object: 58b5ad4a22c28a833661ddab016b3436987ce5ef src/sdk/models/shared/createapikey.ts: id: 34ab87e02e3a last_write_checksum: sha1:e71549b28f56f6fef30af12bd405a101a50fb183 @@ -1298,8 +1198,8 @@ trackedFiles: pristine_git_object: df5741d181d8e817ede8f6252576042c83626902 src/sdk/models/shared/dataconnectionerror.ts: id: c94cddffcec9 - last_write_checksum: sha1:3b20f4e77cd912194221f095626d86c19330de38 - pristine_git_object: 90c1570e915435a100436d5686ba256cfab51f25 + last_write_checksum: sha1:e968b9983e395410ddd93aa9967671e46066eae2 + pristine_git_object: 1cb816d0f2b87e31e36ad1ece98b6f25bcdb148b src/sdk/models/shared/dataconnectionstatus.ts: id: 506ff77d012f last_write_checksum: sha1:6ab2241aa8830aafaeb937d48e97918a68b9dac7 @@ -1320,22 +1220,6 @@ trackedFiles: id: 8cb05182908f last_write_checksum: sha1:4c414a6c4e2cc0d3fe24d9ee74bf71ff0ae07dbc pristine_git_object: 34f56f1d68cfdc28adc30cef7b5e1339e49ce743 - src/sdk/models/shared/datatypereadsummary.ts: - id: 7c5a43ff74bb - last_write_checksum: sha1:8293d150875c1575208a3480bc37ced9406a9dc5 - pristine_git_object: d7e90ce7fbc7c5421e24123790064d234a9e115d - src/sdk/models/shared/datatypewritewebhook.ts: - id: f0b58d6a5be4 - last_write_checksum: sha1:ccc8b7535f7e25acf389e631ac8bab0e27d5bdf8 - pristine_git_object: e7bb1bc436bb0c5263051c02796b85cf6531fbf9 - src/sdk/models/shared/datatypewritewebhookpayload.ts: - id: d5730ae40ec2 - last_write_checksum: sha1:6e3154745247baedd7b35f9bf0d28a52665831c3 - pristine_git_object: 401fdaa3d7f0b9cdbfe88ded0b66d13400a05761 - src/sdk/models/shared/datatypewritewebhookrecord.ts: - id: 678a2d36de3d - last_write_checksum: sha1:2d408bc148c0ea510543f586edd97792e21a00ae - pristine_git_object: 9170a229da9ad7ead869f5c5a6ce7a9b89d8b5b6 src/sdk/models/shared/errormessage.ts: id: a9e0750a72b9 last_write_checksum: sha1:c0eb6aab7917336041906e6033a843e7975eae00 @@ -1366,8 +1250,8 @@ trackedFiles: pristine_git_object: e850fa584610a3ba9ca28b02fff560379872e118 src/sdk/models/shared/index.ts: id: e97e906e3c14 - last_write_checksum: sha1:9a38f102ced52fa6fdc2e870fdbeda00acc56302 - pristine_git_object: e36e825f73a93581803b1f8c7905d3b5f3ea8e26 + last_write_checksum: sha1:0e21345ae66fec734d87c23c46d9ec2cb38006f0 + pristine_git_object: 75e6f9b32c5009a5e42c6228676ffef2d7b5e178 src/sdk/models/shared/integration.ts: id: 7dddee0366e4 last_write_checksum: sha1:5eb645e9bab9d5a567a52b9ef227570a1b119f77 @@ -1376,10 +1260,6 @@ trackedFiles: id: 0118f3d420a6 last_write_checksum: sha1:89f927eccdaf516b5bea0df9c01b08fd27cafcb0 pristine_git_object: 133f44898c691be5c36629cf925a7cc39d0b38e2 - src/sdk/models/shared/issue.ts: - id: 03d66f3fd292 - last_write_checksum: sha1:37871dde943c8056008039dcbebcb75e60a6c01a - pristine_git_object: 802f59bd6209b0bb1e270518f5fb00b2ab5d3527 src/sdk/models/shared/links.ts: id: 5c9b3efadf74 last_write_checksum: sha1:453659d4b39a592c99b3b459eb9f44055f4c4195 @@ -1444,14 +1324,6 @@ trackedFiles: id: c3bac2e0d020 last_write_checksum: sha1:233611708647ac824c46a354d05fc0f3b87cdbe3 pristine_git_object: 3479adce121324a58a8bb938a974762be7f3cae0 - src/sdk/models/shared/readcompletedwebhook.ts: - id: bb5dae662057 - last_write_checksum: sha1:b420f45f8193aaab305f86a623b9f206229fe1ea - pristine_git_object: 027874fb9a13ab5afe1544d6d0e6ca8972094862 - src/sdk/models/shared/readcompletedwebhookpayload.ts: - id: c65ec8710324 - last_write_checksum: sha1:daa57d2f1566c4312fa587ae06840f60b4ead41e - pristine_git_object: 59408a5414dd84e59f06e0b9a36b4d85ea8f811b src/sdk/models/shared/schemadatatype.ts: id: 2847a75ea971 last_write_checksum: sha1:0be7e582186ba9ceafb92d67a5b15fe07bf32328 @@ -1462,12 +1334,12 @@ trackedFiles: pristine_git_object: 675eaa5827f48cff71e28d1627f8d65a74e10623 src/sdk/models/shared/sourcetype.ts: id: 522d862efe5c - last_write_checksum: sha1:56c5b8a222327b6776331951eafb7ead0f1d8ec1 - pristine_git_object: 4ff7925e44d6013880a8211f7f02ab75ba80082e + last_write_checksum: sha1:8ea960bb7133064c0c3128b6cf6369ae381d86a5 + pristine_git_object: 2dace592bc2910b642f8cbf0a55bc7615b8bf676 src/sdk/models/shared/status.ts: id: 1ab31ee187e8 - last_write_checksum: sha1:34533ee05804f1ffb0ff75d67eb7555498b9b5e5 - pristine_git_object: 17744c5740abf3e47c2e43c806c75374563baa46 + last_write_checksum: sha1:32b3b6aa4030d2fc4688dd986f9872a86a1abe46 + pristine_git_object: 7b458b0a812628f48c33f789fe66d2fedf4c2e18 src/sdk/models/shared/supplementaldataconfiguration.ts: id: 1f33c24128a4 last_write_checksum: sha1:1b052f3127437bb1f71d258505ff06229512b101 @@ -1516,14 +1388,6 @@ trackedFiles: id: 617bc356300e last_write_checksum: sha1:e07cf3b12edbf54511dafa22e1e11d7028edcd4a pristine_git_object: 33ccbcc26fc577a26b8919fbffc1cecaf6af61cd - src/sdk/models/shared/writestatus.ts: - id: e7d1d168ef5b - last_write_checksum: sha1:656e34d522241a9d4339c464c51dfd1ee1cf0454 - pristine_git_object: cc22560ab21e0a498f4e1f57ca5bae1910b8cb12 - src/sdk/models/shared/writetype.ts: - id: aa93730d7cbc - last_write_checksum: sha1:14e7d3d9b52b92ff5db9ff59d9ec388a74783474 - pristine_git_object: 3a434bc59292adea4d7f3df2d38e61bc9cc954ae src/sdk/pushdata.ts: id: f6018aed8810 last_write_checksum: sha1:841972fe8e555c6eb913442370a7508bed4c1f78 @@ -1538,8 +1402,8 @@ trackedFiles: pristine_git_object: a660ec4b29c1e3cc13c5c891bd3513ed152127a2 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:8d02e5b8c1257ec6fc64df49d45321552d047f0f - pristine_git_object: a10fea4aafefdc12e94c33a9c3f05f2a5b8a3e65 + last_write_checksum: sha1:26634ac2601100cb09ca02304826a4e921f8b57f + pristine_git_object: a5684ffc07b002aee1c7ccfe82b5eb63debf7129 src/sdk/settings.ts: id: b7e993b8acd3 last_write_checksum: sha1:3ee45176da127a85c6d49fcf0710d58a67bc48ae @@ -1550,8 +1414,8 @@ trackedFiles: pristine_git_object: 71664963ae2c2be2cb7bdf9a69182b6586dd2af3 src/sdk/types/async.ts: id: 966026768b05 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 + last_write_checksum: sha1:675d04bb4b4081dc3482f18de98674f9b446e7b4 + pristine_git_object: 1543b95cf7be9b5a871d7395f259dbd65331dc21 src/sdk/types/blobs.ts: id: 1def31341768 last_write_checksum: sha1:cf45d78916671cb6345a11c97c633c64402bc27c @@ -1570,8 +1434,8 @@ trackedFiles: pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 src/sdk/types/index.ts: id: 8c869d66c5f3 - last_write_checksum: sha1:25820e050c332015aaff5b5de2bbec51c3edd3ad - pristine_git_object: 8249564b4af12e95d783f3ad39f37f88346b6d09 + last_write_checksum: sha1:bf43b3dccb960ca9ae9c5ab940da4786255881cd + pristine_git_object: abf0b7ab8f196829df8946da40d627a46da68e3c src/sdk/types/operations.ts: id: c5e9c75d4266 last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 @@ -1588,10 +1452,6 @@ trackedFiles: id: 690d294a1973 last_write_checksum: sha1:d33ac686528492f4cdc0dbf81ed343b4afe020fe pristine_git_object: b7a2a13f3dff50663429df24ae2f55b647ff1084 - src/sdk/types/webhooks.ts: - id: 0f676e5e22a7 - last_write_checksum: sha1:dbce0cb417bcdcfcae0827fa045ee93ccab1c2c8 - pristine_git_object: 9510d20c09d8dd689f6e37254030de22e997f3cc src/sdk/webhooks.ts: id: e879e17d0532 last_write_checksum: sha1:fde07174ca3b2c7b824da03e507e349ba6eb6034 @@ -1834,7 +1694,7 @@ examples: application/json: {"name": "New Name"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -1847,7 +1707,7 @@ examples: application/json: {"name": "Same name", "description": "Additional documents required"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -1871,7 +1731,7 @@ examples: application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -1885,7 +1745,7 @@ examples: application/json: {"tags": {"refrence": "new reference"}} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -1898,7 +1758,7 @@ examples: application/json: {"name": "New Name"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -1922,7 +1782,7 @@ examples: application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "ownerUserIds": ["3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708"], "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": application/json: {} "500": @@ -3162,16 +3022,11 @@ examplesVersion: 1.0.2 generatedTests: {} releaseNotes: | ## Typescript SDK Changes: - * `codatplatform.companies.list()`: `response.results[].dataConnections[].integrationKey` **Changed** - * `codatplatform.companies.create()`: `response.dataConnections[].integrationKey` **Changed** - * `codatplatform.companies.get()`: `response.dataConnections[].integrationKey` **Changed** - * `codatplatform.companies.replace()`: `response.dataConnections[].integrationKey` **Changed** - * `codatplatform.companies.update()`: `response.dataConnections[].integrationKey` **Changed** - * `codatplatform.connections.list()`: `response.results[].integrationKey` **Changed** - * `codatplatform.connections.create()`: `response.integrationKey` **Changed** - * `codatplatform.connections.get()`: `response.integrationKey` **Changed** - * `codatplatform.connections.unlink()`: `response.integrationKey` **Changed** - * `codatplatform.connections.updateAuthorization()`: `response.integrationKey` **Changed** + * `codatplatform.companies.list()`: `response.results[].ownerUserIds` **Added** + * `codatplatform.companies.create()`: `response.ownerUserIds` **Added** + * `codatplatform.companies.get()`: `response.ownerUserIds` **Added** + * `codatplatform.companies.replace()`: `response.ownerUserIds` **Added** + * `codatplatform.companies.update()`: `response.ownerUserIds` **Added** generatedFiles: - .gitattributes - .npmignore diff --git a/platform/.speakeasy/gen.yaml b/platform/.speakeasy/gen.yaml index 47ab6a27d..0d3af3396 100644 --- a/platform/.speakeasy/gen.yaml +++ b/platform/.speakeasy/gen.yaml @@ -29,7 +29,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 6.2.1 + version: 6.3.0 acceptHeaderEnum: true additionalDependencies: dependencies: {} @@ -38,6 +38,7 @@ typescript: additionalPackageJSON: {} additionalScripts: {} alwaysIncludeInboundAndOutbound: false + apiPromiseHelpers: false author: Codat baseErrorName: CodatPlatformError clientServerStatusCodesAsErrors: true @@ -48,6 +49,7 @@ typescript: enableMCPServer: false enableReactQuery: false enumFormat: union + eventStreamClassName: EventStream exportZodModelNamespace: false fixEnumNameSanitization: false flatAdditionalProperties: false @@ -79,6 +81,8 @@ typescript: packageName: '@codat/platform' preApplyUnionDiscriminators: true preserveModelFieldNames: false + privateIdentifierPrefix: '#' + requestExtras: false responseFormat: flat sseFlatResponse: false templateVersion: v2 diff --git a/platform/FUNCTIONS.md b/platform/FUNCTIONS.md index 295b579ad..b43b5af74 100644 --- a/platform/FUNCTIONS.md +++ b/platform/FUNCTIONS.md @@ -1,11 +1,11 @@ # Standalone Functions > [!NOTE] -> This section is useful if you are using a bundler and targetting browsers and +> This section is useful if you are using a bundler and targeting browsers and > runtimes where the size of an application affects performance and load times. Every method in this SDK is also available as a standalone function. This -alternative API is suitable when targetting the browser or serverless runtimes +alternative API is suitable when targeting the browser or serverless runtimes and using a bundler to build your application since all unused functionality will be tree-shaken away. This includes code for unused methods, Zod schemas, encoding helpers and response handlers. The result is dramatically smaller diff --git a/platform/RELEASES.md b/platform/RELEASES.md index 197a72368..832b2edb7 100644 --- a/platform/RELEASES.md +++ b/platform/RELEASES.md @@ -234,4 +234,14 @@ Based on: ### Generated - [typescript v6.2.1] platform ### Releases -- [NPM v6.2.1] https://www.npmjs.com/package/@codat/platform/v/6.2.1 - platform \ No newline at end of file +- [NPM v6.2.1] https://www.npmjs.com/package/@codat/platform/v/6.2.1 - platform + +## 2026-07-22 16:40:21 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.790.3 (2.918.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v6.3.0] platform +### Releases +- [NPM v6.3.0] https://www.npmjs.com/package/@codat/platform/v/6.3.0 - platform \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/clientratelimitwebhook.md b/platform/docs/sdk/models/shared/clientratelimitwebhook.md deleted file mode 100644 index ef7ee9b1b..000000000 --- a/platform/docs/sdk/models/shared/clientratelimitwebhook.md +++ /dev/null @@ -1,25 +0,0 @@ -# ClientRateLimitWebhook - -## Example Usage - -```typescript -import { ClientRateLimitWebhook } from "@codat/platform/sdk/models/shared"; - -let value: ClientRateLimitWebhook = { - id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - eventType: "client.rateLimit.reset", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - expiryDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | -| `generatedDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md b/platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md deleted file mode 100644 index 7441544a6..000000000 --- a/platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ /dev/null @@ -1,19 +0,0 @@ -# ClientRateLimitWebhookPayload - -## Example Usage - -```typescript -import { ClientRateLimitWebhookPayload } from "@codat/platform/sdk/models/shared"; - -let value: ClientRateLimitWebhookPayload = { - expiryDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | -| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `expiryDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/company.md b/platform/docs/sdk/models/shared/company.md index 02fcbcca2..00c6056fd 100644 --- a/platform/docs/sdk/models/shared/company.md +++ b/platform/docs/sdk/models/shared/company.md @@ -27,6 +27,9 @@ let value: Company = { "region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c", }, + ownerUserIds: [ + "3f1a2b4c-5d6e-7f80-91a2-b3c4d5e6f708", + ], dataConnections: [ { id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", @@ -58,6 +61,7 @@ let value: Company = { | `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | +| `ownerUserIds` | *string*[] | :heavy_minus_sign: | The IDs of the users assigned as owners of the company in the Codat Portal. Empty if the company has no owners assigned. Owners are managed in the Codat Portal and can't be set via the API. | | | `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | | `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | | `dataConnections` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companydetails.md b/platform/docs/sdk/models/shared/companydetails.md deleted file mode 100644 index 68e95c243..000000000 --- a/platform/docs/sdk/models/shared/companydetails.md +++ /dev/null @@ -1,45 +0,0 @@ -# CompanyDetails - -## Example Usage - -```typescript -import { CompanyDetails } from "@codat/platform/sdk/models/shared"; - -let value: CompanyDetails = { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - redirect: - "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", - lastSync: "2022-10-23T00:00:00Z", - created: "2022-10-23T00:00:00Z", - referenceParentCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - referenceSubsidiaryCompanies: [ - { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `redirect` | *string* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | -| `lastSync` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `created` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | -| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | -| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | -| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companywebhook.md b/platform/docs/sdk/models/shared/companywebhook.md deleted file mode 100644 index 0d565c3cb..000000000 --- a/platform/docs/sdk/models/shared/companywebhook.md +++ /dev/null @@ -1,43 +0,0 @@ -# CompanyWebhook - -## Example Usage - -```typescript -import { CompanyWebhook } from "@codat/platform/sdk/models/shared"; - -let value: CompanyWebhook = { - id: "ba29118f-5406-4e59-b05c-ba307ca38d01", - eventType: "company.created", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - redirect: - "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", - lastSync: "2022-10-23T00:00:00Z", - created: "2022-10-23T00:00:00Z", - referenceParentCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - referenceSubsidiaryCompanies: [ - { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - ], - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event | ba29118f-5406-4e59-b05c-ba307ca38d01 | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** company.created
**Example 2:** company.deleted | -| `generatedDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.CompanyDetails](../../../sdk/models/shared/companydetails.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/connectionwebhook.md b/platform/docs/sdk/models/shared/connectionwebhook.md deleted file mode 100644 index 520672a23..000000000 --- a/platform/docs/sdk/models/shared/connectionwebhook.md +++ /dev/null @@ -1,42 +0,0 @@ -# ConnectionWebhook - -## Example Usage - -```typescript -import { ConnectionWebhook } from "@codat/platform/sdk/models/shared"; - -let value: ConnectionWebhook = { - id: "ba29118f-5406-4e59-b05c-ba307ca38d01", - eventType: "connection.created", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - connection: { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** connection.created
**Example 2:** connection.connected
**Example 3:** connection.disconnected
**Example 4:** connection.reconnected
**Example 5:** connection.deleted
**Example 6:** connection.failed | -| `generatedDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.ConnectionWebhookPayload](../../../sdk/models/shared/connectionwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/connectionwebhookpayload.md b/platform/docs/sdk/models/shared/connectionwebhookpayload.md deleted file mode 100644 index 687c1c7ce..000000000 --- a/platform/docs/sdk/models/shared/connectionwebhookpayload.md +++ /dev/null @@ -1,35 +0,0 @@ -# ConnectionWebhookPayload - -## Example Usage - -```typescript -import { ConnectionWebhookPayload } from "@codat/platform/sdk/models/shared"; - -let value: ConnectionWebhookPayload = { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - connection: { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - platformName: "Basiq", - linkUrl: - "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", - status: "Linked", - lastSync: "2022-10-27T10:22:43.6464237Z", - created: "2022-10-27T09:53:29Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `connection` | [shared.Connection](../../../sdk/models/shared/connection.md) | :heavy_minus_sign: | A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source.

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). | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypereadsummary.md b/platform/docs/sdk/models/shared/datatypereadsummary.md deleted file mode 100644 index 80c8f0877..000000000 --- a/platform/docs/sdk/models/shared/datatypereadsummary.md +++ /dev/null @@ -1,38 +0,0 @@ -# DataTypeReadSummary - -## Example Usage - -```typescript -import { DataTypeReadSummary } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeReadSummary = { - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", - recordsModified: false, - issues: [ - { - type: "warning.validation", - message: - "Something doesn't look right about these accounts from Xero. You can see more information in the logs.", - links: { - logs: - "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation", - portal: - "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", - readMore: - "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation", - }, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `connectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `recordsModified` | *boolean* | :heavy_minus_sign: | `True` if records have been created, updated or deleted in Codat's cache. | false | -| `status` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_minus_sign: | The current status of the dataset. | | -| `issues` | [shared.Issue](../../../sdk/models/shared/issue.md)[] | :heavy_minus_sign: | A array of issues encountered during a data read. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypewritewebhook.md b/platform/docs/sdk/models/shared/datatypewritewebhook.md deleted file mode 100644 index 917940bab..000000000 --- a/platform/docs/sdk/models/shared/datatypewritewebhook.md +++ /dev/null @@ -1,32 +0,0 @@ -# DataTypeWriteWebhook - -## Example Usage - -```typescript -import { DataTypeWriteWebhook } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeWriteWebhook = { - id: "ba29118f-5406-4e59-b05c-ba307ca38d01", - eventType: "bills.write.successful", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnDate: "2022-10-23T00:00:00Z", - completedOnDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** bills.write.successful
**Example 2:** bills.write.unsuccessful | -| `generatedDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.DataTypeWriteWebhookPayload](../../../sdk/models/shared/datatypewritewebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypewritewebhookpayload.md b/platform/docs/sdk/models/shared/datatypewritewebhookpayload.md deleted file mode 100644 index e3f3be19f..000000000 --- a/platform/docs/sdk/models/shared/datatypewritewebhookpayload.md +++ /dev/null @@ -1,32 +0,0 @@ -# DataTypeWriteWebhookPayload - -## Example Usage - -```typescript -import { DataTypeWriteWebhookPayload } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeWriteWebhookPayload = { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnDate: "2022-10-23T00:00:00Z", - completedOnDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the write request. This is also known as the push operation ID. | | -| `type` | [shared.WriteType](../../../sdk/models/shared/writetype.md) | :heavy_minus_sign: | Type of write request. | | -| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `connectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestedOnDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `completedOnDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.WriteStatus](../../../sdk/models/shared/writestatus.md) | :heavy_minus_sign: | The current status of the write request, which is the same as the push operation status. | | -| `record` | [shared.DataTypeWriteWebhookRecord](../../../sdk/models/shared/datatypewritewebhookrecord.md) | :heavy_minus_sign: | N/A | | -| `attachmentId` | *string* | :heavy_minus_sign: | Unique identifier for the uploaded attachment, null if no attachment uploaded. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypewritewebhookrecord.md b/platform/docs/sdk/models/shared/datatypewritewebhookrecord.md deleted file mode 100644 index 95e308b9e..000000000 --- a/platform/docs/sdk/models/shared/datatypewritewebhookrecord.md +++ /dev/null @@ -1,15 +0,0 @@ -# DataTypeWriteWebhookRecord - -## Example Usage - -```typescript -import { DataTypeWriteWebhookRecord } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeWriteWebhookRecord = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/issue.md b/platform/docs/sdk/models/shared/issue.md deleted file mode 100644 index 0e7948ed7..000000000 --- a/platform/docs/sdk/models/shared/issue.md +++ /dev/null @@ -1,31 +0,0 @@ -# Issue - -Details of a problem encountered during a data read. - -## Example Usage - -```typescript -import { Issue } from "@codat/platform/sdk/models/shared"; - -let value: Issue = { - type: "warning.validation", - message: - "Something doesn't look right about these accounts from Xero. You can see more information in the logs.", - links: { - logs: - "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation", - portal: - "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", - readMore: - "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `type` | *string* | :heavy_minus_sign: | The type of issue. | warning.validation | -| `message` | *string* | :heavy_minus_sign: | A message describing the issue. | Something doesn't look right about these accounts from Xero. You can see more information in the logs. | -| `links` | [shared.IssueLinks](../../../sdk/models/shared/issuelinks.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/issuelinks.md b/platform/docs/sdk/models/shared/issuelinks.md deleted file mode 100644 index d648c6caf..000000000 --- a/platform/docs/sdk/models/shared/issuelinks.md +++ /dev/null @@ -1,24 +0,0 @@ -# IssueLinks - -## Example Usage - -```typescript -import { IssueLinks } from "@codat/platform/sdk/models/shared"; - -let value: IssueLinks = { - logs: - "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation", - portal: - "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", - readMore: - "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `logs` | *string* | :heavy_minus_sign: | A link to the validation logs, providing details on any errors or warnings encountered. | https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation | -| `portal` | *string* | :heavy_minus_sign: | A link to the company's past data read history in the Codat portal. | https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history | -| `readMore` | *string* | :heavy_minus_sign: | A link to Codat's documentation with additional information on how to troubleshoot this issue. | https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/readcompletedwebhook.md b/platform/docs/sdk/models/shared/readcompletedwebhook.md deleted file mode 100644 index cb71ac729..000000000 --- a/platform/docs/sdk/models/shared/readcompletedwebhook.md +++ /dev/null @@ -1,51 +0,0 @@ -# ReadCompletedWebhook - -## Example Usage - -```typescript -import { ReadCompletedWebhook } from "@codat/platform/sdk/models/shared"; - -let value: ReadCompletedWebhook = { - id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - modifiedFromDate: "2022-10-23T00:00:00Z", - dataTypes: [ - { - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", - recordsModified: false, - issues: [ - { - type: "warning.validation", - message: - "Something doesn't look right about these accounts from Xero. You can see more information in the logs.", - links: { - logs: - "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation", - portal: - "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", - readMore: - "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation", - }, - }, - ], - }, - ], - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | | -| `generatedDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.ReadCompletedWebhookPayload](../../../sdk/models/shared/readcompletedwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/readcompletedwebhookpayload.md b/platform/docs/sdk/models/shared/readcompletedwebhookpayload.md deleted file mode 100644 index fb29e779b..000000000 --- a/platform/docs/sdk/models/shared/readcompletedwebhookpayload.md +++ /dev/null @@ -1,46 +0,0 @@ -# ReadCompletedWebhookPayload - -## Example Usage - -```typescript -import { ReadCompletedWebhookPayload } from "@codat/platform/sdk/models/shared"; - -let value: ReadCompletedWebhookPayload = { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - modifiedFromDate: "2022-10-23T00:00:00Z", - dataTypes: [ - { - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", - recordsModified: false, - issues: [ - { - type: "warning.validation", - message: - "Something doesn't look right about these accounts from Xero. You can see more information in the logs.", - links: { - logs: - "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation", - portal: - "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", - readMore: - "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation", - }, - }, - ], - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `modifiedFromDate` | *string* | :heavy_minus_sign: | 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:

```
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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dataTypes` | [shared.DataTypeReadSummary](../../../sdk/models/shared/datatypereadsummary.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/writestatus.md b/platform/docs/sdk/models/shared/writestatus.md deleted file mode 100644 index df9cbc797..000000000 --- a/platform/docs/sdk/models/shared/writestatus.md +++ /dev/null @@ -1,17 +0,0 @@ -# WriteStatus - -The current status of the write request, which is the same as the push operation status. - -## Example Usage - -```typescript -import { WriteStatus } from "@codat/platform/sdk/models/shared"; - -let value: WriteStatus = "Pending"; -``` - -## Values - -```typescript -"Pending" | "Failed" | "Success" | "TimedOut" -``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/writetype.md b/platform/docs/sdk/models/shared/writetype.md deleted file mode 100644 index 0a3c6740c..000000000 --- a/platform/docs/sdk/models/shared/writetype.md +++ /dev/null @@ -1,17 +0,0 @@ -# WriteType - -Type of write request. - -## Example Usage - -```typescript -import { WriteType } from "@codat/platform/sdk/models/shared"; - -let value: WriteType = "UploadAttachment"; -``` - -## Values - -```typescript -"Create" | "Update" | "Delete" | "UploadAttachment" -``` \ No newline at end of file diff --git a/platform/examples/package-lock.json b/platform/examples/package-lock.json index 38652c0f6..fd2991fe2 100644 --- a/platform/examples/package-lock.json +++ b/platform/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.3.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/platform/jsr.json b/platform/jsr.json index a06825c1d..f2cdc1e2b 100644 --- a/platform/jsr.json +++ b/platform/jsr.json @@ -2,7 +2,7 @@ { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.3.0", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/platform/package-lock.json b/platform/package-lock.json index 91a379e9e..aaec51beb 100644 --- a/platform/package-lock.json +++ b/platform/package-lock.json @@ -1,12 +1,12 @@ { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.3.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/platform/package.json b/platform/package.json index 57d35bf9d..286fae170 100644 --- a/platform/package.json +++ b/platform/package.json @@ -1,6 +1,6 @@ { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.3.0", "author": "Codat", "main": "./index.js", "sideEffects": false, diff --git a/platform/src/funcs/validateWebhook.ts b/platform/src/funcs/validateWebhook.ts deleted file mode 100644 index 02c1297b4..000000000 --- a/platform/src/funcs/validateWebhook.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodatPlatformCore } from "../core.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { ERR, Result } from "../sdk/types/fp.js"; - -export async function validateWebhook(_client: CodatPlatformCore, { - request: rawRequest, -}: { - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request; -}): Promise< - Result< - | shared.CompanyWebhook - | undefined - | shared.ConnectionWebhook - | shared.ReadCompletedWebhook - | shared.DataTypeWriteWebhook - | shared.ClientRateLimitWebhook, - SDKValidationError - > -> { - const request = normalizeRequest(rawRequest); - const knownSchemas = [ - shared.companyWebhookFromJSON, - shared.companyWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.connectionWebhookFromJSON, - shared.readCompletedWebhookFromJSON, - shared.readCompletedWebhookFromJSON, - shared.dataTypeWriteWebhookFromJSON, - shared.dataTypeWriteWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - ]; - - const jsonString = await request.text(); - - for (const schema of knownSchemas) { - const ret = schema(jsonString); - if (ret.ok) { - return ret; - } - } - - return ERR( - new SDKValidationError( - "No matching schema found for the given webhook payload", - jsonString, - jsonString, - ), - ); -} - -function normalizeRequest( - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request, -): Request { - if (request instanceof Request) { - return request; - } - return new Request(request.url, request); -} diff --git a/platform/src/hooks/hooks.ts b/platform/src/hooks/hooks.ts index d34c88497..fc9b13b25 100644 --- a/platform/src/hooks/hooks.ts +++ b/platform/src/hooks/hooks.ts @@ -18,8 +18,6 @@ import { SDKInitOptions, } from "./types.js"; -import { initHooks } from "./registration.js"; - export class SDKHooks implements Hooks { sdkInitHooks: SDKInitHook[] = []; beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; @@ -47,7 +45,6 @@ export class SDKHooks implements Hooks { this.registerAfterErrorHook(hook); } } - initHooks(this); } registerSDKInitHook(hook: SDKInitHook) { diff --git a/platform/src/hooks/types.ts b/platform/src/hooks/types.ts index 494395f66..5ffda46a9 100644 --- a/platform/src/hooks/types.ts +++ b/platform/src/hooks/types.ts @@ -6,17 +6,16 @@ import { SDKOptions } from "../lib/config.js"; import { HTTPClient, RequestInput } from "../lib/http.js"; import { RetryConfig } from "../lib/retries.js"; import { SecurityState } from "../lib/security.js"; -import { WebhookRecipient } from "../sdk/types/webhooks.js"; export type HookContext = { baseURL: string | URL; operationID: string; oAuth2Scopes: string[] | null; - webhookRecipient?: WebhookRecipient; securitySource?: any | (() => Promise); retryConfig: RetryConfig; resolvedSecurity: SecurityState | null; options: SDKOptions; + timeoutMs?: number; }; export type Awaitable = T | Promise; diff --git a/platform/src/lib/config.ts b/platform/src/lib/config.ts index abccc40d2..8beee9965 100644 --- a/platform/src/lib/config.ts +++ b/platform/src/lib/config.ts @@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "3.0.0", - sdkVersion: "6.2.1", - genVersion: "2.881.4", - userAgent: "speakeasy-sdk/typescript 6.2.1 2.881.4 3.0.0 @codat/platform", + sdkVersion: "6.3.0", + genVersion: "2.918.4", + userAgent: "speakeasy-sdk/typescript 6.3.0 2.918.4 3.0.0 @codat/platform", } as const; diff --git a/platform/src/lib/dlv.ts b/platform/src/lib/dlv.ts deleted file mode 100644 index e81091f5e..000000000 --- a/platform/src/lib/dlv.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) 2024 Jason Miller (http://jasonformat.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/** - * @param obj The object to walk - * @param key The key path to walk the object with - * @param def A default value to return if the result is undefined - * - * @example - * dlv(obj, "a.b.c.d") - * @example - * dlv(object, ["a", "b", "c", "d"]) - * @example - * dlv(object, "foo.bar.baz", "Hello, default value!") - */ -export function dlv( - obj: any, - key: string | string[], - def?: T, - p?: number, - undef?: never, -): T | undefined { - key = Array.isArray(key) ? key : key.split("."); - for (p = 0; p < key.length; p++) { - const k = key[p]; - obj = k != null && obj ? obj[k] : undef; - } - return obj === undef ? def : obj; -} diff --git a/platform/src/lib/encodings.ts b/platform/src/lib/encodings.ts index 2791d25bc..dcab511b4 100644 --- a/platform/src/lib/encodings.ts +++ b/platform/src/lib/encodings.ts @@ -3,7 +3,7 @@ */ import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./is-plain-object.js"; +import { isPlainObject } from "./primitives.js"; export class EncodingError extends Error { constructor(message: string) { diff --git a/platform/src/lib/http.ts b/platform/src/lib/http.ts index 13cf1fd78..6b7a6cf3e 100644 --- a/platform/src/lib/http.ts +++ b/platform/src/lib/http.ts @@ -45,8 +45,10 @@ export class HTTPClient { private requestHooks: BeforeRequestHook[] = []; private requestErrorHooks: RequestErrorHook[] = []; private responseHooks: ResponseHook[] = []; + private options: HTTPClientOptions; - constructor(private options: HTTPClientOptions = {}) { + constructor(options: HTTPClientOptions = {}) { + this.options = options; this.fetcher = options.fetcher || DEFAULT_FETCHER; } diff --git a/platform/src/lib/is-plain-object.ts b/platform/src/lib/is-plain-object.ts deleted file mode 100644 index 61070d3d7..000000000 --- a/platform/src/lib/is-plain-object.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js - -export function isPlainObject(value: unknown): value is object { - if (typeof value !== "object" || value === null) { - return false; - } - - const prototype = Object.getPrototypeOf(value); - return ( - (prototype === null || - prototype === Object.prototype || - Object.getPrototypeOf(prototype) === null) && - !(Symbol.toStringTag in value) && - !(Symbol.iterator in value) - ); -} diff --git a/platform/src/lib/matchers.ts b/platform/src/lib/matchers.ts index b096d6f20..ffdb0e03a 100644 --- a/platform/src/lib/matchers.ts +++ b/platform/src/lib/matchers.ts @@ -6,7 +6,7 @@ import { ResponseValidationError } from "../sdk/models/errors/responsevalidation import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { ERR, OK, Result } from "../sdk/types/fp.js"; import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./is-plain-object.js"; +import { isPlainObject } from "./primitives.js"; export type Encoding = | "jsonl" diff --git a/platform/src/lib/primitives.ts b/platform/src/lib/primitives.ts index d21f1dc49..8ce65db0f 100644 --- a/platform/src/lib/primitives.ts +++ b/platform/src/lib/primitives.ts @@ -148,3 +148,19 @@ export function allRequired>( return v as ReturnType>; } + +export function isPlainObject( + value: unknown, +): value is Record { + if (value === null || typeof value !== "object") return false; + if (Object.prototype.toString.call(value) !== "[object Object]") return false; + const proto = Object.getPrototypeOf(value); + if (proto === null || proto === Object.prototype) return true; + // cross-realm plain objects (vm contexts, iframes) inherit from a + // different realm's Object.prototype, which itself has a null prototype + try { + return Object.getPrototypeOf(proto) === null; + } catch { + return false; + } +} diff --git a/platform/src/lib/retries.ts b/platform/src/lib/retries.ts index e3ce9aba7..21a647e1e 100644 --- a/platform/src/lib/retries.ts +++ b/platform/src/lib/retries.ts @@ -194,6 +194,14 @@ async function retryBackoff( } function retryIntervalFromResponse(res: Response): number { + const retryAfterMsVal = res.headers.get("retry-after-ms"); + if (retryAfterMsVal) { + const parsedMs = Number(retryAfterMsVal); + if (Number.isFinite(parsedMs) && parsedMs >= 0) { + return parsedMs; + } + } + const retryVal = res.headers.get("retry-after") || ""; if (!retryVal) { return 0; diff --git a/platform/src/lib/sdks.ts b/platform/src/lib/sdks.ts index cef4177db..6c0727f0e 100644 --- a/platform/src/lib/sdks.ts +++ b/platform/src/lib/sdks.ts @@ -23,6 +23,7 @@ import { matchContentType, } from "./http.js"; import { Logger } from "./logger.js"; +import { combineSignals } from "./primitives.js"; import { retry, RetryConfig } from "./retries.js"; import { SecurityState } from "./security.js"; @@ -128,27 +129,55 @@ export class ClientSDK { if (path) { baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; reqURL = new URL(path, baseURL); + if (!reqURL.search && baseURL.search) { + reqURL.search = baseURL.search; + } } else { reqURL = baseURL; } reqURL.hash = ""; - let finalQuery = query || ""; - - const secQuery: string[] = []; - for (const [k, v] of Object.entries(security?.queryParams || {})) { - const q = encodeForm(k, v, { charEncoding: "percent" }); - if (typeof q !== "undefined") { - secQuery.push(q); + // Appends already-encoded query pairs to a query string, replacing any + // existing pairs with the same key so later sources take precedence. + const mergeQuery = (current: string, additions: string): string => { + if (!additions) { + return current; } - } - if (secQuery.length) { - finalQuery += `&${secQuery.join("&")}`; - } + const additionKeys = new Set( + additions + .split("&") + .filter((pair) => pair !== "") + .map((pair) => pair.split("=")[0] ?? ""), + ); + const kept = current.split("&").filter((pair) => { + return pair !== "" && !additionKeys.has(pair.split("=")[0] ?? ""); + }); + return [...kept, additions].join("&"); + }; + + const encodeQueryRecord = (record: Record): string => { + return Object.entries(record) + .map(([k, v]) => { + if (v == null) { + return undefined; + } + const value = v; + return encodeForm(k, value, { + explode: Array.isArray(value), + charEncoding: "percent", + }); + }) + .filter((pair): pair is string => typeof pair !== "undefined") + .join("&"); + }; + + const finalQuery = [ + query || "", + encodeQueryRecord(security?.queryParams || {}), + ].reduce(mergeQuery, reqURL.search.slice(1)); if (finalQuery) { - const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; - reqURL.search = `?${q}`; + reqURL.search = `?${finalQuery}`; } const headers = new Headers(opHeaders); @@ -194,9 +223,8 @@ export class ClientSDK { ...options?.fetchOptions, ...options, }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; + if (!fetchOptions?.signal && conf.timeoutMs != null && conf.timeoutMs > 0) { + context.timeoutMs = conf.timeoutMs; } if (conf.body instanceof ReadableStream) { @@ -243,10 +271,19 @@ export class ClientSDK { > > { const { context, isErrorStatusCode } = options; + const timeoutMs = context.timeoutMs; return retry( async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); + const cloned = request.clone(); + let attempt = cloned; + if (timeoutMs != null && timeoutMs > 0) { + const timeoutSignal = AbortSignal.timeout(timeoutMs); + const combined = combineSignals(cloned.signal, timeoutSignal) + ?? timeoutSignal; + attempt = new Request(cloned, { signal: combined }); + } + const req = await this.#hooks.beforeRequest(context, attempt); await logRequest(this.#logger, req).catch((e) => this.#logger?.log("Failed to log request:", e) ); diff --git a/platform/src/lib/security.ts b/platform/src/lib/security.ts index 3da8e733b..b14be0e03 100644 --- a/platform/src/lib/security.ts +++ b/platform/src/lib/security.ts @@ -12,17 +12,22 @@ type OAuth2PasswordFlow = { tokenURL: string; }; -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} +export const SecurityErrorCode = { + Incomplete: "incomplete", + UnrecognisedSecurityType: "unrecognized_security_type", +} as const; +export type SecurityErrorCode = + (typeof SecurityErrorCode)[keyof typeof SecurityErrorCode]; export class SecurityError extends Error { + public code: SecurityErrorCode; + constructor( - public code: SecurityErrorCode, + code: SecurityErrorCode, message: string, ) { super(message); + this.code = code; this.name = "SecurityError"; } diff --git a/platform/src/sdk/models/shared/clientratelimitwebhook.ts b/platform/src/sdk/models/shared/clientratelimitwebhook.ts deleted file mode 100644 index cdc40c0b8..000000000 --- a/platform/src/sdk/models/shared/clientratelimitwebhook.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayload$inboundSchema, - ClientRateLimitWebhookPayload$Outbound, - ClientRateLimitWebhookPayload$outboundSchema, -} from "./clientratelimitwebhookpayload.js"; - -export type ClientRateLimitWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: 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. - */ - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload | undefined; -}; - -/** @internal */ -export const ClientRateLimitWebhook$inboundSchema: z.ZodType< - ClientRateLimitWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ClientRateLimitWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload$Outbound | undefined; -}; - -/** @internal */ -export const ClientRateLimitWebhook$outboundSchema: z.ZodType< - ClientRateLimitWebhook$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$outboundSchema.optional(), -}); - -export function clientRateLimitWebhookToJSON( - clientRateLimitWebhook: ClientRateLimitWebhook, -): string { - return JSON.stringify( - ClientRateLimitWebhook$outboundSchema.parse(clientRateLimitWebhook), - ); -} -export function clientRateLimitWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhook' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts b/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts deleted file mode 100644 index 72605d624..000000000 --- a/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ClientRateLimitWebhookPayload = { - /** - * The number of available requests per day. - */ - dailyQuota?: number | undefined; - /** - * Total number of requests remaining for your client. - */ - quotaRemaining?: number | 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. - */ - expiryDate?: string | undefined; -}; - -/** @internal */ -export const ClientRateLimitWebhookPayload$inboundSchema: z.ZodType< - ClientRateLimitWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); -/** @internal */ -export type ClientRateLimitWebhookPayload$Outbound = { - dailyQuota?: number | undefined; - quotaRemaining?: number | undefined; - expiryDate?: string | undefined; -}; - -/** @internal */ -export const ClientRateLimitWebhookPayload$outboundSchema: z.ZodType< - ClientRateLimitWebhookPayload$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhookPayload -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); - -export function clientRateLimitWebhookPayloadToJSON( - clientRateLimitWebhookPayload: ClientRateLimitWebhookPayload, -): string { - return JSON.stringify( - ClientRateLimitWebhookPayload$outboundSchema.parse( - clientRateLimitWebhookPayload, - ), - ); -} -export function clientRateLimitWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhookPayload' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/company.ts b/platform/src/sdk/models/shared/company.ts index e48fca2fb..d9f6cf298 100644 --- a/platform/src/sdk/models/shared/company.ts +++ b/platform/src/sdk/models/shared/company.ts @@ -94,6 +94,10 @@ export type Company = { * A collection of user-defined key-value pairs that store custom metadata against the company. */ tags?: { [k: string]: string } | undefined; + /** + * The IDs of the users assigned as owners of the company in the Codat Portal. Empty if the company has no owners assigned. Owners are managed in the Codat Portal and can't be set via the API. + */ + ownerUserIds?: Array | undefined; referenceParentCompany?: CompanyReference | undefined; /** * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. @@ -114,6 +118,7 @@ export const Company$inboundSchema: z.ZodType = createdByUserName: z.nullable(z.string()).optional(), products: z.array(z.string()).optional(), tags: z.record(z.string()).optional(), + ownerUserIds: z.array(z.string()).optional(), referenceParentCompany: CompanyReference$inboundSchema.optional(), referenceSubsidiaryCompanies: z.array(CompanyReference$inboundSchema) .optional(), diff --git a/platform/src/sdk/models/shared/companydetails.ts b/platform/src/sdk/models/shared/companydetails.ts deleted file mode 100644 index bf84c6f43..000000000 --- a/platform/src/sdk/models/shared/companydetails.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; - -export type CompanyDetails = { - /** - * Unique identifier for your SMB in Codat. - */ - id: string; - /** - * The name of the company - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. - */ - redirect: string; - /** - * 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 | undefined; - /** - * Name of user that created the company in Codat. - */ - createdByUserName?: string | null | undefined; - /** - * An array of products that are currently enabled for the company. - */ - products?: Array | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; - referenceParentCompany?: CompanyReference | undefined; - /** - * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. - */ - referenceSubsidiaryCompanies?: Array | undefined; -}; - -/** @internal */ -export const CompanyDetails$inboundSchema: z.ZodType< - CompanyDetails, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - name: z.string(), - description: z.string().optional(), - redirect: z.string(), - lastSync: z.string().optional(), - created: z.string().optional(), - createdByUserName: z.nullable(z.string()).optional(), - products: z.array(z.string()).optional(), - tags: z.record(z.string()).optional(), - referenceParentCompany: CompanyReference$inboundSchema.optional(), - referenceSubsidiaryCompanies: z.array(CompanyReference$inboundSchema) - .optional(), -}); -/** @internal */ -export type CompanyDetails$Outbound = { - id: string; - name: string; - description?: string | undefined; - redirect: string; - lastSync?: string | undefined; - created?: string | undefined; - createdByUserName?: string | null | undefined; - products?: Array | undefined; - tags?: { [k: string]: string } | undefined; - referenceParentCompany?: CompanyReference$Outbound | undefined; - referenceSubsidiaryCompanies?: Array | undefined; -}; - -/** @internal */ -export const CompanyDetails$outboundSchema: z.ZodType< - CompanyDetails$Outbound, - z.ZodTypeDef, - CompanyDetails -> = z.object({ - id: z.string(), - name: z.string(), - description: z.string().optional(), - redirect: z.string(), - lastSync: z.string().optional(), - created: z.string().optional(), - createdByUserName: z.nullable(z.string()).optional(), - products: z.array(z.string()).optional(), - tags: z.record(z.string()).optional(), - referenceParentCompany: CompanyReference$outboundSchema.optional(), - referenceSubsidiaryCompanies: z.array(CompanyReference$outboundSchema) - .optional(), -}); - -export function companyDetailsToJSON(companyDetails: CompanyDetails): string { - return JSON.stringify(CompanyDetails$outboundSchema.parse(companyDetails)); -} -export function companyDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyDetails' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/companyreference.ts b/platform/src/sdk/models/shared/companyreference.ts index e40af5e26..403e37ef7 100644 --- a/platform/src/sdk/models/shared/companyreference.ts +++ b/platform/src/sdk/models/shared/companyreference.ts @@ -48,27 +48,7 @@ export const CompanyReferenceLinks$inboundSchema: z.ZodType< > = z.object({ portal: z.string().optional(), }); -/** @internal */ -export type CompanyReferenceLinks$Outbound = { - portal?: string | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$outboundSchema: z.ZodType< - CompanyReferenceLinks$Outbound, - z.ZodTypeDef, - CompanyReferenceLinks -> = z.object({ - portal: z.string().optional(), -}); -export function companyReferenceLinksToJSON( - companyReferenceLinks: CompanyReferenceLinks, -): string { - return JSON.stringify( - CompanyReferenceLinks$outboundSchema.parse(companyReferenceLinks), - ); -} export function companyReferenceLinksFromJSON( jsonString: string, ): SafeParseResult { @@ -91,35 +71,7 @@ export const CompanyReference$inboundSchema: z.ZodType< links: z.lazy(() => CompanyReferenceLinks$inboundSchema).optional(), tags: z.record(z.string()).optional(), }); -/** @internal */ -export type CompanyReference$Outbound = { - id?: string | undefined; - name?: string | undefined; - description?: string | undefined; - links?: CompanyReferenceLinks$Outbound | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReference$outboundSchema: z.ZodType< - CompanyReference$Outbound, - z.ZodTypeDef, - CompanyReference -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$outboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); -export function companyReferenceToJSON( - companyReference: CompanyReference, -): string { - return JSON.stringify( - CompanyReference$outboundSchema.parse(companyReference), - ); -} export function companyReferenceFromJSON( jsonString: string, ): SafeParseResult { diff --git a/platform/src/sdk/models/shared/companywebhook.ts b/platform/src/sdk/models/shared/companywebhook.ts deleted file mode 100644 index 08dcc2eeb..000000000 --- a/platform/src/sdk/models/shared/companywebhook.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - CompanyDetails, - CompanyDetails$inboundSchema, - CompanyDetails$Outbound, - CompanyDetails$outboundSchema, -} from "./companydetails.js"; - -export type CompanyWebhook = { - /** - * Unique identifier of the event - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: 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. - */ - generatedDate?: string | undefined; - payload?: CompanyDetails | undefined; -}; - -/** @internal */ -export const CompanyWebhook$inboundSchema: z.ZodType< - CompanyWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: CompanyDetails$inboundSchema.optional(), -}); -/** @internal */ -export type CompanyWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: CompanyDetails$Outbound | undefined; -}; - -/** @internal */ -export const CompanyWebhook$outboundSchema: z.ZodType< - CompanyWebhook$Outbound, - z.ZodTypeDef, - CompanyWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: CompanyDetails$outboundSchema.optional(), -}); - -export function companyWebhookToJSON(companyWebhook: CompanyWebhook): string { - return JSON.stringify(CompanyWebhook$outboundSchema.parse(companyWebhook)); -} -export function companyWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyWebhook' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/connection.ts b/platform/src/sdk/models/shared/connection.ts index d0a2d40ab..212086d2e 100644 --- a/platform/src/sdk/models/shared/connection.ts +++ b/platform/src/sdk/models/shared/connection.ts @@ -9,19 +9,12 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DataConnectionError, DataConnectionError$inboundSchema, - DataConnectionError$Outbound, - DataConnectionError$outboundSchema, } from "./dataconnectionerror.js"; import { DataConnectionStatus, DataConnectionStatus$inboundSchema, - DataConnectionStatus$outboundSchema, } from "./dataconnectionstatus.js"; -import { - SourceType, - SourceType$inboundSchema, - SourceType$outboundSchema, -} from "./sourcetype.js"; +import { SourceType, SourceType$inboundSchema } from "./sourcetype.js"; /** * A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. @@ -138,46 +131,7 @@ export const Connection$inboundSchema: z.ZodType< .optional(), connectionInfo: z.nullable(z.record(z.any())).optional(), }); -/** @internal */ -export type Connection$Outbound = { - id: string; - integrationId: string; - integrationKey?: string | undefined; - sourceId: string; - sourceType: string; - platformName: string; - linkUrl: string; - status: string; - lastSync?: string | undefined; - created: string; - dataConnectionErrors?: Array | null | undefined; - connectionInfo?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const Connection$outboundSchema: z.ZodType< - Connection$Outbound, - z.ZodTypeDef, - Connection -> = z.object({ - id: z.string(), - integrationId: z.string(), - integrationKey: z.string().optional(), - sourceId: z.string(), - sourceType: SourceType$outboundSchema, - platformName: z.string(), - linkUrl: z.string(), - status: DataConnectionStatus$outboundSchema, - lastSync: z.string().optional(), - created: z.string(), - dataConnectionErrors: z.nullable(z.array(DataConnectionError$outboundSchema)) - .optional(), - connectionInfo: z.nullable(z.record(z.any())).optional(), -}); -export function connectionToJSON(connection: Connection): string { - return JSON.stringify(Connection$outboundSchema.parse(connection)); -} export function connectionFromJSON( jsonString: string, ): SafeParseResult { diff --git a/platform/src/sdk/models/shared/connectionwebhook.ts b/platform/src/sdk/models/shared/connectionwebhook.ts deleted file mode 100644 index e44a55439..000000000 --- a/platform/src/sdk/models/shared/connectionwebhook.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ConnectionWebhookPayload, - ConnectionWebhookPayload$inboundSchema, - ConnectionWebhookPayload$Outbound, - ConnectionWebhookPayload$outboundSchema, -} from "./connectionwebhookpayload.js"; - -export type ConnectionWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: 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. - */ - generatedDate?: string | undefined; - payload?: ConnectionWebhookPayload | undefined; -}; - -/** @internal */ -export const ConnectionWebhook$inboundSchema: z.ZodType< - ConnectionWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ConnectionWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ConnectionWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ConnectionWebhookPayload$Outbound | undefined; -}; - -/** @internal */ -export const ConnectionWebhook$outboundSchema: z.ZodType< - ConnectionWebhook$Outbound, - z.ZodTypeDef, - ConnectionWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ConnectionWebhookPayload$outboundSchema.optional(), -}); - -export function connectionWebhookToJSON( - connectionWebhook: ConnectionWebhook, -): string { - return JSON.stringify( - ConnectionWebhook$outboundSchema.parse(connectionWebhook), - ); -} -export function connectionWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ConnectionWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionWebhook' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/connectionwebhookpayload.ts b/platform/src/sdk/models/shared/connectionwebhookpayload.ts deleted file mode 100644 index 58b5ad4a2..000000000 --- a/platform/src/sdk/models/shared/connectionwebhookpayload.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; -import { - Connection, - Connection$inboundSchema, - Connection$Outbound, - Connection$outboundSchema, -} from "./connection.js"; - -export type ConnectionWebhookPayload = { - referenceCompany?: CompanyReference | undefined; - /** - * A connection represents a [company's](https://docs.codat.io/platform-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). - */ - connection?: Connection | undefined; -}; - -/** @internal */ -export const ConnectionWebhookPayload$inboundSchema: z.ZodType< - ConnectionWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - referenceCompany: CompanyReference$inboundSchema.optional(), - connection: Connection$inboundSchema.optional(), -}); -/** @internal */ -export type ConnectionWebhookPayload$Outbound = { - referenceCompany?: CompanyReference$Outbound | undefined; - connection?: Connection$Outbound | undefined; -}; - -/** @internal */ -export const ConnectionWebhookPayload$outboundSchema: z.ZodType< - ConnectionWebhookPayload$Outbound, - z.ZodTypeDef, - ConnectionWebhookPayload -> = z.object({ - referenceCompany: CompanyReference$outboundSchema.optional(), - connection: Connection$outboundSchema.optional(), -}); - -export function connectionWebhookPayloadToJSON( - connectionWebhookPayload: ConnectionWebhookPayload, -): string { - return JSON.stringify( - ConnectionWebhookPayload$outboundSchema.parse(connectionWebhookPayload), - ); -} -export function connectionWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ConnectionWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionWebhookPayload' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/dataconnectionerror.ts b/platform/src/sdk/models/shared/dataconnectionerror.ts index 90c1570e9..1cb816d0f 100644 --- a/platform/src/sdk/models/shared/dataconnectionerror.ts +++ b/platform/src/sdk/models/shared/dataconnectionerror.ts @@ -86,9 +86,6 @@ export type DataConnectionError = { /** @internal */ export const ErrorStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(ErrorStatus); -/** @internal */ -export const ErrorStatus$outboundSchema: z.ZodNativeEnum = - ErrorStatus$inboundSchema; /** @internal */ export const DataConnectionError$inboundSchema: z.ZodType< @@ -103,37 +100,7 @@ export const DataConnectionError$inboundSchema: z.ZodType< status: z.nullable(ErrorStatus$inboundSchema).optional(), resolvedOnUtc: z.string().optional(), }); -/** @internal */ -export type DataConnectionError$Outbound = { - statusCode?: string | undefined; - statusText?: string | undefined; - errorMessage?: string | undefined; - erroredOnUtc?: string | undefined; - status?: string | null | undefined; - resolvedOnUtc?: string | undefined; -}; - -/** @internal */ -export const DataConnectionError$outboundSchema: z.ZodType< - DataConnectionError$Outbound, - z.ZodTypeDef, - DataConnectionError -> = z.object({ - statusCode: z.string().optional(), - statusText: z.string().optional(), - errorMessage: z.string().optional(), - erroredOnUtc: z.string().optional(), - status: z.nullable(ErrorStatus$outboundSchema).optional(), - resolvedOnUtc: z.string().optional(), -}); -export function dataConnectionErrorToJSON( - dataConnectionError: DataConnectionError, -): string { - return JSON.stringify( - DataConnectionError$outboundSchema.parse(dataConnectionError), - ); -} export function dataConnectionErrorFromJSON( jsonString: string, ): SafeParseResult { diff --git a/platform/src/sdk/models/shared/datatypereadsummary.ts b/platform/src/sdk/models/shared/datatypereadsummary.ts deleted file mode 100644 index d7e90ce7f..000000000 --- a/platform/src/sdk/models/shared/datatypereadsummary.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - DataType, - DataType$inboundSchema, - DataType$outboundSchema, -} from "./datatype.js"; -import { - Issue, - Issue$inboundSchema, - Issue$Outbound, - Issue$outboundSchema, -} from "./issue.js"; -import { - Status, - Status$inboundSchema, - Status$outboundSchema, -} from "./status.js"; - -export type DataTypeReadSummary = { - /** - * Unique identifier for a company's data connection. - */ - connectionId?: string | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; - /** - * `True` if records have been created, updated or deleted in Codat's cache. - */ - recordsModified?: boolean | undefined; - /** - * The current status of the dataset. - */ - status?: Status | undefined; - /** - * A array of issues encountered during a data read. - */ - issues?: Array | null | undefined; -}; - -/** @internal */ -export const DataTypeReadSummary$inboundSchema: z.ZodType< - DataTypeReadSummary, - z.ZodTypeDef, - unknown -> = z.object({ - connectionId: z.string().optional(), - dataType: DataType$inboundSchema.optional(), - recordsModified: z.boolean().optional(), - status: Status$inboundSchema.optional(), - issues: z.nullable(z.array(Issue$inboundSchema)).optional(), -}); -/** @internal */ -export type DataTypeReadSummary$Outbound = { - connectionId?: string | undefined; - dataType?: string | undefined; - recordsModified?: boolean | undefined; - status?: string | undefined; - issues?: Array | null | undefined; -}; - -/** @internal */ -export const DataTypeReadSummary$outboundSchema: z.ZodType< - DataTypeReadSummary$Outbound, - z.ZodTypeDef, - DataTypeReadSummary -> = z.object({ - connectionId: z.string().optional(), - dataType: DataType$outboundSchema.optional(), - recordsModified: z.boolean().optional(), - status: Status$outboundSchema.optional(), - issues: z.nullable(z.array(Issue$outboundSchema)).optional(), -}); - -export function dataTypeReadSummaryToJSON( - dataTypeReadSummary: DataTypeReadSummary, -): string { - return JSON.stringify( - DataTypeReadSummary$outboundSchema.parse(dataTypeReadSummary), - ); -} -export function dataTypeReadSummaryFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeReadSummary$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeReadSummary' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/datatypewritewebhook.ts b/platform/src/sdk/models/shared/datatypewritewebhook.ts deleted file mode 100644 index e7bb1bc43..000000000 --- a/platform/src/sdk/models/shared/datatypewritewebhook.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - DataTypeWriteWebhookPayload, - DataTypeWriteWebhookPayload$inboundSchema, - DataTypeWriteWebhookPayload$Outbound, - DataTypeWriteWebhookPayload$outboundSchema, -} from "./datatypewritewebhookpayload.js"; - -export type DataTypeWriteWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: 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. - */ - generatedDate?: string | undefined; - payload?: DataTypeWriteWebhookPayload | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhook$inboundSchema: z.ZodType< - DataTypeWriteWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: DataTypeWriteWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type DataTypeWriteWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: DataTypeWriteWebhookPayload$Outbound | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhook$outboundSchema: z.ZodType< - DataTypeWriteWebhook$Outbound, - z.ZodTypeDef, - DataTypeWriteWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: DataTypeWriteWebhookPayload$outboundSchema.optional(), -}); - -export function dataTypeWriteWebhookToJSON( - dataTypeWriteWebhook: DataTypeWriteWebhook, -): string { - return JSON.stringify( - DataTypeWriteWebhook$outboundSchema.parse(dataTypeWriteWebhook), - ); -} -export function dataTypeWriteWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeWriteWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeWriteWebhook' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts b/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts deleted file mode 100644 index 401fdaa3d..000000000 --- a/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; -import { - DataTypeWriteWebhookRecord, - DataTypeWriteWebhookRecord$inboundSchema, - DataTypeWriteWebhookRecord$Outbound, - DataTypeWriteWebhookRecord$outboundSchema, -} from "./datatypewritewebhookrecord.js"; -import { - WriteStatus, - WriteStatus$inboundSchema, - WriteStatus$outboundSchema, -} from "./writestatus.js"; -import { - WriteType, - WriteType$inboundSchema, - WriteType$outboundSchema, -} from "./writetype.js"; - -export type DataTypeWriteWebhookPayload = { - /** - * Unique identifier of the write request. This is also known as the push operation ID. - */ - id?: string | undefined; - /** - * Type of write request. - */ - type?: WriteType | undefined; - referenceCompany?: CompanyReference | undefined; - /** - * Unique identifier for a company's data connection. - */ - connectionId?: 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. - */ - requestedOnDate?: 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. - */ - completedOnDate?: string | undefined; - /** - * The current status of the write request, which is the same as the push operation status. - */ - status?: WriteStatus | undefined; - record?: DataTypeWriteWebhookRecord | undefined; - /** - * Unique identifier for the uploaded attachment, null if no attachment uploaded. - */ - attachmentId?: string | null | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhookPayload$inboundSchema: z.ZodType< - DataTypeWriteWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - type: WriteType$inboundSchema.optional(), - referenceCompany: CompanyReference$inboundSchema.optional(), - connectionId: z.string().optional(), - requestedOnDate: z.string().optional(), - completedOnDate: z.string().optional(), - status: WriteStatus$inboundSchema.optional(), - record: DataTypeWriteWebhookRecord$inboundSchema.optional(), - attachmentId: z.nullable(z.string()).optional(), -}); -/** @internal */ -export type DataTypeWriteWebhookPayload$Outbound = { - id?: string | undefined; - type?: string | undefined; - referenceCompany?: CompanyReference$Outbound | undefined; - connectionId?: string | undefined; - requestedOnDate?: string | undefined; - completedOnDate?: string | undefined; - status?: string | undefined; - record?: DataTypeWriteWebhookRecord$Outbound | undefined; - attachmentId?: string | null | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhookPayload$outboundSchema: z.ZodType< - DataTypeWriteWebhookPayload$Outbound, - z.ZodTypeDef, - DataTypeWriteWebhookPayload -> = z.object({ - id: z.string().optional(), - type: WriteType$outboundSchema.optional(), - referenceCompany: CompanyReference$outboundSchema.optional(), - connectionId: z.string().optional(), - requestedOnDate: z.string().optional(), - completedOnDate: z.string().optional(), - status: WriteStatus$outboundSchema.optional(), - record: DataTypeWriteWebhookRecord$outboundSchema.optional(), - attachmentId: z.nullable(z.string()).optional(), -}); - -export function dataTypeWriteWebhookPayloadToJSON( - dataTypeWriteWebhookPayload: DataTypeWriteWebhookPayload, -): string { - return JSON.stringify( - DataTypeWriteWebhookPayload$outboundSchema.parse( - dataTypeWriteWebhookPayload, - ), - ); -} -export function dataTypeWriteWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeWriteWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeWriteWebhookPayload' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts b/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts deleted file mode 100644 index 9170a229d..000000000 --- a/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DataTypeWriteWebhookRecord = { - /** - * The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. - */ - id?: string | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhookRecord$inboundSchema: z.ZodType< - DataTypeWriteWebhookRecord, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type DataTypeWriteWebhookRecord$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const DataTypeWriteWebhookRecord$outboundSchema: z.ZodType< - DataTypeWriteWebhookRecord$Outbound, - z.ZodTypeDef, - DataTypeWriteWebhookRecord -> = z.object({ - id: z.string().optional(), -}); - -export function dataTypeWriteWebhookRecordToJSON( - dataTypeWriteWebhookRecord: DataTypeWriteWebhookRecord, -): string { - return JSON.stringify( - DataTypeWriteWebhookRecord$outboundSchema.parse(dataTypeWriteWebhookRecord), - ); -} -export function dataTypeWriteWebhookRecordFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeWriteWebhookRecord$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeWriteWebhookRecord' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/index.ts b/platform/src/sdk/models/shared/index.ts index e36e825f7..75e6f9b32 100644 --- a/platform/src/sdk/models/shared/index.ts +++ b/platform/src/sdk/models/shared/index.ts @@ -8,23 +8,17 @@ export * from "./branding.js"; export * from "./brandingbutton.js"; export * from "./brandingimage.js"; export * from "./brandinglogo.js"; -export * from "./clientratelimitwebhook.js"; -export * from "./clientratelimitwebhookpayload.js"; export * from "./companies.js"; export * from "./company.js"; export * from "./companyaccesstoken.js"; -export * from "./companydetails.js"; export * from "./companyreference.js"; export * from "./companyrequestbody.js"; export * from "./companysyncsettings.js"; export * from "./companyupdaterequest.js"; -export * from "./companywebhook.js"; export * from "./connection.js"; export * from "./connectionmanagementaccesstoken.js"; export * from "./connectionmanagementallowedorigins.js"; export * from "./connections.js"; -export * from "./connectionwebhook.js"; -export * from "./connectionwebhookpayload.js"; export * from "./createapikey.js"; export * from "./customdatatypeconfiguration.js"; export * from "./customdatatyperecord.js"; @@ -35,10 +29,6 @@ export * from "./datastatus.js"; export * from "./datastatuses.js"; export * from "./datatype.js"; export * from "./datatypefeature.js"; -export * from "./datatypereadsummary.js"; -export * from "./datatypewritewebhook.js"; -export * from "./datatypewritewebhookpayload.js"; -export * from "./datatypewritewebhookrecord.js"; export * from "./errormessage.js"; export * from "./errorvalidation.js"; export * from "./errorvalidationitem.js"; @@ -48,7 +38,6 @@ export * from "./halref.js"; export * from "./imagereference.js"; export * from "./integration.js"; export * from "./integrations.js"; -export * from "./issue.js"; export * from "./links.js"; export * from "./profile.js"; export * from "./pulloperation.js"; @@ -65,8 +54,6 @@ export * from "./pushoptionchoice.js"; export * from "./pushoptionproperty.js"; export * from "./pushoptiontype.js"; export * from "./pushvalidationinfo.js"; -export * from "./readcompletedwebhook.js"; -export * from "./readcompletedwebhookpayload.js"; export * from "./schemadatatype.js"; export * from "./security.js"; export * from "./sourcetype.js"; @@ -83,5 +70,3 @@ export * from "./validationresult.js"; export * from "./webhookconsumer.js"; export * from "./webhookconsumerprototype.js"; export * from "./webhookconsumers.js"; -export * from "./writestatus.js"; -export * from "./writetype.js"; diff --git a/platform/src/sdk/models/shared/issue.ts b/platform/src/sdk/models/shared/issue.ts deleted file mode 100644 index 802f59bd6..000000000 --- a/platform/src/sdk/models/shared/issue.ts +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type IssueLinks = { - /** - * A link to the validation logs, providing details on any errors or warnings encountered. - */ - logs?: string | undefined; - /** - * A link to the company's past data read history in the Codat portal. - */ - portal?: string | undefined; - /** - * A link to Codat's documentation with additional information on how to troubleshoot this issue. - */ - readMore?: string | undefined; -}; - -/** - * Details of a problem encountered during a data read. - */ -export type Issue = { - /** - * The type of issue. - */ - type?: string | undefined; - /** - * A message describing the issue. - */ - message?: string | undefined; - links?: IssueLinks | undefined; -}; - -/** @internal */ -export const IssueLinks$inboundSchema: z.ZodType< - IssueLinks, - z.ZodTypeDef, - unknown -> = z.object({ - logs: z.string().optional(), - portal: z.string().optional(), - readMore: z.string().optional(), -}); -/** @internal */ -export type IssueLinks$Outbound = { - logs?: string | undefined; - portal?: string | undefined; - readMore?: string | undefined; -}; - -/** @internal */ -export const IssueLinks$outboundSchema: z.ZodType< - IssueLinks$Outbound, - z.ZodTypeDef, - IssueLinks -> = z.object({ - logs: z.string().optional(), - portal: z.string().optional(), - readMore: z.string().optional(), -}); - -export function issueLinksToJSON(issueLinks: IssueLinks): string { - return JSON.stringify(IssueLinks$outboundSchema.parse(issueLinks)); -} -export function issueLinksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => IssueLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'IssueLinks' from JSON`, - ); -} - -/** @internal */ -export const Issue$inboundSchema: z.ZodType = z - .object({ - type: z.string().optional(), - message: z.string().optional(), - links: z.lazy(() => IssueLinks$inboundSchema).optional(), - }); -/** @internal */ -export type Issue$Outbound = { - type?: string | undefined; - message?: string | undefined; - links?: IssueLinks$Outbound | undefined; -}; - -/** @internal */ -export const Issue$outboundSchema: z.ZodType< - Issue$Outbound, - z.ZodTypeDef, - Issue -> = z.object({ - type: z.string().optional(), - message: z.string().optional(), - links: z.lazy(() => IssueLinks$outboundSchema).optional(), -}); - -export function issueToJSON(issue: Issue): string { - return JSON.stringify(Issue$outboundSchema.parse(issue)); -} -export function issueFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Issue$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Issue' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/readcompletedwebhook.ts b/platform/src/sdk/models/shared/readcompletedwebhook.ts deleted file mode 100644 index 027874fb9..000000000 --- a/platform/src/sdk/models/shared/readcompletedwebhook.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ReadCompletedWebhookPayload, - ReadCompletedWebhookPayload$inboundSchema, - ReadCompletedWebhookPayload$Outbound, - ReadCompletedWebhookPayload$outboundSchema, -} from "./readcompletedwebhookpayload.js"; - -export type ReadCompletedWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: 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. - */ - generatedDate?: string | undefined; - payload?: ReadCompletedWebhookPayload | undefined; -}; - -/** @internal */ -export const ReadCompletedWebhook$inboundSchema: z.ZodType< - ReadCompletedWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ReadCompletedWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ReadCompletedWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ReadCompletedWebhookPayload$Outbound | undefined; -}; - -/** @internal */ -export const ReadCompletedWebhook$outboundSchema: z.ZodType< - ReadCompletedWebhook$Outbound, - z.ZodTypeDef, - ReadCompletedWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ReadCompletedWebhookPayload$outboundSchema.optional(), -}); - -export function readCompletedWebhookToJSON( - readCompletedWebhook: ReadCompletedWebhook, -): string { - return JSON.stringify( - ReadCompletedWebhook$outboundSchema.parse(readCompletedWebhook), - ); -} -export function readCompletedWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReadCompletedWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReadCompletedWebhook' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts b/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts deleted file mode 100644 index 59408a541..000000000 --- a/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; -import { - DataTypeReadSummary, - DataTypeReadSummary$inboundSchema, - DataTypeReadSummary$Outbound, - DataTypeReadSummary$outboundSchema, -} from "./datatypereadsummary.js"; - -export type ReadCompletedWebhookPayload = { - referenceCompany?: CompanyReference | 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. - */ - modifiedFromDate?: string | undefined; - dataTypes?: Array | undefined; -}; - -/** @internal */ -export const ReadCompletedWebhookPayload$inboundSchema: z.ZodType< - ReadCompletedWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - referenceCompany: CompanyReference$inboundSchema.optional(), - modifiedFromDate: z.string().optional(), - dataTypes: z.array(DataTypeReadSummary$inboundSchema).optional(), -}); -/** @internal */ -export type ReadCompletedWebhookPayload$Outbound = { - referenceCompany?: CompanyReference$Outbound | undefined; - modifiedFromDate?: string | undefined; - dataTypes?: Array | undefined; -}; - -/** @internal */ -export const ReadCompletedWebhookPayload$outboundSchema: z.ZodType< - ReadCompletedWebhookPayload$Outbound, - z.ZodTypeDef, - ReadCompletedWebhookPayload -> = z.object({ - referenceCompany: CompanyReference$outboundSchema.optional(), - modifiedFromDate: z.string().optional(), - dataTypes: z.array(DataTypeReadSummary$outboundSchema).optional(), -}); - -export function readCompletedWebhookPayloadToJSON( - readCompletedWebhookPayload: ReadCompletedWebhookPayload, -): string { - return JSON.stringify( - ReadCompletedWebhookPayload$outboundSchema.parse( - readCompletedWebhookPayload, - ), - ); -} -export function readCompletedWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReadCompletedWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReadCompletedWebhookPayload' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/sourcetype.ts b/platform/src/sdk/models/shared/sourcetype.ts index 4ff7925e4..2dace592b 100644 --- a/platform/src/sdk/models/shared/sourcetype.ts +++ b/platform/src/sdk/models/shared/sourcetype.ts @@ -25,6 +25,3 @@ export type SourceType = ClosedEnum; /** @internal */ export const SourceType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(SourceType); -/** @internal */ -export const SourceType$outboundSchema: z.ZodNativeEnum = - SourceType$inboundSchema; diff --git a/platform/src/sdk/models/shared/status.ts b/platform/src/sdk/models/shared/status.ts index 17744c574..7b458b0a8 100644 --- a/platform/src/sdk/models/shared/status.ts +++ b/platform/src/sdk/models/shared/status.ts @@ -39,6 +39,3 @@ export type Status = ClosedEnum; /** @internal */ export const Status$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); -/** @internal */ -export const Status$outboundSchema: z.ZodNativeEnum = - Status$inboundSchema; diff --git a/platform/src/sdk/models/shared/writestatus.ts b/platform/src/sdk/models/shared/writestatus.ts deleted file mode 100644 index cc22560ab..000000000 --- a/platform/src/sdk/models/shared/writestatus.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * The current status of the write request, which is the same as the push operation status. - */ -export const WriteStatus = { - Pending: "Pending", - Failed: "Failed", - Success: "Success", - TimedOut: "TimedOut", -} as const; -/** - * The current status of the write request, which is the same as the push operation status. - */ -export type WriteStatus = ClosedEnum; - -/** @internal */ -export const WriteStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(WriteStatus); -/** @internal */ -export const WriteStatus$outboundSchema: z.ZodNativeEnum = - WriteStatus$inboundSchema; diff --git a/platform/src/sdk/models/shared/writetype.ts b/platform/src/sdk/models/shared/writetype.ts deleted file mode 100644 index 3a434bc59..000000000 --- a/platform/src/sdk/models/shared/writetype.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * Type of write request. - */ -export const WriteType = { - Create: "Create", - Update: "Update", - Delete: "Delete", - UploadAttachment: "UploadAttachment", -} as const; -/** - * Type of write request. - */ -export type WriteType = ClosedEnum; - -/** @internal */ -export const WriteType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(WriteType); -/** @internal */ -export const WriteType$outboundSchema: z.ZodNativeEnum = - WriteType$inboundSchema; diff --git a/platform/src/sdk/sdk.ts b/platform/src/sdk/sdk.ts index a10fea4aa..a5684ffc0 100644 --- a/platform/src/sdk/sdk.ts +++ b/platform/src/sdk/sdk.ts @@ -2,7 +2,6 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { validateWebhook } from "../funcs/validateWebhook.js"; import { ClientSDK } from "../lib/sdks.js"; import { Companies } from "./companies.js"; import { ConnectionManagement } from "./connectionmanagement.js"; @@ -10,13 +9,11 @@ import { Connections } from "./connections.js"; import { Cors } from "./cors.js"; import { CustomDataType } from "./customdatatype.js"; import { Integrations } from "./integrations.js"; -import * as shared from "./models/shared/index.js"; import { PushData } from "./pushdata.js"; import { ReadData } from "./readdata.js"; import { RefreshData } from "./refreshdata.js"; import { Settings } from "./settings.js"; import { SupplementalData } from "./supplementaldata.js"; -import { unwrapAsync } from "./types/fp.js"; import { Webhooks } from "./webhooks.js"; export class CodatPlatform extends ClientSDK { @@ -81,27 +78,4 @@ export class CodatPlatform extends ClientSDK { get customDataType(): CustomDataType { return (this._customDataType ??= new CustomDataType(this._options)); } - - async validateWebhook({ - request, - }: { - request: { - body: string; - headers: Record | Headers; - url: string; - method: string; - } | Request; - }): Promise< - | shared.CompanyWebhook - | undefined - | shared.ConnectionWebhook - | shared.ReadCompletedWebhook - | shared.DataTypeWriteWebhook - | shared.ClientRateLimitWebhook - > { - return unwrapAsync(validateWebhook( - this, - { request }, - )); - } } diff --git a/platform/src/sdk/types/async.ts b/platform/src/sdk/types/async.ts index 689dba5de..1543b95cf 100644 --- a/platform/src/sdk/types/async.ts +++ b/platform/src/sdk/types/async.ts @@ -21,16 +21,17 @@ export type APICall = export class APIPromise implements Promise { readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; + #unwrapped: Promise | null; readonly [Symbol.toStringTag] = "APIPromise"; constructor(p: [T, APICall] | Promise<[T, APICall]>) { this.#promise = p instanceof Promise ? p : Promise.resolve(p); - this.#unwrapped = - p instanceof Promise - ? this.#promise.then(([value]) => value) - : Promise.resolve(p[0]); + this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]); + } + + #getUnwrapped(): Promise { + return (this.#unwrapped ??= this.#promise.then(([value]) => value)); } then( @@ -55,11 +56,11 @@ export class APIPromise implements Promise { | null | undefined, ): Promise { - return this.#unwrapped.catch(onrejected); + return this.#getUnwrapped().catch(onrejected); } finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); + return this.#getUnwrapped().finally(onfinally); } $inspect(): Promise<[T, APICall]> { diff --git a/platform/src/sdk/types/index.ts b/platform/src/sdk/types/index.ts index 8249564b4..abf0b7ab8 100644 --- a/platform/src/sdk/types/index.ts +++ b/platform/src/sdk/types/index.ts @@ -9,4 +9,3 @@ export type { PageIterator, Paginator } from "./operations.js"; export { createPageIterator } from "./operations.js"; export { RFCDate } from "./rfcdate.js"; export * from "./unrecognized.js"; -export type { WebhookRecipient } from "./webhooks.js"; diff --git a/platform/src/sdk/types/webhooks.ts b/platform/src/sdk/types/webhooks.ts deleted file mode 100644 index 9510d20c0..000000000 --- a/platform/src/sdk/types/webhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type WebhookRecipient = { - url: string; -};