diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock deleted file mode 100755 index cb04fa99a..000000000 --- a/platform/.speakeasy/gen.lock +++ /dev/null @@ -1,3605 +0,0 @@ -lockVersion: 2.0.0 -id: 6a970e30-8d0a-42f0-a8ce-621dfe880a1d -management: - docChecksum: 06ba849c9ac83fe0fe9cc654586af59a - docVersion: 3.0.0 - speakeasyVersion: 1.761.9 - generationVersion: 2.881.4 - releaseVersion: 6.2.1 - configChecksum: f460c0890a9b6f2407df1de9bfe1a247 - 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 -features: - typescript: - additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.14 - core: 3.26.49 - defaultEnabledRetries: 0.1.0 - deprecations: 2.81.1 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.1.2 - examples: 2.82.5 - globalSecurity: 2.82.16 - globalSecurityCallbacks: 0.1.0 - globalSecurityFlattening: 0.1.1 - globalServerURLs: 2.83.1 - groups: 2.81.3 - ignores: 2.81.1 - methodArguments: 0.1.2 - nameOverrides: 2.81.4 - nullables: 0.1.1 - responseFormat: 0.3.0 - retries: 2.83.0 - sdkHooks: 0.4.0 - serverEventsSentinels: 0.1.0 - webhooks: 1.5.1 -trackedFiles: - .gitattributes: - id: 24139dae6567 - last_write_checksum: sha1:26d16d8297b104945139da8c25bd38feeaad3e25 - pristine_git_object: 113eead5093c17d43a46159132885318f281a68a - .npmignore: - id: aa70c1f807c3 - last_write_checksum: sha1:6572da81f2e7a978ec29c22c2210bf461c5897b2 - pristine_git_object: 670ac0a62d7e568c9d44a14f5deafb8442a255d8 - FUNCTIONS.md: - id: 21b9df02aaeb - last_write_checksum: sha1:938315963767d45cd74bf194d14ac0a110dc2965 - pristine_git_object: 295b579ad6fb1e62cd81821e28650dc18cb7b8f0 - RUNTIMES.md: - id: 620c490847b6 - last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 - pristine_git_object: 27731c3b5ace66bedc454ed5acbe15075aacd3dc - USAGE.md: - id: 3aed33ce6e6f - last_write_checksum: sha1:b19532df410763da1adc5ae7edb5a5b3f3db16e4 - pristine_git_object: 434db3b1e26fba453922476e77e5ed7268b24626 - docs/lib/utils/retryconfig.md: - id: 0ce9707cb848 - last_write_checksum: sha1:bc4454e196fcd219f5a78da690375a884f5ed07b - pristine_git_object: 08f95f4552349360b2c0b01802aa71ec3a55d2c2 - docs/sdk/models/errors/errormessage.md: - id: 9affd825e395 - last_write_checksum: sha1:318d952d9d4cadb0a3aa6dd266f08bad46d75b92 - pristine_git_object: f1b3b9377518ab43aa43cadef91a2d464dad8426 - docs/sdk/models/operations/addproductrequest.md: - id: 445f64158348 - last_write_checksum: sha1:c53ace7a460c3a019f30cc35508aef4cd4743577 - pristine_git_object: 7093782a3f4389fd2efbb8e10c7f3661a4518b02 - docs/sdk/models/operations/configurecustomdatatyperequest.md: - id: 3e15eb135688 - last_write_checksum: sha1:90c101d9c8dabcdefaf3c6b855a035b26960c1c4 - pristine_git_object: 3f3137f1cd4974a1957cf035b0f3c77e36aa80cd - docs/sdk/models/operations/configuresupplementaldatarequest.md: - id: f35ee6b2ccf4 - last_write_checksum: sha1:8eb14c5dc9947c6e0bbcdb5f59935ae525a6a315 - pristine_git_object: e60f8ea7b1b15dc4201edc79391eb1452438e775 - docs/sdk/models/operations/createconnectionrequest.md: - id: 43b13768fa3c - last_write_checksum: sha1:d527b50efb352f598c4d69f75231da8f37db67ed - pristine_git_object: 8869a9cc3b9776780d780de0b98c13c9c503e7e0 - docs/sdk/models/operations/createconnectionrequestbody.md: - id: cd2a86f8a996 - last_write_checksum: sha1:5bd4e0660e8683e8966a8e7a9a9ccf089a02227a - pristine_git_object: a21ed45874397071a4196affc6afc0088dc97d23 - docs/sdk/models/operations/datatype.md: - id: 2e951d0d52d9 - last_write_checksum: sha1:71dbcf466842c4f37b2c1e0ad51c363e7f822f9a - pristine_git_object: bec60751b1c7c4dedf07d6df4785adaefd044009 - docs/sdk/models/operations/deleteapikeyrequest.md: - id: 1d303683cb56 - last_write_checksum: sha1:0c862e7505c67d2d8590e5c56e5297ec6712d4c6 - pristine_git_object: 1c8d9a20a97db7fafb4619853a83cc46b9950cad - docs/sdk/models/operations/deletecompanyrequest.md: - id: 01348357e18f - last_write_checksum: sha1:6b651328480d25fe888e9ee14a3ccb443ed72ec8 - pristine_git_object: f156366c8e120394e8d95aca3158acb81ec32463 - docs/sdk/models/operations/deleteconnectionrequest.md: - id: 70fe5fee5d10 - last_write_checksum: sha1:925caee541a969276cd31ab9d3ba728bc761a245 - pristine_git_object: 9ef310cfe9bce57b98cc0d48be3c5cb85c1510c0 - docs/sdk/models/operations/deletewebhookconsumerrequest.md: - id: 7ec62156f262 - last_write_checksum: sha1:a8d86dc18ad01b308f77219519377b601bed329e - pristine_git_object: 178d2dd30281e3b73ba752328e980bbc7da8744b - docs/sdk/models/operations/getcompanyaccesstokenrequest.md: - id: 092b4607f2a4 - last_write_checksum: sha1:a94c6812c78a62abb7c6ced3cb414f4c5d911cc3 - pristine_git_object: 620ef3ef66e0c83e46fe5a42332fddfdf21f1e4d - docs/sdk/models/operations/getcompanydatastatusrequest.md: - id: 5c881282abbd - last_write_checksum: sha1:c7079f72d9f6b902dbe75c93780e07750e404625 - pristine_git_object: e9052affa459e2b76649edf9f2c9b6771b14e4e4 - docs/sdk/models/operations/getcompanypushhistoryrequest.md: - id: 7b8e1c42f3cf - last_write_checksum: sha1:66e71e875c8a260e3319c6b23ccd037b0eb78761 - pristine_git_object: 7644238a3466e3cb2b55c3c3c09c634ad60e3555 - docs/sdk/models/operations/getcompanyrequest.md: - id: cb14d531f942 - last_write_checksum: sha1:a8af03ec33e4aa82e90183eb741e101edcfd7cf2 - pristine_git_object: 641698318b879d2c241b5bd0fc21c7c6635a2289 - docs/sdk/models/operations/getcompanysyncsettingsrequest.md: - id: 5a59c39899f5 - last_write_checksum: sha1:dac54d4ffed0cc737eedc31d14bd76f517c36f6d - pristine_git_object: 4291d93bdba292c2f6fe0aa789c8eecaba0b974d - docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md: - id: bec09b9bbeb9 - last_write_checksum: sha1:ae5312ec4bd8ca597d4e44b8f465f26df9fe5b8b - pristine_git_object: cee933bca1bc9ac515e6e078def70a3a0c79e590 - docs/sdk/models/operations/getconnectionrequest.md: - id: 6545321b6497 - last_write_checksum: sha1:8ae49aa08a39c31b73c76e4aab1c9fdba44ae72c - pristine_git_object: 8cf868420f0d02b2a78c71a827e70048ea26067a - docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md: - id: 34cd225eea75 - last_write_checksum: sha1:934e9515ce0d876e8e079725b3ffc37acbc5a432 - pristine_git_object: c0d7bc4fadf444eae3b5e7f4235d48fe1ace6f64 - docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md: - id: 092e794f3f06 - last_write_checksum: sha1:97ba33ac626d9e91c3cda9e7810eb950764904a2 - pristine_git_object: 51628b94efbb64c49c0e81cde90561bae89e3cd8 - docs/sdk/models/operations/getintegrationrequest.md: - id: 1453744933b3 - last_write_checksum: sha1:f47aa9f5171efcebd1dd0444256382ffa7fca363 - pristine_git_object: d94506c861887bae0c7f7e57051adef1e0f5782e - docs/sdk/models/operations/getintegrationsbrandingrequest.md: - id: c7ad93018db8 - last_write_checksum: sha1:e8b4aeb2d45112e0d2135fa9f9e787696802b0c9 - pristine_git_object: 869ecc8642c3c7b0e9b1a0b02f0178970c378821 - docs/sdk/models/operations/getpulloperationrequest.md: - id: 6d02e8f040db - last_write_checksum: sha1:f158d96be19b03a89ed94c55b2192c0ac0e27e66 - pristine_git_object: 23baf909e4e24ce6727cd6d34f9805f6f7bbfb8c - docs/sdk/models/operations/getpushoperationrequest.md: - id: a2a83a8acbf9 - last_write_checksum: sha1:8637909089beacf0e4a15d60b1263acf257f5a87 - pristine_git_object: 1dbda6bc5bd7a745ba6d1de7133bd6be65d87771 - docs/sdk/models/operations/getreadvalidationresultsrequest.md: - id: ac9cb76d2f36 - last_write_checksum: sha1:11c4ad3c36c7822687339c055f26b6f6049a34fc - pristine_git_object: 5db180c1f3017c550c873d21e91a9afbbeaa258f - docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md: - id: d6afb894fd54 - last_write_checksum: sha1:bcf61174d5288d4f2bd2309d0a38b808c3484ff4 - pristine_git_object: eb20d89bf6effc0c35b5c1381c841bd59e39c6b0 - docs/sdk/models/operations/listcompaniesrequest.md: - id: 605dcf27a33d - last_write_checksum: sha1:f38fe179f15bb13d24e8fc06bb7ee8017f1ca0e2 - pristine_git_object: fe713e6c9f3672386761071c981b4ae2de0c90e3 - docs/sdk/models/operations/listconnectionsrequest.md: - id: 6b2aa79356a9 - last_write_checksum: sha1:57dca2a2d43c04ab8bfb50d3dd30854c4d0d4b59 - pristine_git_object: 2797ca8857b2f9ee0eaec9abb2f45c43d2efb2d4 - docs/sdk/models/operations/listcustomdatatyperecordsrequest.md: - id: c5da7d74d016 - last_write_checksum: sha1:af704174eb388a3e948594f9c49901e4815a4e96 - pristine_git_object: 8cd37e0d2378b9925ba5c0440912786564a080e9 - docs/sdk/models/operations/listintegrationsrequest.md: - id: 4dee9b567d0f - last_write_checksum: sha1:2c57b4223d77b713f34de8d2467c312bfd2f6577 - pristine_git_object: 6cd2771d6df8b28c5412ae4c845d73ffe136bc13 - docs/sdk/models/operations/listpulloperationsrequest.md: - id: d91fce013be3 - last_write_checksum: sha1:0a3adecb070097450ca28db22e18d2ff820a53a2 - pristine_git_object: f879acbb70f5a4aaea7bde4952cc54a4d821ff49 - docs/sdk/models/operations/pathparamdatatype.md: - id: c63f9e2c649a - last_write_checksum: sha1:06f343f03249d192bf6a10e51646d869a527fe28 - pristine_git_object: a5c62e402150a1b9abc5b7aac370ee098ef6b5a9 - docs/sdk/models/operations/refreshcompanydatarequest.md: - id: 37c323b9ada7 - last_write_checksum: sha1:42cf70b57cd9069982c94aaad96b732ef8b25739 - pristine_git_object: 1db236eb8ffaafb975063ccabd290f748e7e461f - docs/sdk/models/operations/refreshcustomdatatyperequest.md: - id: e33c9b85e2d3 - last_write_checksum: sha1:e238deecd3ea9208748222f68999d2e61a7a1fe9 - pristine_git_object: 64838d6792b9fa53e1fb9706f38c60d439be9ef1 - docs/sdk/models/operations/refreshdatatyperequest.md: - id: e47fb457a374 - last_write_checksum: sha1:909976b28a7b3e3054a85cec971ecfe356b2fffb - pristine_git_object: db7d287200c8c9ca75b2defdf56aafd3990dfc24 - docs/sdk/models/operations/refreshproductdatarequest.md: - id: 322d303f2a74 - last_write_checksum: sha1:4826c2cc888c595a1347668e529a0b8a74c273b7 - pristine_git_object: 8bf3e55207f3fc54e191109a5aab2a79db76e336 - docs/sdk/models/operations/refreshproductdatarequestbody.md: - id: 81750b82e318 - last_write_checksum: sha1:66a1a79b6c8a4fb7c63fb150edbd87e62cc46c3b - pristine_git_object: 6c390fd3ebbe1dc158c9eec103198a87fa451165 - docs/sdk/models/operations/removeproductrequest.md: - id: cc26325329fe - last_write_checksum: sha1:85c1a551f81f2bb351b83bd90401a68684e95560 - pristine_git_object: 33db4566d10e857a4a034f2c67d5767797480a6e - docs/sdk/models/operations/replacecompanyrequest.md: - id: 2f79da54c18c - last_write_checksum: sha1:f1d07eb73d70d73d0a69a5da59c35d4ffa80522e - pristine_git_object: 1b833476e66d646ca96faa53538bc205169c2630 - docs/sdk/models/operations/setcompanysyncsettingsrequest.md: - id: 02cb332874fd - last_write_checksum: sha1:e8607d18f95387ac94d1930d8c653466f1c121df - pristine_git_object: 4d3e26372dea03737f12b90b88f408b9b7835e6d - docs/sdk/models/operations/setcompanysyncsettingsrequestbody.md: - id: 2119449d1038 - last_write_checksum: sha1:bd723e354e8fb0bb637655a33bdc9840a9e3b000 - pristine_git_object: 8604fc1c5847ac1304ce09301138280e433e3b5b - docs/sdk/models/operations/unlinkconnectionrequest.md: - id: 9f3addbe3925 - last_write_checksum: sha1:ebb71625963dca828e6d28137daf79387933b920 - pristine_git_object: acbfdf8e90a9a6b651c0e305d0dfe8524bb5067c - docs/sdk/models/operations/updatecompanyrequest.md: - id: 6501e66b32d2 - last_write_checksum: sha1:9c6312c756a7ce23caa32eac8681519bbd858cb5 - pristine_git_object: 6e565da9e8459b8d362708433a5d1835f06a7e5a - docs/sdk/models/operations/updateconnectionauthorizationrequest.md: - id: 0012a93268eb - last_write_checksum: sha1:777b5e0d72385ff4896c0cdda96f077d47439a75 - pristine_git_object: 0cf08d05f97376d20346487ab8e1fdb764f46a1b - docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md: - id: bae25140b1c0 - last_write_checksum: sha1:b377607063f8cc37d1290bdf75290e7bb3bfb101 - pristine_git_object: 6f716e84746e9ffd6904488243f95c55a84ebe83 - docs/sdk/models/shared/apikeydetails.md: - id: c591b3679024 - last_write_checksum: sha1:2570d13b16ce267dfe8885b16325aed8e12007a2 - pristine_git_object: d99ebeb3b61dd89918d42183e7383713d73ca927 - docs/sdk/models/shared/apikeys.md: - id: b1360883844c - last_write_checksum: sha1:c1dbe102d7a406137c1099d91f975661f2ce12c6 - pristine_git_object: 689ff589d015582de8302b28894821268e78f7d2 - docs/sdk/models/shared/branding.md: - id: 3ea26472a0b3 - last_write_checksum: sha1:40180e9378502f0803b9b79e4765b2471a447b86 - pristine_git_object: 73e6a62d92ca0ba2965b4a65edd19e15966354a9 - docs/sdk/models/shared/brandingbutton.md: - id: 46b878f55555 - last_write_checksum: sha1:9518b13dccd592012fe7d135c8e2a38dbc73244e - pristine_git_object: 6ac2941c045f332b9683c3c85df007ad2d8ce6ed - docs/sdk/models/shared/brandingimage.md: - id: 2dbabfe29bd7 - last_write_checksum: sha1:2fa93d68330a76e17ea1f60fcbc2e5844e5c5aab - pristine_git_object: 27131e90c3843100e9f0b967cd4ba030f36db3de - docs/sdk/models/shared/brandinglogo.md: - 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 - 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 - pristine_git_object: dbaa750ce18b51ed406449b50c6e6c652215e235 - docs/sdk/models/shared/companyreferencelinks.md: - id: bdd0ee48a65d - last_write_checksum: sha1:d99d1208890f69ea5855194f41e073fe396824ce - pristine_git_object: e9689a8c2bfc6358a000b5fd12a967e40d467383 - docs/sdk/models/shared/companyrequestbody.md: - id: 3f3dfd0aa865 - last_write_checksum: sha1:9b5dce735ebb189ab07e4f6f2fd30ad338589c45 - pristine_git_object: d5a14f87c45783fffed56e250b82e44715ef6d75 - docs/sdk/models/shared/companysyncsettings.md: - id: 6e8f8e12b09d - last_write_checksum: sha1:5c2d31143eb0abadcb73d52aa9d1447d4d4cc30c - pristine_git_object: 39762790f300336e3f1a8786d3791f5e855dd957 - docs/sdk/models/shared/companyupdaterequest.md: - 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 - pristine_git_object: b4fb763afe063b6ac8faee90944e7d92eb07071a - docs/sdk/models/shared/connectionmanagementaccesstoken.md: - id: 234d6aa44c90 - last_write_checksum: sha1:1ec26712a46c827f8bfef96985d9dcce3404b6f4 - pristine_git_object: a9b78e98db582fd0b5332718dbbf3cc3816fd3d9 - docs/sdk/models/shared/connectionmanagementallowedorigins.md: - id: e8ca3620728f - last_write_checksum: sha1:fcb7dc7a3006b5bccdb240b97f4b4384fdac3a1f - pristine_git_object: b0d9b8c4e87729541601828bed3938d5ac92a4d5 - docs/sdk/models/shared/connections.md: - 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 - pristine_git_object: 3e7b1bfc5f3a9e9379c6f6a603781cb4d7d30e2f - docs/sdk/models/shared/createapikey.md: - id: 01063fac8ce2 - last_write_checksum: sha1:e3606133c1b5053243e91e508e3274bc9f9a0839 - pristine_git_object: c0d0681cf54a312b8c96f33dcd4f56aecaeca40b - docs/sdk/models/shared/customdatatypeconfiguration.md: - id: 3a00f216b3b5 - last_write_checksum: sha1:74f6f26426e5e1e54884b44a8388ab8a1e231d71 - pristine_git_object: 614eb3e83e2b7d26e8e6dc7343bfefc52d25a644 - docs/sdk/models/shared/customdatatyperecord.md: - id: 63a028e7008d - last_write_checksum: sha1:ef63c1b499b62ca70d2e51205aec554d69dfb360 - pristine_git_object: 83a43afdf1becc02fa60c1628d85575108e3204b - docs/sdk/models/shared/customdatatyperecords.md: - id: 06740a950e02 - last_write_checksum: sha1:c284230ae0d74c1caff3efda136c6f43ced33dfa - pristine_git_object: 931a6ae0eab05ae75a5c01907af5a78995e04718 - docs/sdk/models/shared/dataconnectionerror.md: - id: 993cf6eb3364 - last_write_checksum: sha1:8289c89e62f7aadf9097d24dbb93b54ae906719d - pristine_git_object: dd554f4eed3adb5652f74cf72cd6887b4561deea - docs/sdk/models/shared/dataconnectionstatus.md: - id: fd14e3dc6ca5 - last_write_checksum: sha1:157f827089b77cf2639a507a01066cac0bf69949 - pristine_git_object: 85c311a381eafcaeb07d06947b0607a8d3c15077 - docs/sdk/models/shared/datasetstatus.md: - id: 13ee7a38a328 - last_write_checksum: sha1:7775a66037140c3f0a0a60247c7a0e8930d102fb - pristine_git_object: 13df9de5d4d521cd30b4d8364b8e4402047a894d - docs/sdk/models/shared/datastatus.md: - id: cb4795d3f294 - last_write_checksum: sha1:5e466cbf6103fe3d4a83de916c5489c22d05e686 - pristine_git_object: 13d6b66b52f856bf02aa1f971183e8b84891ab04 - docs/sdk/models/shared/datastatuses.md: - id: ec6ac9d4f6cc - last_write_checksum: sha1:dc020ee1d4a741e82b663f10b17ded9cb62a455b - pristine_git_object: 6d1e7bb23a51d1c76d208ecd9eb93baece905d1a - docs/sdk/models/shared/datatype.md: - id: 0338d85c906d - last_write_checksum: sha1:80987fcaf2e06cf12337840bb4b9bf3db8dbd027 - pristine_git_object: 08150e774c04579ecc7fa4d309687265994d40d6 - docs/sdk/models/shared/datatypefeature.md: - 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 - pristine_git_object: cb492cfd12bde4cdf2b254822f521f32591bfc2e - docs/sdk/models/shared/errorstatus.md: - id: d836c01e48c6 - last_write_checksum: sha1:205c94b7b43cd50b079dbb11a13736997336da69 - pristine_git_object: b4c58ebaced7cae086371cca9b8cc9dba626edf9 - docs/sdk/models/shared/errorvalidation.md: - id: a1197fba13d0 - last_write_checksum: sha1:99f6c9b9c7cef6d55bb56c81b2e1f404b93f61be - pristine_git_object: 8de2da74ea7a1613bc756dd5d9e3e0ac916671f2 - docs/sdk/models/shared/errorvalidationitem.md: - id: dbec2a990008 - last_write_checksum: sha1:0312766ea0960d9896f8fadd8946f6312fa0ace2 - pristine_git_object: a777a327343f71181cb249f6fabaec32e88dd2b5 - docs/sdk/models/shared/featurestate.md: - id: eba861fb6837 - last_write_checksum: sha1:030ff9d69cddb0f84a2d69e4e8899b5090cc1857 - pristine_git_object: bed9284e972cd209297bcf0af0755063bc791c72 - docs/sdk/models/shared/featuretype.md: - id: e33f5e834736 - last_write_checksum: sha1:f07128b3ad8ee87dcb514938d143c84abd32e539 - pristine_git_object: 68ad73a8805f468afee9cc319878971bae4f5817 - docs/sdk/models/shared/halref.md: - id: 140248af964e - last_write_checksum: sha1:208df808950a3db6779bc93a8ca89e94a4da49ee - pristine_git_object: e764a29bf8fbde82ee3449529c6745844e5d4677 - docs/sdk/models/shared/imagereference.md: - id: 9adb58f7138e - last_write_checksum: sha1:21ff1b8c6f84766df32cb2dc1ce158ed9b9186eb - pristine_git_object: d1646ee8e754c73678e213a9367445f7a968cf49 - docs/sdk/models/shared/integration.md: - id: 024440ffaed0 - last_write_checksum: sha1:e34209435dc12b3cc1554e9c873af8e7382dce77 - pristine_git_object: cdf6eff3f8549c4a9f2d348b101ec9724ef5cc7b - docs/sdk/models/shared/integrations.md: - 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 - pristine_git_object: 876d190ccb96f750a200edad6cd68eedaf07c46d - docs/sdk/models/shared/modifieddate.md: - id: bc37adae01e3 - last_write_checksum: sha1:20164de03e441328ac64a71791ab43002f6eeb58 - pristine_git_object: 488e53ecf59d25c12ad667cc5ca02837c6c96d3c - docs/sdk/models/shared/profile.md: - id: f1de6c9e5064 - last_write_checksum: sha1:4907e9aefb82fb8dafd975baad1f53c2a99b1237 - pristine_git_object: 5d85ae547f5aafb2d0d067e894539dba896e6894 - docs/sdk/models/shared/pulloperation.md: - id: dcbd4e59dc15 - last_write_checksum: sha1:66a5004b05fe312c856dc38b819d779a9a441031 - pristine_git_object: f2f6a7610961133cfd5a79252704994272ac2c74 - docs/sdk/models/shared/pulloperations.md: - id: d7ead2cdeffc - last_write_checksum: sha1:3d889573fb4727717c321be61ce3c2a2f748dbe6 - pristine_git_object: 31cd22223d4730be0fdc79e49d5225f2d99f820c - docs/sdk/models/shared/pushchangetype.md: - id: 53824528b4ac - last_write_checksum: sha1:238480969a94eb31ac1635c6769420fc4b7fa694 - pristine_git_object: da6c98fa68496fa5d45b7dbdad8d64790f88973d - docs/sdk/models/shared/pushfieldvalidation.md: - id: be50fc267930 - last_write_checksum: sha1:99db395285b358699c388ae5792eb1d7b3176079 - pristine_git_object: 98172ed93966ba32ece01c1f9cd4c1f434b10f99 - docs/sdk/models/shared/pushoperation.md: - id: 862ef21ffa69 - last_write_checksum: sha1:93a02f81d83e3095a3034084934917e08787f140 - pristine_git_object: b50671be39ec7a3e0ad80f5be976afef8842a574 - docs/sdk/models/shared/pushoperationchange.md: - id: be046171d3af - last_write_checksum: sha1:63a940dba36ce6ce969b5e3cdcefe615821b3680 - pristine_git_object: 083b16dc3757be6bea8f0125a135afabbb8807d8 - docs/sdk/models/shared/pushoperationref.md: - id: 41359c8937dc - last_write_checksum: sha1:d283f5b9bf6c298661a81ee4ad5f522edead3f48 - pristine_git_object: 28e8772a89feff22bb33bda7314bdd62f4cb9d17 - docs/sdk/models/shared/pushoperations.md: - id: 7efd8c6374e2 - last_write_checksum: sha1:5436afdc5c5f43a162b9c6207648a4a98b4b2ab5 - pristine_git_object: b9c08aa7fed9f96dfe1d0ce743a1ed0046735df8 - docs/sdk/models/shared/pushoperationstatus.md: - id: c01cab5bc311 - last_write_checksum: sha1:8efd91f5e27739181e21cd4c5672207a9b1eecef - pristine_git_object: c75d37cdeff10f706f5d93685e4f7f68f3089ce6 - docs/sdk/models/shared/pushoption.md: - id: 28a9b11a0d39 - last_write_checksum: sha1:b6461f89ab78096c1171e023bafa3090dba4409e - pristine_git_object: a91aa10320b8b6fcafe01b8853bc26bf43d4fcd8 - docs/sdk/models/shared/pushoptionchoice.md: - id: 3dc25ab7bea6 - last_write_checksum: sha1:243a758370a36bd4d728dbe66a2a07a6b7601a7e - pristine_git_object: 4240342e831d5b30cdbde288f09b5862dc514d5c - docs/sdk/models/shared/pushoptionproperty.md: - id: 06f73d448642 - last_write_checksum: sha1:67797dfbffe1f840eebdb75020e4fec42890aa7f - pristine_git_object: 220725e19c90619e803cfad895be5bb23d0a64ec - docs/sdk/models/shared/pushoptiontype.md: - id: cc1fc9e23267 - last_write_checksum: sha1:3bed5b66260860709143d814815700a385263d87 - pristine_git_object: f96bd53eaa406a73bd3bc4933d6615bb870c232b - docs/sdk/models/shared/pushvalidationinfo.md: - 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 - pristine_git_object: 54ebf76d23669cd6ac17c928ac34d128a3b9ce3d - docs/sdk/models/shared/security.md: - id: 972729c50a07 - last_write_checksum: sha1:356159109a395a1daae36128b407a7373522fc3d - pristine_git_object: 570497a1fc4290d4510fb4a5bf627186fb65d267 - docs/sdk/models/shared/sourcetype.md: - id: 3ec91bdaf5e7 - last_write_checksum: sha1:9866e22a38a480017ba801015ab19c1133d2428e - pristine_git_object: 8ec02b1fdb471dc90f9cc6ce374aacb6cf0a4deb - docs/sdk/models/shared/status.md: - id: d40dc096aca1 - last_write_checksum: sha1:f59a86180e429186a65b21b656bfabf8599d2c1b - pristine_git_object: 7a98b6153c2c0f1923c99528f2ecf80c340ec9a9 - docs/sdk/models/shared/supplementaldataconfiguration.md: - id: a2be088fae1f - last_write_checksum: sha1:08b565c03dc49c9a9d56f3d74b0c0d4feecee733 - pristine_git_object: 8abb9c9fdbc8f5b6fcee3d53f7f2809a27ea5263 - docs/sdk/models/shared/supplementaldatasourceconfiguration.md: - id: fb61fe0736b5 - last_write_checksum: sha1:59e93ccdeb1b2c661bda16577a03956764a25804 - pristine_git_object: 0fc38e7d6857fc4b855b0e04a7fa825486538981 - docs/sdk/models/shared/supportedfeature.md: - id: 80b81ff8d229 - last_write_checksum: sha1:6a33f4686e45331f1bed94b7d606f123ea0f3921 - pristine_git_object: 98c35c9534ca3c5c6300814a5963bd80ecdc2785 - docs/sdk/models/shared/syncsetting.md: - id: de6c0111a7ac - last_write_checksum: sha1:28ef9aff02625a63e99e98d6e65303cd8bde563a - pristine_git_object: d6ab3f02ae69e634f26106e04b042ef1defb30c7 - docs/sdk/models/shared/syncsettings.md: - id: f1326b04ca35 - last_write_checksum: sha1:4a7e12d36fcfbb7cccab388a8e906bf581fb1116 - pristine_git_object: cc2b1d5ad764582c4e34354ced489be2e0425531 - docs/sdk/models/shared/updateconnectionstatus.md: - id: e4f42de631a0 - last_write_checksum: sha1:299bcd3555827fc7462dd0e2947fde8ef111b175 - pristine_git_object: 3dfce0901018137200f4d837ee50c8fa1043a7c3 - docs/sdk/models/shared/validation.md: - id: b9ffd70ca98d - last_write_checksum: sha1:ebdbc0f2d5c6d5cf49c7776d83f622179e8528b3 - pristine_git_object: ffa69ff195a1cac3338aa5863a7a5f4de14e41b1 - docs/sdk/models/shared/validationitem.md: - id: 4e3848a26890 - last_write_checksum: sha1:3f674e7e2e415d9c9ad8aee0a375a3daffc7152c - pristine_git_object: 0e9a8c316debcf005b9bf3db92a87b5e1000fe44 - docs/sdk/models/shared/validationitem1.md: - id: 1983da62972c - last_write_checksum: sha1:bb7c84e22f61c339c1838eb16a0e654a0dfba411 - pristine_git_object: 42624d40e02de8d0a8e48fa0c3f8ec07f74c5190 - docs/sdk/models/shared/validationresult.md: - id: 6a4471c9e7fd - last_write_checksum: sha1:fc1dae970cfab4a3bff714d6ffaab5c13d0afb85 - pristine_git_object: 97150b68b97af56aaf6d0412d33fb44e4e8a4585 - docs/sdk/models/shared/webhookconsumer.md: - id: fcd8160251db - last_write_checksum: sha1:39d8d6262e3bfcf3c1a023f1037ae90fae135a40 - pristine_git_object: 73b39475984877dd253b3ef5c841c5bf33fc80ab - docs/sdk/models/shared/webhookconsumerprototype.md: - id: e5978a5127b2 - last_write_checksum: sha1:c7ff6af1533e26ffb8a8aa8ec49ee886bb5ff359 - pristine_git_object: c193effb3852490de42017a7ee77b49c63d3a48b - docs/sdk/models/shared/webhookconsumers.md: - 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 - pristine_git_object: b1ac040b3242891564461094f27c32bf76130a8b - docs/sdks/connectionmanagement/README.md: - id: 28637ecb04a2 - last_write_checksum: sha1:f4e4af8f14c246d29115d5b7851f868474ba1767 - pristine_git_object: 9f645690bb4441ac8411bb5744bbdcf6fae4c04e - docs/sdks/connections/README.md: - id: 3ef8931411ea - last_write_checksum: sha1:7b99c7668f087d7ad34be10e35b0dd387b742c58 - pristine_git_object: bc0ad2ca30ec0357eb24b5180bfd6fdf34b0f543 - docs/sdks/cors/README.md: - id: efba34c5ce3d - last_write_checksum: sha1:21b06a033356ad8a3915e9471c2e3f76c38217e7 - pristine_git_object: 7cc250dae4045b8e0b1decbeeec39bf6111f4778 - docs/sdks/customdatatype/README.md: - id: 66e977ac654b - last_write_checksum: sha1:eb055da894f7993c86c68b406b5595b237e54d70 - pristine_git_object: 3eaa58ef5414e1c8dce2a3f1ea83e2f5cf11d8d0 - docs/sdks/integrations/README.md: - id: 7b29664808c0 - last_write_checksum: sha1:ff661975f2228738071860d47dcd7f9d9e45d039 - pristine_git_object: e922543c4597315fbcce04b2a392a9afa55566ca - docs/sdks/pushdata/README.md: - id: f9e77a7e3bd5 - last_write_checksum: sha1:d00b25c17c153d7bea26e6f4fc596011e1242226 - pristine_git_object: 00231222f80488f23ebc330eb478d51d9b0a3ccf - docs/sdks/readdata/README.md: - id: 40d4a395f200 - last_write_checksum: sha1:821a2f9ccb09bc2e72f2b2f14894175b881baa4b - pristine_git_object: 79d62c9506cee9476f1e1f4841ade5d5795736b6 - docs/sdks/refreshdata/README.md: - id: e4f24d03068b - last_write_checksum: sha1:9fc3f86707306cc9d06da0169c421eb085b6cd49 - pristine_git_object: 73a47f90dc894216927cb881e6b372f20e260d59 - docs/sdks/settings/README.md: - id: ffd4dbcfc0ce - last_write_checksum: sha1:5a1c1bd0bd6b295dd5892c25ed718c230c4080d3 - pristine_git_object: 75b5f21677e77127990fc5901d05836e50c44e15 - docs/sdks/supplementaldata/README.md: - id: 225f3e45f483 - last_write_checksum: sha1:e72f8eb2fa7cd94fbe7e97a639eb047b4e761994 - pristine_git_object: 8be9e1527e13ed1687346c389551dc26fd9a4b64 - docs/sdks/webhooks/README.md: - id: e21b32d786a4 - last_write_checksum: sha1:f7f28ada794f74c3bf799e91915dcda3ca7daf6a - pristine_git_object: a7d2a14f969906d65ec06749aaa976f7c467a5b1 - eslint.config.mjs: - id: 461c8d07f6da - last_write_checksum: sha1:9398f326377fe47f67af2df6eb6370750c0790b4 - pristine_git_object: 67bccfec985be20a00970d90155752832dd47135 - examples/.env.template: - id: 52cbe5afed92 - last_write_checksum: sha1:22b92d275a1bcc55b1817f7d6121a6dcaa04a438 - pristine_git_object: ef7de0a9fe7d5cd221e5e46474fe5108c3ec7d7a - examples/README.md: - id: 9d0f69d6e677 - last_write_checksum: sha1:0d6635aa770207277c500c23c36f1515af3076d1 - pristine_git_object: 1d3dca6dac74eba4976ff5eb9748f4febc782dc5 - examples/companiesList.example.ts: - id: 21346a1a073c - last_write_checksum: sha1:c8c35129d4cf53bc5d21604b2d4f003b5ff091d6 - pristine_git_object: 648bee2857610123a7c18212e8ba9ba8138c58ee - examples/package.json: - id: c1d7b0ec8e7e - last_write_checksum: sha1:4031d8d0f85ef573ddb8feb0738fe9f4c60fb46b - pristine_git_object: 5dc8c25718e9c3667d8095c7d068cbbcc4f03bf1 - jsr.json: - id: 7f6ab7767282 - last_write_checksum: sha1:c0a5343d5c855f069d8af938762419f6cfbdb064 - pristine_git_object: a06825c1dd042d965b20e8c422817df0a0948fab - package.json: - id: 7030d0b2f71b - last_write_checksum: sha1:dd497a0dc1648f13fc46570b8733e5b3e5e6cf61 - pristine_git_object: 57d35bf9d43a1017669ea1b11175b8b16d20f1d3 - src/core.ts: - id: f431fdbcd144 - last_write_checksum: sha1:9744ded3fe595398f8cf7c12fd4f17a418f65f2f - pristine_git_object: dee072a47bfb28f90396e818ed5deffc2004e87d - src/funcs/companiesAddProduct.ts: - id: b3b72701ac79 - last_write_checksum: sha1:325ec94d5a692fc6417c95fd76d0e8380177370d - pristine_git_object: 4bb693769ec7c8a0f4eed2ed573d3a70f9d39102 - src/funcs/companiesCreate.ts: - id: becfb79b6222 - last_write_checksum: sha1:73b90d94715f58fac88f9f3fad8780f86ad8741f - pristine_git_object: 274b8d339c1e1fb5b1de5e3ff6b3a22fbf53752a - src/funcs/companiesDelete.ts: - id: d4b8d3c15935 - last_write_checksum: sha1:8e49c458cbc4eeeaafab9571fa119e3dfc93b02c - pristine_git_object: 64e2354140ca0d8687db066c6fe26c234e20a95f - src/funcs/companiesGet.ts: - id: 497c5e9320c2 - last_write_checksum: sha1:f72ad393158bc2f1398e8c44b9dfd2fe2f0b2e83 - pristine_git_object: f764cdc1795793db9a4add0a5f3a6ceda98cc5ef - src/funcs/companiesGetAccessToken.ts: - id: 9fd96bcbf643 - last_write_checksum: sha1:bbe97d868aac62d43a56053ce4fd32ddc6655f04 - pristine_git_object: 3850551a493bb590216ccf9f90f718bd67cabe2e - src/funcs/companiesGetCompanySyncSettings.ts: - id: 0312a9f237f1 - last_write_checksum: sha1:db859a12c27e20649e3a87f7a5964c5850bc1ea2 - pristine_git_object: dcf62f317887601eff89ab9885b731c25218f4b5 - src/funcs/companiesList.ts: - id: c57fb769a99c - last_write_checksum: sha1:51d749cce902e3b0387bfef61f2cf152fa56e66a - pristine_git_object: d746453e09b0d8473bdf216c7664a47812000b7b - src/funcs/companiesRefreshProductData.ts: - id: 44fe2ea6742f - last_write_checksum: sha1:f2a9c12d5d0dfc35b1fe17754a5ab43950bb57f2 - pristine_git_object: a27cf9149b655ac41a27fef0897a1229452fac63 - src/funcs/companiesRemoveProduct.ts: - id: 210f26acb85c - last_write_checksum: sha1:a91ff5cb28a0dc92e4302a079d11a6b173c7b390 - pristine_git_object: 41f892c79b1824b5c0fe6e2b358cf9988d68a83c - src/funcs/companiesReplace.ts: - id: c141cb91cc73 - last_write_checksum: sha1:cdd4282084b26fec5d8ee7704520b2dd1125d5c2 - pristine_git_object: dd5f90a3fdd9b8248b4c5da48312b4716c25f310 - src/funcs/companiesSetCompanySyncSettings.ts: - id: e6304c1f4cf8 - last_write_checksum: sha1:2fdede2b83faecc9e938fcfa249444f5acae981f - pristine_git_object: 5d72c86a64836569d289d453db6a2bf3bc52f605 - src/funcs/companiesUpdate.ts: - id: e3d7bd676c21 - last_write_checksum: sha1:0a877e40852e88b7931f9d54b146b5ce96599438 - pristine_git_object: d62c51598bd2a016452c6c12f82e2d1c9d1b196a - src/funcs/connectionManagementGet.ts: - id: 9eb0e0f22fde - last_write_checksum: sha1:e404430d2938596f2bf485068155379c832f4929 - pristine_git_object: f027fc777311fbb9a9de59964054461f7bf53d62 - src/funcs/connectionsCreate.ts: - id: 0423cc2d060b - last_write_checksum: sha1:e57c13d575b18fea61d74c39b094ba2938a843db - pristine_git_object: c9b0b221bc0bdf845d0fd950e468d51d6fde638d - src/funcs/connectionsDelete.ts: - id: f33b14b4a39d - last_write_checksum: sha1:61ddf4d0dbcb1cf150c7e08768e0f4f6850d29b4 - pristine_git_object: 2999349000a22b6716b7f24a9947d74c7ae68a72 - src/funcs/connectionsGet.ts: - id: 6a1b6227b285 - last_write_checksum: sha1:f91146e0e7774bb046f2cc89734cc6cd2726449b - pristine_git_object: 5a72755edbd6c2f253059b020662df88356ba3ca - src/funcs/connectionsList.ts: - id: ca36cb8b50d3 - last_write_checksum: sha1:3ed61a242f4d133ecb973200fc29214d28a3df16 - pristine_git_object: 4df8cda66019bce3c88e60b917a2544e4fa67cf6 - src/funcs/connectionsUnlink.ts: - id: 0ff9d29a8016 - last_write_checksum: sha1:3f695ee3e9aed2801c689a3d57f0665133a1c072 - pristine_git_object: 25deda12005c245475955308c87e4548c2162cb5 - src/funcs/connectionsUpdateAuthorization.ts: - id: ea3363f5f9d1 - last_write_checksum: sha1:75d1c25f481c02613f1e79a16744344d35be016b - pristine_git_object: 8b80d8ab751841f9d4a8395fbab9b9cb9cdeb453 - src/funcs/corsGet.ts: - id: d31eb3b61079 - last_write_checksum: sha1:2f8c53d08af17aaea3fc525cccae43846e3e2ef2 - pristine_git_object: 68e859302153c7bbf9b134ac2edc75a541e94f25 - src/funcs/corsSet.ts: - id: 38f524286e09 - last_write_checksum: sha1:5806f58763954d372438c6e4790aaca81d35dbb7 - pristine_git_object: 5037527df578a1e7aebc420e7c910d390258f50d - src/funcs/customDataTypeConfigure.ts: - id: a8893a3acc96 - last_write_checksum: sha1:3c1f66d700abb821ac2c09c83f241c091335e1f1 - pristine_git_object: b22b80f8187c65cfac73fc830f5dbca2b65c38ed - src/funcs/customDataTypeGetConfiguration.ts: - id: 94629e039cc9 - last_write_checksum: sha1:a784a2e1bd53ac682d641b7b617ec9f4223a0c67 - pristine_git_object: 8cd5b199b2bb077e4503d23b5fbe98a4a90caefb - src/funcs/customDataTypeList.ts: - id: f7e6dd149e4f - last_write_checksum: sha1:185cd48497611eb8138634d732563524d02bd006 - pristine_git_object: 83bc7150889cc19b85decfaae13d846843ca7ae1 - src/funcs/customDataTypeRefresh.ts: - id: 3dc9879f360e - last_write_checksum: sha1:d5900cdcb8d222de1fb88150e9c957576b8cb160 - pristine_git_object: 71b3728a4e621d65082af1d4b5821e6af05d71f0 - src/funcs/integrationsGet.ts: - id: b6b0e31a5b00 - last_write_checksum: sha1:fcfc5ea97c2514568ff27b87ba809b84b7a9d27a - pristine_git_object: af1459141ef41d04f06c05ec0cf48a9d29716e63 - src/funcs/integrationsGetBranding.ts: - id: 8c0f1bcb75a0 - last_write_checksum: sha1:b1f96fc5d77acb5dad0f645d8fbc68faf71bb541 - pristine_git_object: 6a251d15e7651a957feae35115670928957aadbc - src/funcs/integrationsList.ts: - id: fcbba304389f - last_write_checksum: sha1:7cdae8ff0058739a874d21ecc7b8535f65de718f - pristine_git_object: acd0e0a45a5b036c019581bed6b55cf2b9189783 - src/funcs/pushDataGetModelOptions.ts: - id: fe4a3486eb78 - last_write_checksum: sha1:192bf6ca7a76192fbad5032e0b41056009415422 - pristine_git_object: 13f18b844206c71481610fb310675f738c47907b - src/funcs/pushDataGetOperation.ts: - id: f1de0499fdae - last_write_checksum: sha1:d743589dd1477dd616f4ab6191c0e1cd1252e809 - pristine_git_object: 23fa87087432d04f35020583452e92eb3541b98d - src/funcs/pushDataListOperations.ts: - id: 68a4457f3769 - last_write_checksum: sha1:cab4390c464ca0934daf391a2d2135df67de8d3e - pristine_git_object: 0d0871181331831b30c432e858d05d5ac33e5515 - src/funcs/readDataGetValidationResults.ts: - id: a763967449b6 - last_write_checksum: sha1:42332e3b50827eef30c053802552e4c334bf34b3 - pristine_git_object: b669f6d6c742430426c02db7c762826e61f68129 - src/funcs/refreshDataAll.ts: - id: 7753ed62dca8 - last_write_checksum: sha1:6739e4490fcf44654dfb78133e5f5e348fee80ea - pristine_git_object: 8199dd6e745193500bccd6d213a1c86d8097a535 - src/funcs/refreshDataByDataType.ts: - id: 396cf059f37a - last_write_checksum: sha1:dfd207088675aae067642d9952a4752b8a0235ed - pristine_git_object: 891959ef12d0a3af5fc3fd259d89fb2219057874 - src/funcs/refreshDataGet.ts: - id: 8986cedc7f4f - last_write_checksum: sha1:3dbc07e50004e77ec6eb1134cb245003ef549d55 - pristine_git_object: c87e650e4cef6c9ff498545d1583646e8a8e50d8 - src/funcs/refreshDataGetPullOperation.ts: - id: 8b6d65052a82 - last_write_checksum: sha1:d2f918ac94c77df97a4544129f69e1eb8fd76b6d - pristine_git_object: ee36f9d08b5ecb7c79a7fafcc0844615230a85ee - src/funcs/refreshDataListPullOperations.ts: - id: 8a8e27bfa08d - last_write_checksum: sha1:62e35e44e90d820233e650db456e0aaee1f4d8ff - pristine_git_object: b4cf03ed172c78236ba21e720300bafe9875c69f - src/funcs/settingsCreateApiKey.ts: - id: fa32333732a4 - last_write_checksum: sha1:16d2df1252f4a4747f9937f9c9322b886470e3de - pristine_git_object: 8adc1a069862bcea0b94506ed32bcc219ea698f0 - src/funcs/settingsDeleteApiKey.ts: - id: 6d2edbff42e3 - last_write_checksum: sha1:3bd047a876ea6d746b8b37418e6e61d580c2a578 - pristine_git_object: 4a93b629185bbae7ce46928a7dccaebb9166854b - src/funcs/settingsGet.ts: - id: 2543278c0bee - last_write_checksum: sha1:1fecd073e1a32b32ac2ddb428043a627ef362cc2 - pristine_git_object: a30519f0e5226dd1612a9c17fd5bf4b91fb0a6e7 - src/funcs/settingsGetProfile.ts: - id: 454f8eb0280e - last_write_checksum: sha1:4ffdf2c8f325c230b9cede6746ad0e9958afe1b8 - pristine_git_object: 0ac5dd61b83c35ccdfbbaed15d6b2bb6c31bc722 - src/funcs/settingsGetSyncSettings.ts: - id: 39ea3774ba93 - last_write_checksum: sha1:d7fe980057583c6bbbee590276b20ac8f9ac084a - pristine_git_object: fc49221e1075fd3fe86f3eb7cac1498d5ffc21d2 - src/funcs/settingsListApiKeys.ts: - id: be3d7398bed0 - last_write_checksum: sha1:127af218ed8bdbd86a1d867b60823bb75fc5aebb - pristine_git_object: d33d507c9fb4b218399fb1a50e200012c94e0cce - src/funcs/settingsSet.ts: - id: a85ecf9d80ca - last_write_checksum: sha1:f0779de840116e77855133254e6b89492a54b422 - pristine_git_object: 2f036b3cfca2c9d1339582ed47c8f396f7a5aba9 - src/funcs/settingsUpdateProfile.ts: - id: 3f1a8a41a125 - last_write_checksum: sha1:2019ab372555cf64c2ece22bcbd71ee89d2c8429 - pristine_git_object: 26a841a1a5dd166d9877bc143b53caa2b485df6a - src/funcs/settingsUpdateSyncSettings.ts: - id: a1dd684393dc - last_write_checksum: sha1:0f2a901f2adfd33da377dbdb0738b27dc668a91d - pristine_git_object: 764ed9e5277c204e58fafe0679e42d29e0bda555 - src/funcs/supplementalDataConfigure.ts: - id: 4a8451d88b34 - last_write_checksum: sha1:8a344b435a9dce01c1f84fce7ceaea99a89e2638 - pristine_git_object: 7bdc561de5aed542cfc3da46d1ccc5622fe5730a - src/funcs/supplementalDataGetConfiguration.ts: - 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 - pristine_git_object: 184ebe2aeae2e3fe9cb95ac12fbd470684c48e9f - src/funcs/webhooksDeleteConsumer.ts: - id: 62595c2f5815 - last_write_checksum: sha1:239d8a288f7fbb8080b6ee8e85d08838ca646863 - pristine_git_object: 7923eeba40515d82712686a060978e331f404328 - src/funcs/webhooksListConsumers.ts: - id: 3aea0e6c36a9 - last_write_checksum: sha1:f79bdb1683a099c66c06bf535c64064dca60a335 - pristine_git_object: acad565e252f1c183be7e127528ca754e8d2d147 - src/hooks/hooks.ts: - id: a2463fc6f69b - last_write_checksum: sha1:9a569ea8f3177ddcdfe6cd903feaf5c2d2c36a9a - pristine_git_object: d34c88497fb1cfb22a725e52b4c218f36d0b5c8e - 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 - src/index.ts: - id: c5fb850250c7 - last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 - pristine_git_object: dbcba164a0082e3bb8c43cf21fa7f8ffb9d35dfc - src/lib/base64.ts: - id: "598522066688" - last_write_checksum: sha1:b0b12ddbd8625efb47c0e955a18641aeb10c6532 - 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 - src/lib/encodings.ts: - id: 3bd8ead98afd - last_write_checksum: sha1:d47614c415b37e092965c34cb668562195701004 - pristine_git_object: 2791d25bc4f7cf6eec17a65f899851e225fa3deb - 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 - 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 - src/lib/primitives.ts: - id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 - src/lib/retries.ts: - id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b - 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 - src/lib/security.ts: - id: 0502afa7922e - last_write_checksum: sha1:808e939964cd1393080c8b6428dabf33f746bae5 - pristine_git_object: 3da8e733b499dfb3c174dab84751a95ebc42324a - src/lib/url.ts: - id: b0057e24ed76 - last_write_checksum: sha1:3bceadd74bf0b31adf13eb06b7531077c3e07d65 - pristine_git_object: 79e7ce660b3732053e3adcbb5a4cdeb51496e8aa - src/sdk/companies.ts: - id: 7d7df3fca5ca - last_write_checksum: sha1:8c7d8cec65c48ce3ec6b16dfc5dda76a5d6bc11a - pristine_git_object: e42a57991bebb6ecf8515d5207f9172eae167d89 - src/sdk/connectionmanagement.ts: - id: bd681627a514 - last_write_checksum: sha1:cf55c3456423ee3bc32ab8771882ee088a9c03bb - pristine_git_object: c1537290b6b94d9f4d782dcbf7370fff2e54c1a2 - src/sdk/connections.ts: - id: 5992fff3b5cd - last_write_checksum: sha1:2c9aa0fdd196278e3e03c3d9261d809d3138971b - pristine_git_object: 75de8c36f59d86b67f5f5af0659a7b0d370e1431 - src/sdk/cors.ts: - id: f2948a28f086 - last_write_checksum: sha1:24a286826d922b4f30e5f8445ef213b26963545e - pristine_git_object: c8b6f473538e9c8b7b887911d16a3a9af553099f - src/sdk/customdatatype.ts: - id: 9d6a718df1c7 - last_write_checksum: sha1:b752b2e2550a1903e488381e26c31f3ec053eb04 - pristine_git_object: da886b98424b7e40c8a2b2dc66e5c11f7d83ef38 - src/sdk/index.ts: - id: a857902a703f - last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f - pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 - src/sdk/integrations.ts: - id: eafed585af5a - last_write_checksum: sha1:49fd333cb5f64438f12f0988cba79ce2b568b9f9 - pristine_git_object: ebfab9c5a78703d444acb4c77be95635fbd3b899 - src/sdk/models/errors/codatplatformerror.ts: - id: 9e608117fc24 - last_write_checksum: sha1:d8a38b5fdd3a2448260304dae512c68b4976571c - pristine_git_object: 32dfeae30de2b7b8a6304e6460de62c851d59d57 - src/sdk/models/errors/errormessage.ts: - id: 2bc5b9b70870 - last_write_checksum: sha1:bce40db996dde91f322ee1ead448fb1dddcdbdbd - pristine_git_object: 6ad9c7a285f95fbbb7018abb1ec796d4dd096762 - src/sdk/models/errors/httpclienterrors.ts: - id: 7be0894f205a - last_write_checksum: sha1:994ced121c54fecd0af038ccfb7855fbfd3868ec - pristine_git_object: b34f612124c797c2a1106b9735708f679a90b74f - src/sdk/models/errors/index.ts: - id: 017ae2dc215b - last_write_checksum: sha1:69b4a738ee5a785c8b92203e81d9889283ea7cdf - pristine_git_object: 709731241921a50d588abadb31701638fa85bcd5 - src/sdk/models/errors/responsevalidationerror.ts: - id: 0b76670204e7 - last_write_checksum: sha1:7033fb87290848ab13c06c576d174b3e40918b0c - pristine_git_object: e98a5961af2fbd8fe7b942ea6c2a82eac10a01f4 - src/sdk/models/errors/sdkerror.ts: - id: c231fdf3b914 - last_write_checksum: sha1:e631c07233e6e280fb3604313a57e8bcbe81c120 - pristine_git_object: e272fee5e17df35d2c0a07dd2164316d23bb21ae - src/sdk/models/errors/sdkvalidationerror.ts: - id: 7c8a11e099b9 - last_write_checksum: sha1:a69da17627bcc32b820544608f3400423ea53f26 - pristine_git_object: 6826e1208a5d7b7d310535d18909646522bf0fbd - src/sdk/models/operations/addproduct.ts: - id: 7b6273a1cbd7 - last_write_checksum: sha1:758ddc45ab6ed58f8d85eef72e2cc277bf58d73e - pristine_git_object: e40c51754735b4949ef3be1842a70b607245ff21 - src/sdk/models/operations/configurecustomdatatype.ts: - id: 6dee9e978933 - last_write_checksum: sha1:abbee5731df9e4b690b41535e23f535759a70a7a - pristine_git_object: 11307f880b2ada43db7ad220bbf0d7bfebacf956 - src/sdk/models/operations/configuresupplementaldata.ts: - id: 1dc3739fbb01 - last_write_checksum: sha1:51891beaf5e044d407ed09bd6c8c589c8c623cb5 - pristine_git_object: d17dc21bd887787768a46876c86b6d96625fdd6d - src/sdk/models/operations/createconnection.ts: - id: fd864cebfe91 - last_write_checksum: sha1:67abdd42c0f4b8669b59225b4cf97763bd0cca4c - pristine_git_object: dc5bcac12be709864c1f9a57ab0591899995abeb - src/sdk/models/operations/deleteapikey.ts: - id: 85933bdc0c0b - last_write_checksum: sha1:d06dccd9fc9b6e41481f060e634f07fe2392e73e - pristine_git_object: bdfb45a4d055ee07316914c4d1866e04e48a1de9 - src/sdk/models/operations/deletecompany.ts: - id: feff26e831a7 - last_write_checksum: sha1:3c6c30970b77ef97770f4a9fed7866b08bfd1ad0 - pristine_git_object: dbe555534894ed6e7f64cf4f034fff5fb58ddedb - src/sdk/models/operations/deleteconnection.ts: - id: 918aad3d3a4a - last_write_checksum: sha1:47fa476012d016921380a863c5457ef7babdd186 - pristine_git_object: 83f75997084050b7c35824dc9e065e81e3677b69 - src/sdk/models/operations/deletewebhookconsumer.ts: - id: 04489804ec02 - last_write_checksum: sha1:ddc36df343efddf1f02b9ccd675d92fff65e6c89 - pristine_git_object: 630c1122a68be97cba7e282286438c1b95e7186e - src/sdk/models/operations/getcompany.ts: - id: 4bef19281ada - last_write_checksum: sha1:3c30540e6bcdad8e8a51c616dc9e9b21934890ca - pristine_git_object: 77734decc381321230c2bfb8f340633b2064f315 - src/sdk/models/operations/getcompanyaccesstoken.ts: - id: 2d5fc9dd3264 - last_write_checksum: sha1:c0fe9828a6d274e8e301d5b5f1c468eef4220ef4 - pristine_git_object: 6b76f47f238c15e4c80683a6f3081dd5c275a47a - src/sdk/models/operations/getcompanydatastatus.ts: - id: 9f2ea820adc7 - last_write_checksum: sha1:788da94c2f3cdc65f4e84695b4db4443b58a6309 - pristine_git_object: f9953a2495666cd149558099cf160494e7ec7d45 - src/sdk/models/operations/getcompanypushhistory.ts: - id: a33d380d0de7 - last_write_checksum: sha1:b800301bf317bd44ee2807b1b9f6543de7aaca6e - pristine_git_object: 0e34ee5b0e3b9adf0f5410f96bad03405b9d2d40 - src/sdk/models/operations/getcompanysyncsettings.ts: - id: fa689d9a66c9 - last_write_checksum: sha1:2cd4ad37a1f90188beeefadb9509c5fc06714d4c - pristine_git_object: 6fabd765dd60f0c9396c1336b6af0785f055a329 - src/sdk/models/operations/getconnection.ts: - id: e6be8d1eab2c - last_write_checksum: sha1:94309b857129d317a91f50bae1e58ab670779062 - pristine_git_object: 126d23b8515e33d0e3c796e642e68ee0f74a6e00 - src/sdk/models/operations/getconnectionmanagementaccesstoken.ts: - id: dd152a787019 - last_write_checksum: sha1:703b4a9c2acd713edd22b89d2cbb5bebfbbfcbb3 - pristine_git_object: d77a4d7f6b8646744694c317be303c5027843fd8 - src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts: - id: 3dc29f7d62c2 - last_write_checksum: sha1:b693039c6a1779e0929ca83e8ebfcc4c47459e93 - pristine_git_object: 2c1cd46ce3e96d80db4cbeed7757f4de67d70aa4 - src/sdk/models/operations/getcustomdatatypeconfiguration.ts: - id: 164bd493023f - last_write_checksum: sha1:2a3afa6313a5c1e496fa3335b5a8618bd85bd231 - pristine_git_object: 31b20d15bfeeb8474396939de29b1bfac937d6a6 - src/sdk/models/operations/getintegration.ts: - id: cf6290064741 - last_write_checksum: sha1:8c63dec5ff140ecf64263bff70bf9a2b0878767c - pristine_git_object: f7b44cad11383a302ec83a7270d0ca4a855b4b88 - src/sdk/models/operations/getintegrationsbranding.ts: - id: 900634656c56 - last_write_checksum: sha1:0b556cfc8222d4280b38b0d24944fdb7b1919638 - pristine_git_object: 7ea6273d97c6b956be3dad11f8dc98e8537c476e - src/sdk/models/operations/getpulloperation.ts: - id: 72377e8b61d4 - last_write_checksum: sha1:0a0b81f1f3c3e124585a2be4e7325117c1d059cc - pristine_git_object: 2df9079da61727da96e0e5e57f9ba0f006c66aaf - src/sdk/models/operations/getpushoperation.ts: - id: 8b4e8573095d - last_write_checksum: sha1:e1cc048f6fff1b438aeb09e26ddd44e37f49b8e2 - pristine_git_object: 3a950624c21d3161701867af7743651708053b6f - src/sdk/models/operations/getreadvalidationresults.ts: - id: 6b52970753c6 - last_write_checksum: sha1:f471d8ab6d1bad92873530b3ce39b014a4fb999c - pristine_git_object: 68933c193bab7da9ec662c724039d13e912fef16 - src/sdk/models/operations/getsupplementaldataconfiguration.ts: - id: eeca37a43b5f - last_write_checksum: sha1:fd8eb90862e63e89e4c7d87a6b5bb88457c5336c - pristine_git_object: 06a087af28b97436dc09b83fb3e969c1bf88b17c - src/sdk/models/operations/index.ts: - id: b2864d0519d7 - last_write_checksum: sha1:02643a07b38a8f37231f37c6f919255a13da8546 - pristine_git_object: 182d597cb3b0da34eb8835bc8134b84c072f81ad - src/sdk/models/operations/listcompanies.ts: - id: bd514f2d5c1c - last_write_checksum: sha1:1487d8f67d5a1c439e6581e854213aa1a386b9f3 - pristine_git_object: 837a6aae587e8a038402fbcedcd4fcc1873136ba - src/sdk/models/operations/listconnections.ts: - id: 5797f5b9be29 - last_write_checksum: sha1:0e709e410d2b500143f63d78e8eaa9ce4c810a6d - pristine_git_object: d1be0d9421b3b0d768650208abc91adcf7a9b721 - src/sdk/models/operations/listcustomdatatyperecords.ts: - id: 2be2700efbd9 - last_write_checksum: sha1:947003c92c9a26aed81fd69c32e22b9493f28407 - pristine_git_object: 19ec7d32a28d7fe4a34932be9e8ac893b161ce4d - src/sdk/models/operations/listintegrations.ts: - id: 1afa5fb27034 - last_write_checksum: sha1:7c7f044ba21504b85046dddac2adc9ce8e2ded51 - pristine_git_object: 01ba5000f839749caefaec759794fecace9a89bb - src/sdk/models/operations/listpulloperations.ts: - id: 2f2dc545b414 - last_write_checksum: sha1:07db30cc5a51f31a8b19823b0248e852b13949d4 - pristine_git_object: d12f7bd86d6d9180c2042db5b65d5858f3d0c770 - src/sdk/models/operations/refreshcompanydata.ts: - id: 7e6ad22e681f - last_write_checksum: sha1:676da2d40c22653abd9e2d0254f315f217f542e3 - pristine_git_object: 43671cece963c234d63f965424d20458c74886a5 - src/sdk/models/operations/refreshcustomdatatype.ts: - id: 6a765c40d824 - last_write_checksum: sha1:ec8e21c91faec54307cf17ead36837afd803fccd - pristine_git_object: 410d11966320ae7ba5fc8a5e4bad219c41fb09b4 - src/sdk/models/operations/refreshdatatype.ts: - id: 3b0dec3e2d72 - last_write_checksum: sha1:a5f4a4d5b4cfa37eac057247ac89126b897d70cf - pristine_git_object: 021dcc185ec76da15170d033acbfea3e1eaf46d7 - src/sdk/models/operations/refreshproductdata.ts: - id: a37d77b445e8 - last_write_checksum: sha1:23ee4b9539df38c3dced3b0007622cf9ae9c0ae4 - pristine_git_object: 8636ba5256a0963ae52b4564c3eb2bc67179af17 - src/sdk/models/operations/removeproduct.ts: - id: 951b89a13593 - last_write_checksum: sha1:86b080da2f29c8ce4d67b97fd73d42ddb8516edd - pristine_git_object: 2cba04535aa6d16a97d0eb943b0a728ec81f37ec - src/sdk/models/operations/replacecompany.ts: - id: 15f9deaaf7eb - last_write_checksum: sha1:dd56621b0a190db2faed25c4f3f8ccc58c20210e - pristine_git_object: 5ee35551d47caea122b4f502f81b95691cc291ef - src/sdk/models/operations/setcompanysyncsettings.ts: - id: fec1b3c2f40f - last_write_checksum: sha1:477165acccccb36fa266d8bf88853077ef96e5d9 - pristine_git_object: a966402d8450ea46056f5f7fb3f25bc4d3757e4b - src/sdk/models/operations/unlinkconnection.ts: - id: 91e6d25ecd14 - last_write_checksum: sha1:a3ad7d24e44b8b56c90ad37a9b79732acb70ce2a - pristine_git_object: 87a6113ed42d79a4152aa95598e5b61ad8a429d8 - src/sdk/models/operations/updatecompany.ts: - id: dbafb9e0f8d9 - last_write_checksum: sha1:937aaa5e965aae942c6550456dbe3c37b5d2b280 - pristine_git_object: 37ead4428659b0b2409ad7f6cf54515e544e23ec - src/sdk/models/operations/updateconnectionauthorization.ts: - id: 2c4472e5ddb0 - last_write_checksum: sha1:62ad20780544fa53b0863212b08c421b5761d213 - pristine_git_object: b196a24aa3216d9b99b6e21f4de7a7d466c8c08e - src/sdk/models/operations/updateprofilesyncsettings.ts: - id: bbf8e3bdae19 - last_write_checksum: sha1:55ebcafe6ac2751263da3482a145ff2654434cd2 - pristine_git_object: 0f33ccee6149c1f8a3002b3cbf0807b552a88662 - src/sdk/models/shared/apikeydetails.ts: - id: 1c9f50f56745 - last_write_checksum: sha1:b6817bb3eab58d8615394b542ff1a3743084c1af - pristine_git_object: f72afdc77637ca631937198b426cb43eb2115902 - src/sdk/models/shared/apikeys.ts: - id: 6fbc438fcaa6 - last_write_checksum: sha1:efd675db5c8e570937419938cf7a0d31b36cfc10 - pristine_git_object: 3985195f86e7522f608633e17021bba54c27a9f4 - src/sdk/models/shared/branding.ts: - id: f5bd09a43ef3 - last_write_checksum: sha1:c8b0798c68dd1ddfab93282538d46eb5d2d569f8 - pristine_git_object: f38d7663728cca147c4a1313db917cab2701cc60 - src/sdk/models/shared/brandingbutton.ts: - id: d1209d045d4e - last_write_checksum: sha1:4df996baab06a5747becc8ebb653c06940ff736c - pristine_git_object: 1f9a4dfada88aef2b351a9c8bb0ad43b3b60269d - src/sdk/models/shared/brandingimage.ts: - id: 99ecd631b992 - last_write_checksum: sha1:5ee6ca5892b005daae02660d83f95a165074aff3 - pristine_git_object: 5ca98b079a0a96001ccfdd7e8a3162ddaeda84ab - src/sdk/models/shared/brandinglogo.ts: - 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 - 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 - src/sdk/models/shared/companyrequestbody.ts: - id: 9e2dd8b2247d - last_write_checksum: sha1:a3027f00426e9affb8b7f8d930db63b89c197607 - pristine_git_object: 5e438635a0842512ed8dd3a9ee464187ed7ff3fe - src/sdk/models/shared/companysyncsettings.ts: - id: 9ac302f7af54 - last_write_checksum: sha1:607ed50418c4d3e5a4672b68d58a9dc98e052980 - pristine_git_object: be0e794a8f1ec084c0b0d80c05fee8470869d031 - src/sdk/models/shared/companyupdaterequest.ts: - 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 - src/sdk/models/shared/connectionmanagementaccesstoken.ts: - id: 3523a921aaf9 - last_write_checksum: sha1:4e7936ea1723de05717404632eba593a3e1c2c20 - pristine_git_object: a2ca34fd46a2fce86eaa14b5efc62cf9dbac1815 - src/sdk/models/shared/connectionmanagementallowedorigins.ts: - id: eac9cbef4f45 - last_write_checksum: sha1:5ada69b5a7d717b75a49776e92a6abf142da7e09 - pristine_git_object: 0d85f18015125b0efcffdb6a270cc2aee26cee23 - src/sdk/models/shared/connections.ts: - 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 - pristine_git_object: fa84f952d870af990e95430c1ebb2d03072178f4 - src/sdk/models/shared/customdatatypeconfiguration.ts: - id: 4af247b2aa20 - last_write_checksum: sha1:eb832cd98711ad452f836612c2dc64466e28f390 - pristine_git_object: 543e120d38c0fef12b7c9b9da5043b1f6fec7c76 - src/sdk/models/shared/customdatatyperecord.ts: - id: 3688d59e2c49 - last_write_checksum: sha1:8295b26ad42162b821cab3efe8f7e626bb9958c3 - pristine_git_object: 4fa035c5b14e0e323e33208cc68565e068c0cf93 - src/sdk/models/shared/customdatatyperecords.ts: - id: 11de9714cbd1 - last_write_checksum: sha1:ac62d71305180eca4b1e5e3b4cd32fc88739be40 - pristine_git_object: df5741d181d8e817ede8f6252576042c83626902 - src/sdk/models/shared/dataconnectionerror.ts: - id: c94cddffcec9 - last_write_checksum: sha1:3b20f4e77cd912194221f095626d86c19330de38 - pristine_git_object: 90c1570e915435a100436d5686ba256cfab51f25 - src/sdk/models/shared/dataconnectionstatus.ts: - id: 506ff77d012f - last_write_checksum: sha1:6ab2241aa8830aafaeb937d48e97918a68b9dac7 - pristine_git_object: 88889c800a39f393c9445929bbd2150fc6daf7ca - src/sdk/models/shared/datastatus.ts: - id: 4f56e78a99e5 - last_write_checksum: sha1:eba6dba549c86bfcde0d6bcc81c5d74a1d19fd00 - pristine_git_object: 431478c2d5b04d59350c804a78382def3f19baed - src/sdk/models/shared/datastatuses.ts: - id: 0e054f9e6cf2 - last_write_checksum: sha1:2a79cadad0bb195ebca8b628e03aaa5ddeacadf1 - pristine_git_object: 784b3c07a6199c1f437237991300636b87ee9641 - src/sdk/models/shared/datatype.ts: - id: 24637063ef68 - last_write_checksum: sha1:4172c0dbe0be3092c548bc34244872155b984eba - pristine_git_object: 172647cea15cb7603d50fc8384eaab83f9848d77 - src/sdk/models/shared/datatypefeature.ts: - 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 - pristine_git_object: f052946a0ef9ad1c67e6b363cb733af1349dd327 - src/sdk/models/shared/errorvalidation.ts: - id: 7595eed057da - last_write_checksum: sha1:b7f44c1f99c9de84a9177a6fba2f76704a894a48 - pristine_git_object: dc97b86b1b0a47cc49cc6ce168bbf2dc7362a7d4 - src/sdk/models/shared/errorvalidationitem.ts: - id: 0fbe584c7194 - last_write_checksum: sha1:ea42d03e55f11719c38dc24ffdd5d982be3b1ce3 - pristine_git_object: cd21ec230bfad899a805264c87467c3a1762e9bc - src/sdk/models/shared/featurestate.ts: - id: 1865c1ee6a9f - last_write_checksum: sha1:02c87c4936c9d5de026922ed94dea15fb4f5a5f6 - pristine_git_object: 66d26abb5f63dc311d178851c8fc428e431f4803 - src/sdk/models/shared/featuretype.ts: - id: 70889c99b55a - last_write_checksum: sha1:2be23866daee46b07515f504393822adf0e92be9 - pristine_git_object: 18b7077bfde6a2127da1f026f329132d8eb46408 - src/sdk/models/shared/halref.ts: - id: 1c4609be4603 - last_write_checksum: sha1:b64b146493fe3613970c549edffd33e58402662a - pristine_git_object: 921d594fb96fe80f20787e9118d3def4a9e2d53c - src/sdk/models/shared/imagereference.ts: - id: 2d106eaf17d6 - last_write_checksum: sha1:686cc920964e25f58608aad1c97bdd5fb5b8e824 - pristine_git_object: e850fa584610a3ba9ca28b02fff560379872e118 - src/sdk/models/shared/index.ts: - id: e97e906e3c14 - last_write_checksum: sha1:9a38f102ced52fa6fdc2e870fdbeda00acc56302 - pristine_git_object: e36e825f73a93581803b1f8c7905d3b5f3ea8e26 - src/sdk/models/shared/integration.ts: - id: 7dddee0366e4 - last_write_checksum: sha1:5eb645e9bab9d5a567a52b9ef227570a1b119f77 - pristine_git_object: 0642629ea3c5734b7af80f6acb33f9a7741f88f2 - src/sdk/models/shared/integrations.ts: - 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 - pristine_git_object: 751d7d00e4248ebfd0d28dadcc799607e058635b - src/sdk/models/shared/profile.ts: - id: bf70848a6e46 - last_write_checksum: sha1:e8b4c02bd082f30e00eee26efeeb7f9f0e7a3dc3 - pristine_git_object: 661ad01673948df7b7290fa6e99f3ec0cc950625 - src/sdk/models/shared/pulloperation.ts: - id: 1c7a111bf82e - last_write_checksum: sha1:e82d9cd137c0d78465d050b4d8b1a368b31eb6e2 - pristine_git_object: 39375036856ebf027357ff9e00321f4a91f2f806 - src/sdk/models/shared/pulloperations.ts: - id: b51faf4dfd99 - last_write_checksum: sha1:869f7219c72b210af77791cdf5d866c6e39788a8 - pristine_git_object: 475158a0012b764dc1b95440b859651810d0bc07 - src/sdk/models/shared/pushchangetype.ts: - id: cf67386a1d21 - last_write_checksum: sha1:455bd6b2ebf2a0aeee8a914030cc903e9fb12b47 - pristine_git_object: 42040ea23eda83d8cb202d9f3239f5a7c62f4bd2 - src/sdk/models/shared/pushfieldvalidation.ts: - id: 8d8e835e5634 - last_write_checksum: sha1:c377b5bd6ef9fd9ab4e480b3e7e9e2a974a741a8 - pristine_git_object: 15fc3a0f565d8c493fb5461a56309ecadbdd69b2 - src/sdk/models/shared/pushoperation.ts: - id: b6592db339e9 - last_write_checksum: sha1:96d6c00dc8a56e64e4430b54f79446ef89a0601c - pristine_git_object: 470b4a2d4afd9205740a70286893f98e91e9637f - src/sdk/models/shared/pushoperationchange.ts: - id: 137f5337781d - last_write_checksum: sha1:c4fcd4f27955e10750e151667bb4ed7b1ecf29f9 - pristine_git_object: 5d771700a367ef509098146f474f10136fe3a577 - src/sdk/models/shared/pushoperationref.ts: - id: 61a311ce2153 - last_write_checksum: sha1:5a308570d299cf4068a5413fcb49296460fd5c79 - pristine_git_object: 9f851e4bac3b7c6a5cda84532fe579e5145896a9 - src/sdk/models/shared/pushoperations.ts: - id: b0489702427e - last_write_checksum: sha1:df0ddbf54bebf12f184c59ce0b7f9cdf5df010c9 - pristine_git_object: 35c08c7262eaf602936441cf831b2d63aafe9faf - src/sdk/models/shared/pushoperationstatus.ts: - id: 4d9d57d9f800 - last_write_checksum: sha1:7de289ab7d0d5365eae9fe17aed4caddaed26622 - pristine_git_object: 133e3b65f122ffae8912b5ca2a3e91c190c97ddf - src/sdk/models/shared/pushoption.ts: - id: 7b36845bb057 - last_write_checksum: sha1:e6da3557367628a63dd0789986bda82a2ac1c8a9 - pristine_git_object: af6a0a0a363f287ee7bc1e6a19bd87942579dfa7 - src/sdk/models/shared/pushoptionchoice.ts: - id: 4f9141171f1d - last_write_checksum: sha1:a254424966daf3d5185d1b272d0f2214424dce0f - pristine_git_object: 315b39f913390a0e7a4785a7d1c7f21693c7ca9d - src/sdk/models/shared/pushoptionproperty.ts: - id: 27745de0e67f - last_write_checksum: sha1:dd3f7838ac5ff9f5edc531b7bddc809dac397111 - pristine_git_object: 0100bc7b68eb80d19a298dc7276202c9faf85575 - src/sdk/models/shared/pushoptiontype.ts: - id: 4f2314173517 - last_write_checksum: sha1:795906b3ad06204f1dcc551385d5bb849607f61a - pristine_git_object: 298c02e2ea74d44d765eebcb7cc7b1054226aed7 - src/sdk/models/shared/pushvalidationinfo.ts: - 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 - pristine_git_object: 159529f4629668ece0eaf287f0b97f8b1dff365b - src/sdk/models/shared/security.ts: - id: 4a9790ed1c2f - last_write_checksum: sha1:1b51b365245ab2a0f5f5a06b90093bceb61fc084 - pristine_git_object: 675eaa5827f48cff71e28d1627f8d65a74e10623 - src/sdk/models/shared/sourcetype.ts: - id: 522d862efe5c - last_write_checksum: sha1:56c5b8a222327b6776331951eafb7ead0f1d8ec1 - pristine_git_object: 4ff7925e44d6013880a8211f7f02ab75ba80082e - src/sdk/models/shared/status.ts: - id: 1ab31ee187e8 - last_write_checksum: sha1:34533ee05804f1ffb0ff75d67eb7555498b9b5e5 - pristine_git_object: 17744c5740abf3e47c2e43c806c75374563baa46 - src/sdk/models/shared/supplementaldataconfiguration.ts: - id: 1f33c24128a4 - last_write_checksum: sha1:1b052f3127437bb1f71d258505ff06229512b101 - pristine_git_object: 6fd3b46d07832b274a50cd5e8b7a7d1964ddf457 - src/sdk/models/shared/supportedfeature.ts: - id: ec149f73a775 - last_write_checksum: sha1:3d7dd27f3de05c616ae28a12fb97873cd27fa047 - pristine_git_object: ea7140848ebb90edc68d97f8bec078aadf7cd741 - src/sdk/models/shared/syncsetting.ts: - id: 9a20c15a8263 - last_write_checksum: sha1:80576250d71375083359e5a895ec9834390bbe58 - pristine_git_object: 614d3c459e82627df26c759b31be651419209088 - src/sdk/models/shared/syncsettings.ts: - id: 5e5c7634139e - last_write_checksum: sha1:0e80c7e4840fc5eeeb940a65d2e5e8fcff77f275 - pristine_git_object: f7c1a35d25beac00185da988520783b5ad1a0f2b - src/sdk/models/shared/updateconnectionstatus.ts: - id: d8f8e9089cae - last_write_checksum: sha1:036e90813d47b95106afe75b518d258336bd7087 - pristine_git_object: e66d22eb4e5b8deba2ffcbd7f94b41f071618872 - src/sdk/models/shared/validation.ts: - id: e4418d9ed08e - last_write_checksum: sha1:af7e0ddf2db647404ee4178091fce0330db1e853 - pristine_git_object: 809d8b74ca10dbc58d07e62222e46ec0de5724d2 - src/sdk/models/shared/validationitem.ts: - id: 0e34cb6ff62f - last_write_checksum: sha1:fffb5da843c14ff12da16393c3e8752127fa7b92 - pristine_git_object: 09e03fea67a5feeec58ce6198d6d210da05b42b2 - src/sdk/models/shared/validationitem1.ts: - id: 81e1759a553f - last_write_checksum: sha1:689622b34e80b0edd1b7c6dfb6bb6112e4cc7b71 - pristine_git_object: f500a416484034db44e71caeb1da77e869dbea29 - src/sdk/models/shared/validationresult.ts: - id: c36cee082674 - last_write_checksum: sha1:325ef4b2bc2a305253966b408e4f070e58eaf61e - pristine_git_object: 87fbfde5b3772e40bc4d2d5af7403c05bd58ba51 - src/sdk/models/shared/webhookconsumer.ts: - id: a52de18c25f9 - last_write_checksum: sha1:63c94053bb925bae32bcc8570831a20a0aa1fbe9 - pristine_git_object: 518c26d46ee1b06e7dad736215a84af24c31dcf7 - src/sdk/models/shared/webhookconsumerprototype.ts: - id: bc32d77e4ba9 - last_write_checksum: sha1:62370518beb14b1a868c5af4c6f7ef6d6fd5f161 - pristine_git_object: 3eab8c6dc58437e7336d60021c28d54435f3c20d - src/sdk/models/shared/webhookconsumers.ts: - 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 - pristine_git_object: 834136f0f69b6c3ff664981c4c7e0afabbdaa2ab - src/sdk/readdata.ts: - id: 51b3defb9287 - last_write_checksum: sha1:6b22721985a327ed41ef9c47edd3f677d39b53b6 - pristine_git_object: 40b4bdc567445808396f469ecb208af61398b4fe - src/sdk/refreshdata.ts: - id: 452a807bda18 - last_write_checksum: sha1:59326c5f2340787da7508b0de54fd411cb5cc8fa - pristine_git_object: a660ec4b29c1e3cc13c5c891bd3513ed152127a2 - src/sdk/sdk.ts: - id: 784571af2f69 - last_write_checksum: sha1:8d02e5b8c1257ec6fc64df49d45321552d047f0f - pristine_git_object: a10fea4aafefdc12e94c33a9c3f05f2a5b8a3e65 - src/sdk/settings.ts: - id: b7e993b8acd3 - last_write_checksum: sha1:3ee45176da127a85c6d49fcf0710d58a67bc48ae - pristine_git_object: 0619d443305d0a7f7318c1ba55d9df03ef04cc47 - src/sdk/supplementaldata.ts: - id: 3a3a0a282011 - last_write_checksum: sha1:96c90a9ef93929ab7b547ed6fb30a8e23071446b - pristine_git_object: 71664963ae2c2be2cb7bdf9a69182b6586dd2af3 - src/sdk/types/async.ts: - id: 966026768b05 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 - src/sdk/types/blobs.ts: - id: 1def31341768 - last_write_checksum: sha1:cf45d78916671cb6345a11c97c633c64402bc27c - pristine_git_object: cce2892d4f573a120ef3907db90ab15f5979cfda - src/sdk/types/constdatetime.ts: - id: 7e64cb450e63 - last_write_checksum: sha1:dfaaf9adfaf49808bd4c9dea0039f21b7088d9c0 - pristine_git_object: fe62144eaf6a2054fc8ca9a98466e70f41b5434d - src/sdk/types/enums.ts: - id: 2ac17fb928cd - last_write_checksum: sha1:ee590453d2c87e33e89c633d37ee46907eca0e58 - pristine_git_object: aba0ffd2a3308a31e516d83b52823d80aa65a8f9 - src/sdk/types/fp.ts: - id: d9ec77b9460c - last_write_checksum: sha1:d24994d58f37a1ca106847fcc6d2e976c6f1c093 - pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 - src/sdk/types/index.ts: - id: 8c869d66c5f3 - last_write_checksum: sha1:25820e050c332015aaff5b5de2bbec51c3edd3ad - pristine_git_object: 8249564b4af12e95d783f3ad39f37f88346b6d09 - src/sdk/types/operations.ts: - id: c5e9c75d4266 - last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 - pristine_git_object: beb81e10f0b9eee2ed398a853fe6f737b743f818 - src/sdk/types/rfcdate.ts: - id: fc969c92a7c1 - last_write_checksum: sha1:8e5f382e02fe21c2f2e24deb1b7bbf8cddd3dd16 - pristine_git_object: c79b3f53a3dd922aa2ace5a4191c8652cf9a8e89 - src/sdk/types/streams.ts: - id: e556b428e8dc - last_write_checksum: sha1:cc9ced2dd34a76c3a1bd7784ccda1cc3b37ab9a9 - pristine_git_object: a0163e7a99cea88f21d0ad4ce3af1c720180ee20 - src/sdk/types/unrecognized.ts: - 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 - pristine_git_object: ec04917d0f776693597eea91bff10baf229e7b48 - tsconfig.json: - id: 61ebb9fd6e8c - last_write_checksum: sha1:79dc1550d921fefec69f8632ed3b24dad41ca2f6 - pristine_git_object: 76110f883cac40bb04fb2f376cd69ea8c8d6d215 -examples: - company.created: - Company created: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "company.created", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "Requested a loan for refurb.", "redirect": "https://link.codat.io/company/0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}} - company.deleted: - Company deleted: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "company.deleted", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "Requested a loan for refurb.", "redirect": "https://link.codat.io/company/0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "tags": {"customerRegion": "uk", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}}} - connection.created: - Connection created: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.created", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "PendingAuth", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} - connection.connected: - Connection connected: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.connected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} - connection.failed: - Connection failed: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.failed", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "PendingAuth", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"statusCode": "403", "statusText": "User cancelled linking", "errorMessage": "User cancelled", "erroredOnUtc": "2022-10-27T09:53:29Z", "status": "Active"}]}}} - connection.disconnected: - Unlinked: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.disconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Unlinked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} - De-authorized: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.disconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Deauthorized", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"statusCode": "401", "statusText": "The integration de-authorized access to the connection.", "errorMessage": "The integration de-authorized access to the connection.", "erroredOnUtc": "2022-12-27T09:53:29Z", "status": "Active"}]}}} - connection.reconnected: - Reconnected: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.reconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} - connection.deleted: - Deleted: - requestBody: - application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.deleted", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "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/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} - read.completed: - Read completed: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete"}]}} - read.completed.initial: - Initial: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed.initial", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete"}]}} - '{dataType}.write.successful': - Record: - requestBody: - application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.successful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Create", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Success", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}}} - Attachment: - requestBody: - application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.successful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "UploadAttachment", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Success", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}, "attachmentId": "att_1AZtxr2eZvKYlo2CJDX8whov"}} - '{dataType}.write.unsuccessful': - Record: - requestBody: - application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Update", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Failed"}} - Record timed out: - requestBody: - application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Delete", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "TimedOut"}} - Attachment: - requestBody: - application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "UploadAttachment", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "TimedOut", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}}} - client.rateLimit.reached: - Reached: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reached", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 0, "expiryDate": "2024-09-01T12:14:14Z"}} - client.rateLimit.reset: - Reset: - requestBody: - application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reset", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 11993, "expiryDate": "2024-09-01T23:59:99Z"}} - list-companies: - "": - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - One company: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - List of Companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - Malformed query: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - create-company: - With no description: - requestBody: - application/json: {"name": "Technicalium"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a description: - requestBody: - application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a tag: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - Malformed query: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - Parent multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} - Subsidiary multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-company: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {} - "500": - application/json: {} - replace-company: - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - Update description: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-replace-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - update-company: - Update tags: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - 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"}]} - "401": - application/json: {} - "500": - application/json: {} - add-product: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-add-product: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "401": - application/json: {} - "500": - application/json: {} - remove-product: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-remove-product: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "401": - application/json: {} - "500": - application/json: {} - refresh-product-data: - Standard product not supported: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Read in progress: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Data cannot be refreshed while a read operation is in progress. Allow the read to complete before attempting to refresh.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Data cannot be refreshed while a read operation is in progress. Allow the read to complete before attempting to refresh.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Filter specific data types: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - requestBody: - application/json: {"dataTypes": ["invoices", "payments"]} - responses: - "400": - application/json: {} - "500": - application/json: {} - speakeasy-default-refresh-product-data: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "bank-feeds" - responses: - "400": - application/json: {} - "500": - application/json: {} - get-company-access-token: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"expiresIn": 86400, "accessToken": "string", "tokenType": "Bearer"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-connections: - "": - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"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"}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "string"}, "current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-connections: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - create-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "200": - application/json: {"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"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"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"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-connection: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {} - "500": - application/json: {} - unlink-connection: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - requestBody: - application/json: {"status": "Unlinked"} - responses: - "200": - application/json: {"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": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-unlink-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"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": - application/json: {} - update-connection-authorization: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-connection-authorization: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"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": - application/json: {} - get-connection-management-access-token: - Access token: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection-management-cors-settings: - Allowed origins: - responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - Unauthorized: - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - set-connection-management-cors-settings: - Allowed origins: - requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - Unauthorized: - requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-cors-settings: - Allowed origins: - responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - Unauthorized: - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - set-cors-settings: - Allowed origins: - requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - Unauthorized: - requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-profile: - Unauthorized: - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-profile: - responses: - "200": - application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "confirmCompanyName": true} - "401": - application/json: {} - "500": - application/json: {} - update-profile: - Unauthorized: - requestBody: - application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "confirmCompanyName": true} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-profile: - requestBody: - application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "confirmCompanyName": true} - responses: - "200": - application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "confirmCompanyName": true} - "401": - application/json: {} - "500": - application/json: {} - get-profile-syncSettings: - Example: - responses: - "200": - application/json: {"clientId": "367f7975-267b-439b-90c6-a6040ee680f3", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - Unauthorized: - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-profile-syncSettings: - Unauthorized: - requestBody: - application/json: {"clientId": "9807ce3e-cfa5-4370-b4f2-09c282b1598b", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-profile-sync-settings: - requestBody: - application/json: {"clientId": "9807ce3e-cfa5-4370-b4f2-09c282b1598b", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - responses: - "401": - application/json: {} - "500": - application/json: {} - list-api-keys: - Example: - responses: - "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"}, {"id": "c438836a-61fe-443f-8a19-24cc18be21e4", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-23T09:43:48Z"}]} - Unauthorized: - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-api-key: - Create API key with name: - requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "e288a972-b402-4b21-93f9-b5335ae5679c", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-10-23T00:00:00Z"} - "400": - application/json: {} - "500": - application/json: {} - API key details: - requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} - API key details with name: - requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} - Max length for name reached: - requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Max string length (50) for `name` reached.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Max string length (50) for `name` reached.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-api-key: - Conflict: - parameters: - path: - apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "204": - application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "401": - application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - refresh-company-data: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-refresh-company-data: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {} - "500": - application/json: {} - refresh-data-type: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-refresh-data-type: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "200": - application/json: {"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false} - "400": - application/json: {} - "500": - application/json: {} - get-company-data-status: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"accountTransactions": {"dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "balanceSheet": {"dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankAccounts": {"dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankTransactions": {"dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billCreditNotes": {"dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billPayments": {"dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bills": {"dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "cashFlowStatement": {"dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "chartOfAccounts": {"dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "company": {"dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "creditNotes": {"dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "customers": {"dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directCosts": {"dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directIncomes": {"dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "invoices": {"dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "itemReceipts": {"dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "items": {"dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journalEntries": {"dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journals": {"dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "paymentMethods": {"dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "payments": {"dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "profitAndLoss": {"dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "purchaseOrders": {"dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "salesOrders": {"dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "suppliers": {"dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "taxRates": {"dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "trackingCategories": {"dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "transfers": {"dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accountBalances": {"dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accounts": {"dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactionCategories": {"dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactions": {"dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-companyInfo": {"dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-customers": {"dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-disputes": {"dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-locations": {"dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-orders": {"dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-paymentMethods": {"dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-payments": {"dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-productCategories": {"dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-products": {"dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-taxComponents": {"dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-transactions": {"dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-pull-operations: - "": - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}, "current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}}} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-pull-operations: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - get-pull-operation: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-pull-operation: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5" - responses: - "200": - application/json: {"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false} - "401": - application/json: {} - "500": - application/json: {} - list-webhook-consumers: - Webhook consumers: - responses: - "200": - application/json: {"results": [{"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumers/sync-complete", "disabled": false, "eventTypes": ["DataSyncCompleted"]}, {"id": "ca3cac86-7925-4759-abc2-96405780fdfa", "url": "https://example.com/webhoook-consumers/dataset-changed", "disabled": true, "eventTypes": ["DatasetDataChanged"]}]} - Malformed query: - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-webhook-consumer: - Subscribe consumer to one or more event types: - requestBody: - application/json: {"url": "https://example.com/webhoook-consumer", "disabled": false, "eventTypes": ["DataSyncCompleted", "Dataset data changed"]} - responses: - "201": - application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": false, "eventTypes": ["DataSyncCompleted", "DatasetDataChanged"]} - Subscribe consumer with disabled endpoint: - requestBody: - application/json: {"url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"]} - responses: - "201": - application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"]} - Malformed query: - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-webhook-consumer: - Unauthorized: - parameters: - path: - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-webhook-consumer: - parameters: - path: - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {} - "500": - application/json: {} - list-integrations: - "": - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-integrations: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - get-integration: - Unauthorized: - parameters: - path: - platformKey: "gbol" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-integration: - parameters: - path: - platformKey: "gbol" - responses: - "200": - application/json: {"key": "gbol", "logoUrl": "http://example.com", "name": "Xero", "enabled": true, "sourceId": "accounting", "sourceType": "Commerce", "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e", "isOfflineConnector": true, "isBeta": true, "dataProvidedBy": "string", "datatypeFeatures": [{"supportedFeatures": [{"featureType": "UploadAttachment", "featureState": "Deprecated"}]}]} - "401": - application/json: {} - "500": - application/json: {} - get-integrations-branding: - Unauthorized: - parameters: - path: - platformKey: "gbol" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-integrations-branding: - parameters: - path: - platformKey: "gbol" - responses: - "200": - application/json: {"logo": {"full": {"image": {"src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", "alt": "xero full icon"}}, "square": {"image": {"src": "https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png", "alt": "xero square icon"}}}, "button": {"default": {"image": {"src": "https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png", "alt": "xero default button icon"}}, "hover": {"image": {"src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", "alt": "xero hover button icon"}}}, "sourceId": "35b92968-9851-4095-ad60-395c95cbcba4"} - "401": - application/json: {} - "500": - application/json: {} - get-read-validation-results: - Validation result: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "0812af6e-436a-491f-9056-db91cb961ad3" - responses: - "200": - application/json: {"errors": [{"ruleId": "accounting-bill-030", "itemId": "fc2f2d1a-ff4d-40c6-a7fb-4bd7d04f4008", "message": "A bill's lines summed (69.99) should be the same as TotalAmount (70.00).", "validatorName": "BillValidator"}], "warnings": [{"ruleId": "accounting-bill-032", "itemId": "1d3979e5-7c28-432e-b562-04e9013c1ea0", "message": "A bill's lines sub total amount summed (3201.20) should be the same as SubTotal (3201.25)", "validatorName": "BillValidator"}]} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "8c3ae743-3699-413e-8c9b-56e1b4de25b7" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-create-update-model-options-by-data-type: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - dataType: "invoices" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-create-update-model-options-by-data-type: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - dataType: "invoices" - responses: - "200": - application/json: {"type": "Array", "displayName": "Zackary.Gleason", "required": false} - "401": - application/json: {} - "500": - application/json: {} - get-company-push-history: - "": - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-company-push-history: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - get-push-operation: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-push-operation: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747" - responses: - "200": - application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "6946e360-00fe-46e7-a6f8-4a3be88f2b5d", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "TimedOut", "statusCode": 80736} - "401": - application/json: {} - "500": - application/json: {} - configure-supplemental-data: - Xero - Accounts: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - Xero - Invoices: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - Xero - Items: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - Xero - Contacts: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - Xero - Tax rates: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - QBO - Customers: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - QBO - Invoices: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {} - responses: - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {"supplementalDataConfig": {"orders-supplemental-data": {"dataSource": "/orders", "pullData": {"orderNumber": "order_num"}, "pushData": {"orderNumber": "order_num"}}}} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-configure-supplemental-data: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - requestBody: - application/json: {"supplementalDataConfig": {"orders-supplemental-data": {"dataSource": "/orders", "pullData": {"orderNumber": "order_num"}, "pushData": {"orderNumber": "order_num"}}}} - responses: - "401": - application/json: {} - "500": - application/json: {} - get-supplemental-data-configuration: - Unauthorized: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-supplemental-data-configuration: - parameters: - path: - platformKey: "gbol" - dataType: "invoices" - responses: - "200": - application/json: {"supplementalDataConfig": {"orders-supplemental-data": {"dataSource": "/orders", "pullData": {"orderNumber": "order_num"}, "pushData": {"orderNumber": "order_num"}}}} - "401": - application/json: {} - "500": - application/json: {} - configure-custom-data-type: - Dynamics 365 Business Central: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} - responses: - "200": - application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} - Xero Simple Record: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} - responses: - "200": - application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} - Xero Mapping Arrays: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} - responses: - "200": - application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} - QuickBooks Online: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} - responses: - "200": - application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} - Unauthorized: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'", "requiredData": {"currencyCode": "$[*].currencyCode", "id": "$[*].id", "number": "$[*].number", "orderDate": "$[*].orderDate", "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", "totalTaxAmount": "$[*].totalTaxAmount", "vendorName": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-custom-data-type-configuration: - Unauthorized: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-custom-data-type-configuration: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - responses: - "200": - application/json: {"results": [{"modifiedDate": {"modifiedDate": "2022-10-23T00:00:00Z"}}]} - "401": - application/json: {} - "500": - application/json: {} - refresh-custom-data-type: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-refresh-custom-data-type: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" - responses: - "200": - application/json: {"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false} - "401": - application/json: {} - "500": - application/json: {} - list-custom-data-type-records: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" - query: - page: 1 - pageSize: 100 - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-custom-data-type-records: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" - query: - page: 1 - pageSize: 100 - responses: - "200": - application/json: {"results": [{"modifiedDate": {"modifiedDate": "2022-10-23T00:00:00Z"}}]} - "400": - application/json: {} - "500": - application/json: {} - get-company-syncSettings: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - set-company-syncSettings: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-set-company-sync-settings: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - responses: - "400": - application/json: {} - "500": - application/json: {} -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** -generatedFiles: - - .gitattributes - - .npmignore - - FUNCTIONS.md - - RUNTIMES.md - - USAGE.md - - docs/lib/utils/retryconfig.md - - docs/sdk/models/errors/errormessage.md - - docs/sdk/models/operations/addproductrequest.md - - docs/sdk/models/operations/configurecustomdatatyperequest.md - - docs/sdk/models/operations/configuresupplementaldatarequest.md - - docs/sdk/models/operations/createconnectionrequest.md - - docs/sdk/models/operations/createconnectionrequestbody.md - - docs/sdk/models/operations/datatype.md - - docs/sdk/models/operations/deleteapikeyrequest.md - - docs/sdk/models/operations/deletecompanyrequest.md - - docs/sdk/models/operations/deleteconnectionrequest.md - - docs/sdk/models/operations/deletewebhookconsumerrequest.md - - docs/sdk/models/operations/getcompanyaccesstokenrequest.md - - docs/sdk/models/operations/getcompanydatastatusrequest.md - - docs/sdk/models/operations/getcompanypushhistoryrequest.md - - docs/sdk/models/operations/getcompanyrequest.md - - docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md - - docs/sdk/models/operations/getconnectionrequest.md - - docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md - - docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md - - docs/sdk/models/operations/getintegrationrequest.md - - docs/sdk/models/operations/getintegrationsbrandingrequest.md - - docs/sdk/models/operations/getpulloperationrequest.md - - docs/sdk/models/operations/getpushoperationrequest.md - - docs/sdk/models/operations/getreadvalidationresultsrequest.md - - docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md - - docs/sdk/models/operations/listcompaniesrequest.md - - docs/sdk/models/operations/listconnectionsrequest.md - - docs/sdk/models/operations/listcustomdatatyperecordsrequest.md - - docs/sdk/models/operations/listintegrationsrequest.md - - docs/sdk/models/operations/listpulloperationsrequest.md - - docs/sdk/models/operations/pathparamdatatype.md - - docs/sdk/models/operations/refreshcompanydatarequest.md - - docs/sdk/models/operations/refreshcustomdatatyperequest.md - - docs/sdk/models/operations/refreshdatatyperequest.md - - docs/sdk/models/operations/refreshproductdatarequest.md - - docs/sdk/models/operations/removeproductrequest.md - - docs/sdk/models/operations/replacecompanyrequest.md - - docs/sdk/models/operations/unlinkconnectionrequest.md - - docs/sdk/models/operations/updatecompanyrequest.md - - docs/sdk/models/operations/updateconnectionauthorizationrequest.md - - docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md - - docs/sdk/models/shared/apikeydetails.md - - docs/sdk/models/shared/apikeys.md - - docs/sdk/models/shared/branding.md - - docs/sdk/models/shared/brandingbutton.md - - docs/sdk/models/shared/brandingimage.md - - docs/sdk/models/shared/brandinglogo.md - - docs/sdk/models/shared/clientratelimitwebhook.md - - docs/sdk/models/shared/clientratelimitwebhookpayload.md - - docs/sdk/models/shared/companies.md - - docs/sdk/models/shared/company.md - - docs/sdk/models/shared/companyaccesstoken.md - - docs/sdk/models/shared/companydetails.md - - docs/sdk/models/shared/companyreference.md - - docs/sdk/models/shared/companyreferencelinks.md - - docs/sdk/models/shared/companyrequestbody.md - - docs/sdk/models/shared/companyupdaterequest.md - - docs/sdk/models/shared/companywebhook.md - - docs/sdk/models/shared/connection.md - - docs/sdk/models/shared/connectionmanagementaccesstoken.md - - docs/sdk/models/shared/connectionmanagementallowedorigins.md - - docs/sdk/models/shared/connections.md - - docs/sdk/models/shared/connectionwebhook.md - - docs/sdk/models/shared/connectionwebhookpayload.md - - docs/sdk/models/shared/content.md - - docs/sdk/models/shared/createapikey.md - - docs/sdk/models/shared/customdatatypeconfiguration.md - - docs/sdk/models/shared/customdatatyperecord.md - - docs/sdk/models/shared/customdatatyperecords.md - - docs/sdk/models/shared/dataconnectionerror.md - - docs/sdk/models/shared/dataconnectionstatus.md - - docs/sdk/models/shared/datasetstatus.md - - docs/sdk/models/shared/datastatus.md - - docs/sdk/models/shared/datastatuses.md - - docs/sdk/models/shared/datatype.md - - docs/sdk/models/shared/datatypefeature.md - - docs/sdk/models/shared/datatypereadsummary.md - - docs/sdk/models/shared/datatypes.md - - docs/sdk/models/shared/datatypewritewebhook.md - - docs/sdk/models/shared/datatypewritewebhookpayload.md - - docs/sdk/models/shared/datatypewritewebhookrecord.md - - docs/sdk/models/shared/errormessage.md - - docs/sdk/models/shared/errorstatus.md - - docs/sdk/models/shared/errorvalidation.md - - docs/sdk/models/shared/errorvalidationitem.md - - docs/sdk/models/shared/featurestate.md - - docs/sdk/models/shared/featuretype.md - - docs/sdk/models/shared/halref.md - - docs/sdk/models/shared/imagereference.md - - docs/sdk/models/shared/integration.md - - docs/sdk/models/shared/integrations.md - - docs/sdk/models/shared/links.md - - docs/sdk/models/shared/modifieddate.md - - docs/sdk/models/shared/profile.md - - docs/sdk/models/shared/pulloperation.md - - docs/sdk/models/shared/pulloperations.md - - docs/sdk/models/shared/pushchangetype.md - - docs/sdk/models/shared/pushfieldvalidation.md - - docs/sdk/models/shared/pushoperation.md - - docs/sdk/models/shared/pushoperationchange.md - - docs/sdk/models/shared/pushoperationref.md - - docs/sdk/models/shared/pushoperations.md - - docs/sdk/models/shared/pushoperationstatus.md - - docs/sdk/models/shared/pushoption.md - - docs/sdk/models/shared/pushoptionchoice.md - - docs/sdk/models/shared/pushoptionproperty.md - - docs/sdk/models/shared/pushoptiontype.md - - docs/sdk/models/shared/pushvalidationinfo.md - - docs/sdk/models/shared/readcompletedwebhook.md - - docs/sdk/models/shared/readcompletedwebhookpayload.md - - docs/sdk/models/shared/security.md - - docs/sdk/models/shared/sourcetype.md - - docs/sdk/models/shared/status.md - - docs/sdk/models/shared/supplementaldataconfiguration.md - - docs/sdk/models/shared/supplementaldatasourceconfiguration.md - - docs/sdk/models/shared/supportedfeature.md - - docs/sdk/models/shared/syncsetting.md - - docs/sdk/models/shared/syncsettings.md - - docs/sdk/models/shared/updateconnectionstatus.md - - docs/sdk/models/shared/validation.md - - docs/sdk/models/shared/validationitem.md - - docs/sdk/models/shared/validationitem1.md - - docs/sdk/models/shared/validationresult.md - - docs/sdk/models/shared/webhookconsumer.md - - docs/sdk/models/shared/webhookconsumerprototype.md - - docs/sdk/models/shared/webhookconsumers.md - - docs/sdk/models/shared/writestatus.md - - docs/sdk/models/shared/writetype.md - - docs/sdks/codatplatform/README.md - - docs/sdks/companies/README.md - - docs/sdks/connectionmanagement/README.md - - docs/sdks/connections/README.md - - docs/sdks/cors/README.md - - docs/sdks/customdatatype/README.md - - docs/sdks/integrations/README.md - - docs/sdks/pushdata/README.md - - docs/sdks/readdata/README.md - - docs/sdks/refreshdata/README.md - - docs/sdks/settings/README.md - - docs/sdks/supplementaldata/README.md - - docs/sdks/webhooks/README.md - - eslint.config.mjs - - jsr.json - - package.json - - src/core.ts - - src/funcs/companiesAddProduct.ts - - src/funcs/companiesCreate.ts - - src/funcs/companiesDelete.ts - - src/funcs/companiesGet.ts - - src/funcs/companiesGetAccessToken.ts - - src/funcs/companiesList.ts - - src/funcs/companiesRefreshProductData.ts - - src/funcs/companiesRemoveProduct.ts - - src/funcs/companiesReplace.ts - - src/funcs/companiesUpdate.ts - - src/funcs/connectionManagementGet.ts - - src/funcs/connectionsCreate.ts - - src/funcs/connectionsDelete.ts - - src/funcs/connectionsGet.ts - - src/funcs/connectionsList.ts - - src/funcs/connectionsUnlink.ts - - src/funcs/connectionsUpdateAuthorization.ts - - src/funcs/corsGet.ts - - src/funcs/corsSet.ts - - src/funcs/customDataTypeConfigure.ts - - src/funcs/customDataTypeGetConfiguration.ts - - src/funcs/customDataTypeList.ts - - src/funcs/customDataTypeRefresh.ts - - src/funcs/integrationsGet.ts - - src/funcs/integrationsGetBranding.ts - - src/funcs/integrationsList.ts - - src/funcs/pushDataGetModelOptions.ts - - src/funcs/pushDataGetOperation.ts - - src/funcs/pushDataListOperations.ts - - src/funcs/readDataGetValidationResults.ts - - src/funcs/refreshDataAll.ts - - src/funcs/refreshDataByDataType.ts - - src/funcs/refreshDataGet.ts - - src/funcs/refreshDataGetPullOperation.ts - - src/funcs/refreshDataListPullOperations.ts - - src/funcs/settingsCreateApiKey.ts - - src/funcs/settingsDeleteApiKey.ts - - src/funcs/settingsGet.ts - - src/funcs/settingsGetProfile.ts - - src/funcs/settingsGetSyncSettings.ts - - src/funcs/settingsListApiKeys.ts - - src/funcs/settingsSet.ts - - src/funcs/settingsUpdateProfile.ts - - src/funcs/settingsUpdateSyncSettings.ts - - src/funcs/supplementalDataConfigure.ts - - src/funcs/supplementalDataGetConfiguration.ts - - src/funcs/webhooksCreateConsumer.ts - - src/funcs/webhooksDeleteConsumer.ts - - src/funcs/webhooksListConsumers.ts - - src/hooks/hooks.ts - - src/hooks/index.ts - - src/hooks/types.ts - - src/index.ts - - src/lib/base64.ts - - src/lib/config.ts - - src/lib/dlv.ts - - src/lib/encodings.ts - - src/lib/files.ts - - src/lib/http.ts - - src/lib/is-plain-object.ts - - src/lib/logger.ts - - src/lib/matchers.ts - - src/lib/primitives.ts - - src/lib/retries.ts - - src/lib/schemas.ts - - src/lib/sdks.ts - - src/lib/security.ts - - src/lib/url.ts - - src/mcp-server/build.mts - - src/mcp-server/cli.ts - - src/mcp-server/cli/start/command.ts - - src/mcp-server/cli/start/impl.ts - - src/mcp-server/console-logger.ts - - src/mcp-server/extensions.ts - - src/mcp-server/mcp-server.ts - - src/mcp-server/prompts.ts - - src/mcp-server/resources.ts - - src/mcp-server/scopes.ts - - src/mcp-server/server.ts - - src/mcp-server/shared.ts - - src/mcp-server/tools.ts - - src/mcp-server/tools/companiesAddProduct.ts - - src/mcp-server/tools/companiesCreate.ts - - src/mcp-server/tools/companiesDelete.ts - - src/mcp-server/tools/companiesGet.ts - - src/mcp-server/tools/companiesGetAccessToken.ts - - src/mcp-server/tools/companiesList.ts - - src/mcp-server/tools/companiesRefreshProductData.ts - - src/mcp-server/tools/companiesRemoveProduct.ts - - src/mcp-server/tools/companiesReplace.ts - - src/mcp-server/tools/companiesUpdate.ts - - src/mcp-server/tools/connectionManagementGet.ts - - src/mcp-server/tools/connectionsCreate.ts - - src/mcp-server/tools/connectionsDelete.ts - - src/mcp-server/tools/connectionsGet.ts - - src/mcp-server/tools/connectionsList.ts - - src/mcp-server/tools/connectionsUnlink.ts - - src/mcp-server/tools/connectionsUpdateAuthorization.ts - - src/mcp-server/tools/corsGet.ts - - src/mcp-server/tools/corsSet.ts - - src/mcp-server/tools/customDataTypeConfigure.ts - - src/mcp-server/tools/customDataTypeGetConfiguration.ts - - src/mcp-server/tools/customDataTypeList.ts - - src/mcp-server/tools/customDataTypeRefresh.ts - - src/mcp-server/tools/integrationsGet.ts - - src/mcp-server/tools/integrationsGetBranding.ts - - src/mcp-server/tools/integrationsList.ts - - src/mcp-server/tools/pushDataGetModelOptions.ts - - src/mcp-server/tools/pushDataGetOperation.ts - - src/mcp-server/tools/pushDataListOperations.ts - - src/mcp-server/tools/readDataGetValidationResults.ts - - src/mcp-server/tools/refreshDataAll.ts - - src/mcp-server/tools/refreshDataByDataType.ts - - src/mcp-server/tools/refreshDataGet.ts - - src/mcp-server/tools/refreshDataGetPullOperation.ts - - src/mcp-server/tools/refreshDataListPullOperations.ts - - src/mcp-server/tools/settingsCreateApiKey.ts - - src/mcp-server/tools/settingsDeleteApiKey.ts - - src/mcp-server/tools/settingsGet.ts - - src/mcp-server/tools/settingsGetProfile.ts - - src/mcp-server/tools/settingsGetSyncSettings.ts - - src/mcp-server/tools/settingsListApiKeys.ts - - src/mcp-server/tools/settingsSet.ts - - src/mcp-server/tools/settingsUpdateProfile.ts - - src/mcp-server/tools/settingsUpdateSyncSettings.ts - - src/mcp-server/tools/supplementalDataConfigure.ts - - src/mcp-server/tools/supplementalDataGetConfiguration.ts - - src/mcp-server/tools/webhooksCreateConsumer.ts - - src/mcp-server/tools/webhooksDeleteConsumer.ts - - src/mcp-server/tools/webhooksListConsumers.ts - - src/sdk/companies.ts - - src/sdk/connectionmanagement.ts - - src/sdk/connections.ts - - src/sdk/cors.ts - - src/sdk/customdatatype.ts - - src/sdk/index.ts - - src/sdk/integrations.ts - - src/sdk/models/errors/errormessage.ts - - src/sdk/models/errors/httpclienterrors.ts - - src/sdk/models/errors/index.ts - - src/sdk/models/errors/sdkerror.ts - - src/sdk/models/errors/sdkvalidationerror.ts - - src/sdk/models/operations/addproduct.ts - - src/sdk/models/operations/configurecustomdatatype.ts - - src/sdk/models/operations/configuresupplementaldata.ts - - src/sdk/models/operations/createconnection.ts - - src/sdk/models/operations/deleteapikey.ts - - src/sdk/models/operations/deletecompany.ts - - src/sdk/models/operations/deleteconnection.ts - - src/sdk/models/operations/deletewebhookconsumer.ts - - src/sdk/models/operations/getcompany.ts - - src/sdk/models/operations/getcompanyaccesstoken.ts - - src/sdk/models/operations/getcompanydatastatus.ts - - src/sdk/models/operations/getcompanypushhistory.ts - - src/sdk/models/operations/getconnection.ts - - src/sdk/models/operations/getconnectionmanagementaccesstoken.ts - - src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts - - src/sdk/models/operations/getcustomdatatypeconfiguration.ts - - src/sdk/models/operations/getintegration.ts - - src/sdk/models/operations/getintegrationsbranding.ts - - src/sdk/models/operations/getpulloperation.ts - - src/sdk/models/operations/getpushoperation.ts - - src/sdk/models/operations/getreadvalidationresults.ts - - src/sdk/models/operations/getsupplementaldataconfiguration.ts - - src/sdk/models/operations/index.ts - - src/sdk/models/operations/listcompanies.ts - - src/sdk/models/operations/listconnections.ts - - src/sdk/models/operations/listcustomdatatyperecords.ts - - src/sdk/models/operations/listintegrations.ts - - src/sdk/models/operations/listpulloperations.ts - - src/sdk/models/operations/refreshcompanydata.ts - - src/sdk/models/operations/refreshcustomdatatype.ts - - src/sdk/models/operations/refreshdatatype.ts - - src/sdk/models/operations/refreshproductdata.ts - - src/sdk/models/operations/removeproduct.ts - - src/sdk/models/operations/replacecompany.ts - - src/sdk/models/operations/unlinkconnection.ts - - src/sdk/models/operations/updatecompany.ts - - src/sdk/models/operations/updateconnectionauthorization.ts - - src/sdk/models/operations/updateprofilesyncsettings.ts - - src/sdk/models/shared/apikeydetails.ts - - src/sdk/models/shared/apikeys.ts - - src/sdk/models/shared/branding.ts - - src/sdk/models/shared/brandingbutton.ts - - src/sdk/models/shared/brandingimage.ts - - src/sdk/models/shared/brandinglogo.ts - - src/sdk/models/shared/clientratelimitwebhook.ts - - src/sdk/models/shared/clientratelimitwebhookpayload.ts - - src/sdk/models/shared/companies.ts - - src/sdk/models/shared/company.ts - - src/sdk/models/shared/companyaccesstoken.ts - - src/sdk/models/shared/companydetails.ts - - src/sdk/models/shared/companyreference.ts - - src/sdk/models/shared/companyrequestbody.ts - - src/sdk/models/shared/companyupdaterequest.ts - - src/sdk/models/shared/companywebhook.ts - - src/sdk/models/shared/connection.ts - - src/sdk/models/shared/connectionmanagementaccesstoken.ts - - src/sdk/models/shared/connectionmanagementallowedorigins.ts - - src/sdk/models/shared/connections.ts - - src/sdk/models/shared/connectionwebhook.ts - - src/sdk/models/shared/connectionwebhookpayload.ts - - src/sdk/models/shared/createapikey.ts - - src/sdk/models/shared/customdatatypeconfiguration.ts - - src/sdk/models/shared/customdatatyperecord.ts - - src/sdk/models/shared/customdatatyperecords.ts - - src/sdk/models/shared/dataconnectionerror.ts - - src/sdk/models/shared/dataconnectionstatus.ts - - src/sdk/models/shared/datastatus.ts - - src/sdk/models/shared/datastatuses.ts - - src/sdk/models/shared/datatype.ts - - src/sdk/models/shared/datatypefeature.ts - - src/sdk/models/shared/datatypereadsummary.ts - - src/sdk/models/shared/datatypewritewebhook.ts - - src/sdk/models/shared/datatypewritewebhookpayload.ts - - src/sdk/models/shared/datatypewritewebhookrecord.ts - - src/sdk/models/shared/errormessage.ts - - src/sdk/models/shared/errorvalidation.ts - - src/sdk/models/shared/errorvalidationitem.ts - - src/sdk/models/shared/featurestate.ts - - src/sdk/models/shared/featuretype.ts - - src/sdk/models/shared/halref.ts - - src/sdk/models/shared/imagereference.ts - - src/sdk/models/shared/index.ts - - src/sdk/models/shared/integration.ts - - src/sdk/models/shared/integrations.ts - - src/sdk/models/shared/links.ts - - src/sdk/models/shared/profile.ts - - src/sdk/models/shared/pulloperation.ts - - src/sdk/models/shared/pulloperations.ts - - src/sdk/models/shared/pushchangetype.ts - - src/sdk/models/shared/pushfieldvalidation.ts - - src/sdk/models/shared/pushoperation.ts - - src/sdk/models/shared/pushoperationchange.ts - - src/sdk/models/shared/pushoperationref.ts - - src/sdk/models/shared/pushoperations.ts - - src/sdk/models/shared/pushoperationstatus.ts - - src/sdk/models/shared/pushoption.ts - - src/sdk/models/shared/pushoptionchoice.ts - - src/sdk/models/shared/pushoptionproperty.ts - - src/sdk/models/shared/pushoptiontype.ts - - src/sdk/models/shared/pushvalidationinfo.ts - - src/sdk/models/shared/readcompletedwebhook.ts - - src/sdk/models/shared/readcompletedwebhookpayload.ts - - src/sdk/models/shared/security.ts - - src/sdk/models/shared/sourcetype.ts - - src/sdk/models/shared/status.ts - - src/sdk/models/shared/supplementaldataconfiguration.ts - - src/sdk/models/shared/supportedfeature.ts - - src/sdk/models/shared/syncsetting.ts - - src/sdk/models/shared/syncsettings.ts - - src/sdk/models/shared/updateconnectionstatus.ts - - src/sdk/models/shared/validation.ts - - src/sdk/models/shared/validationitem.ts - - src/sdk/models/shared/validationitem1.ts - - src/sdk/models/shared/validationresult.ts - - src/sdk/models/shared/webhookconsumer.ts - - src/sdk/models/shared/webhookconsumerprototype.ts - - src/sdk/models/shared/webhookconsumers.ts - - src/sdk/models/shared/writestatus.ts - - src/sdk/models/shared/writetype.ts - - src/sdk/pushdata.ts - - src/sdk/readdata.ts - - src/sdk/refreshdata.ts - - src/sdk/sdk.ts - - src/sdk/settings.ts - - src/sdk/supplementaldata.ts - - src/sdk/types/async.ts - - src/sdk/types/blobs.ts - - src/sdk/types/constdatetime.ts - - src/sdk/types/enums.ts - - src/sdk/types/fp.ts - - src/sdk/types/index.ts - - src/sdk/types/operations.ts - - src/sdk/types/rfcdate.ts - - src/sdk/types/streams.ts - - src/sdk/types/webhooks.ts - - src/sdk/webhooks.ts - - tsconfig.json diff --git a/platform/.speakeasy/gen.yaml b/platform/.speakeasy/gen.yaml deleted file mode 100644 index 47ab6a27d..000000000 --- a/platform/.speakeasy/gen.yaml +++ /dev/null @@ -1,90 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: CodatPlatform - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - sdkInitStyle: constructor - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false - sharedNestedComponentsJan2026: false - nameOverrideFeb2026: false - auth: - oAuth2ClientCredentialsEnabled: false - oAuth2PasswordEnabled: false - hoistGlobalSecurity: true - schemas: - allOfMergeStrategy: shallowMerge - requestBodyFieldName: "" - versioningStrategy: automatic - persistentEdits: {} - tests: - generateTests: true - generateNewTests: false - skipResponseBodyAssertions: false -typescript: - version: 6.2.1 - acceptHeaderEnum: true - additionalDependencies: - dependencies: {} - devDependencies: {} - peerDependencies: {} - additionalPackageJSON: {} - additionalScripts: {} - alwaysIncludeInboundAndOutbound: false - author: Codat - baseErrorName: CodatPlatformError - clientServerStatusCodesAsErrors: true - constFieldsAlwaysOptional: false - defaultErrorName: SDKError - description: Manage the building blocks of Codat, including companies, connections, and more. - enableCustomCodeRegions: false - enableMCPServer: false - enableReactQuery: false - enumFormat: union - exportZodModelNamespace: false - fixEnumNameSanitization: false - flatAdditionalProperties: false - flattenGlobalSecurity: true - flatteningOrder: body-first - formStringArrayEncodeMode: encoded-string - forwardCompatibleEnumsByDefault: false - forwardCompatibleUnionsByDefault: "false" - generateExamples: true - imports: - option: openapi - paths: - callbacks: sdk/models/callbacks - errors: sdk/models/errors - operations: sdk/models/operations - shared: sdk/models/shared - webhooks: sdk/models/webhooks - inferUnionDiscriminators: true - inputModelSuffix: input - jsonpath: legacy - laxMode: strict - legacyFileNaming: true - maxMethodParams: 0 - methodArguments: infer-optional-args - modelPropertyCasing: camel - moduleFormat: commonjs - multipartArrayFormat: legacy - outputModelSuffix: output - packageName: '@codat/platform' - preApplyUnionDiscriminators: true - preserveModelFieldNames: false - responseFormat: flat - sseFlatResponse: false - templateVersion: v2 - unionStrategy: left-to-right - usageSDKInitImports: [] - useIndexModules: true - useOxlint: false - useTsgo: false - zodVersion: v3 diff --git a/platform/RELEASES.md b/platform/RELEASES.md index 197a72368..a684f074a 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-08-05 19:30:19 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml +- codat sdk-codegen 1b5626f25df09d713121c5e8a048d9b44b3b7178 https://github.com/codat-spikes/sdk-codegen +### Generated +- [typescript v6.2.2] platform +### Releases +- [NPM v6.2.2] https://www.npmjs.com/package/@codat/platform/v/6.2.2 - platform diff --git a/platform/USAGE.md b/platform/USAGE.md index 434db3b1e..23ea46d80 100644 --- a/platform/USAGE.md +++ b/platform/USAGE.md @@ -1,22 +1,21 @@ - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); - -``` + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` \ No newline at end of file diff --git a/platform/docs/lib/utils/retryconfig.md b/platform/docs/lib/utils/retryconfig.md index 08f95f455..69da01b9f 100644 --- a/platform/docs/lib/utils/retryconfig.md +++ b/platform/docs/lib/utils/retryconfig.md @@ -1,24 +1,24 @@ -# RetryConfig - -Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. - -## Fields - -| Name | Type | Description | Example | -| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | -| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | -| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | -| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | - -## BackoffStrategy - -The backoff strategy allows retrying a request with an exponential backoff between each retry. - -### Fields - -| Name | Type | Description | Example | -| ------------------ | ------------ | ----------------------------------------- | -------- | -| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | -| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | -| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | | `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/platform/docs/sdk/models/errors/errormessage.md b/platform/docs/sdk/models/errors/errormessage.md index f1b3b9377..94109f18f 100644 --- a/platform/docs/sdk/models/errors/errormessage.md +++ b/platform/docs/sdk/models/errors/errormessage.md @@ -1,23 +1,21 @@ -# ErrorMessage - -Your `query` parameter was not correctly formed - -## Example Usage - -```typescript -import { ErrorMessage } from "@codat/platform/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | -| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | -| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | -| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +# ErrorMessage + +## Example Usage + +```typescript +import { ErrorMessage } from "@codat/platform/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | +| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | +| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | | `detailedErrorCode` | *number* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/addproductrequest.md b/platform/docs/sdk/models/operations/addproductrequest.md index 7093782a3..1cbb751b5 100644 --- a/platform/docs/sdk/models/operations/addproductrequest.md +++ b/platform/docs/sdk/models/operations/addproductrequest.md @@ -1,19 +1,19 @@ -# AddProductRequest - -## Example Usage - -```typescript -import { AddProductRequest } from "@codat/platform/sdk/models/operations"; - -let value: AddProductRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# AddProductRequest + +## Example Usage + +```typescript +import { AddProductRequest } from "@codat/platform/sdk/models/operations"; + +let value: AddProductRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `productIdentifier` | *string* | :heavy_check_mark: | Human-readable product identifier for a product. | **Example 1:** bank-feeds
**Example 2:** lending
**Example 3:** payables
**Example 4:** expenses | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/configurecustomdatatyperequest.md b/platform/docs/sdk/models/operations/configurecustomdatatyperequest.md index 3f3137f1c..f1b2118aa 100644 --- a/platform/docs/sdk/models/operations/configurecustomdatatyperequest.md +++ b/platform/docs/sdk/models/operations/configurecustomdatatyperequest.md @@ -1,20 +1,20 @@ -# ConfigureCustomDataTypeRequest - -## Example Usage - -```typescript -import { ConfigureCustomDataTypeRequest } from "@codat/platform/sdk/models/operations"; - -let value: ConfigureCustomDataTypeRequest = { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | -| `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | +# ConfigureCustomDataTypeRequest + +## Example Usage + +```typescript +import { ConfigureCustomDataTypeRequest } from "@codat/platform/sdk/models/operations"; + +let value: ConfigureCustomDataTypeRequest = { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +| `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | | `customDataTypeConfiguration` | [shared.CustomDataTypeConfiguration](../../../sdk/models/shared/customdatatypeconfiguration.md) | :heavy_minus_sign: | Custom data type configuration for the specified platform. | {
"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'",
"requiredData": {
"currencyCode": "$[*].currencyCode",
"id": "$[*].id",
"number": "$[*].number",
"orderDate": "$[*].orderDate",
"totalAmountExcludingTax": "$[*].totalAmountExcludingTax",
"totalTaxAmount": "$[*].totalTaxAmount",
"vendorName": "$[*].number"
},
"keyBy": [
"$[*].id"
],
"sourceModifiedDate": [
"$[*].lastModifiedDateTime"
]
} | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/configuresupplementaldatarequest.md b/platform/docs/sdk/models/operations/configuresupplementaldatarequest.md index e60f8ea7b..7a3d7eb45 100644 --- a/platform/docs/sdk/models/operations/configuresupplementaldatarequest.md +++ b/platform/docs/sdk/models/operations/configuresupplementaldatarequest.md @@ -1,20 +1,20 @@ -# ConfigureSupplementalDataRequest - -## Example Usage - -```typescript -import { ConfigureSupplementalDataRequest } from "@codat/platform/sdk/models/operations"; - -let value: ConfigureSupplementalDataRequest = { - platformKey: "gbol", - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | -| `dataType` | [operations.DataType](../../../sdk/models/operations/datatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | +# ConfigureSupplementalDataRequest + +## Example Usage + +```typescript +import { ConfigureSupplementalDataRequest } from "@codat/platform/sdk/models/operations"; + +let value: ConfigureSupplementalDataRequest = { + platformKey: "gbol", + dataType: "invoices", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | | `supplementalDataConfiguration` | [shared.SupplementalDataConfiguration](../../../sdk/models/shared/supplementaldataconfiguration.md) | :heavy_minus_sign: | The configuration for the specified platform and data type. | {
"supplementalDataConfig": {
"orders-supplemental-data": {
"dataSource": "/orders",
"pullData": {
"orderNumber": "order_num"
},
"pushData": {
"orderNumber": "order_num"
}
}
}
} | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/createconnectionrequest.md b/platform/docs/sdk/models/operations/createconnectionrequest.md index 8869a9cc3..5b1d13b89 100644 --- a/platform/docs/sdk/models/operations/createconnectionrequest.md +++ b/platform/docs/sdk/models/operations/createconnectionrequest.md @@ -1,18 +1,18 @@ -# CreateConnectionRequest - -## Example Usage - -```typescript -import { CreateConnectionRequest } from "@codat/platform/sdk/models/operations"; - -let value: CreateConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateConnectionRequest + +## Example Usage + +```typescript +import { CreateConnectionRequest } from "@codat/platform/sdk/models/operations"; + +let value: CreateConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [operations.CreateConnectionRequestBody](../../../sdk/models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/createconnectionrequestbody.md b/platform/docs/sdk/models/operations/createconnectionrequestbody.md index a21ed4587..0b2b594a4 100644 --- a/platform/docs/sdk/models/operations/createconnectionrequestbody.md +++ b/platform/docs/sdk/models/operations/createconnectionrequestbody.md @@ -1,17 +1,17 @@ -# CreateConnectionRequestBody - -## Example Usage - -```typescript -import { CreateConnectionRequestBody } from "@codat/platform/sdk/models/operations"; - -let value: CreateConnectionRequestBody = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# CreateConnectionRequestBody + +## Example Usage + +```typescript +import { CreateConnectionRequestBody } from "@codat/platform/sdk/models/operations"; + +let value: CreateConnectionRequestBody = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `platformKey` | *string* | :heavy_minus_sign: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/datatype.md b/platform/docs/sdk/models/operations/datatype.md index bec60751b..5322a40a0 100644 --- a/platform/docs/sdk/models/operations/datatype.md +++ b/platform/docs/sdk/models/operations/datatype.md @@ -1,17 +1,17 @@ -# DataType - -Data types that support supplemental data - -## Example Usage - -```typescript -import { DataType } from "@codat/platform/sdk/models/operations"; - -let value: DataType = "invoices"; -``` - -## Values - -```typescript -"chartOfAccounts" | "bills" | "company" | "creditNotes" | "customers" | "invoices" | "items" | "journalEntries" | "suppliers" | "taxRates" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-payments" | "commerce-paymentMethods" | "commerce-products" | "commerce-productCategories" | "commerce-taxComponents" | "commerce-transactions" +# DataType + +Available data types + +## Example Usage + +```typescript +import { DataType } from "@codat/platform/sdk/models/operations"; + +let value: DataType = "accountTransactions"; +``` + +## Values + +```typescript +"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/deleteapikeyrequest.md b/platform/docs/sdk/models/operations/deleteapikeyrequest.md index 1c8d9a20a..a1d870e7a 100644 --- a/platform/docs/sdk/models/operations/deleteapikeyrequest.md +++ b/platform/docs/sdk/models/operations/deleteapikeyrequest.md @@ -1,17 +1,17 @@ -# DeleteApiKeyRequest - -## Example Usage - -```typescript -import { DeleteApiKeyRequest } from "@codat/platform/sdk/models/operations"; - -let value: DeleteApiKeyRequest = { - apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# DeleteApiKeyRequest + +## Example Usage + +```typescript +import { DeleteApiKeyRequest } from "@codat/platform/sdk/models/operations"; + +let value: DeleteApiKeyRequest = { + apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `apiKeyId` | *string* | :heavy_check_mark: | Unique identifier for api key. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/deletecompanyrequest.md b/platform/docs/sdk/models/operations/deletecompanyrequest.md index f156366c8..82d090d1b 100644 --- a/platform/docs/sdk/models/operations/deletecompanyrequest.md +++ b/platform/docs/sdk/models/operations/deletecompanyrequest.md @@ -1,17 +1,17 @@ -# DeleteCompanyRequest - -## Example Usage - -```typescript -import { DeleteCompanyRequest } from "@codat/platform/sdk/models/operations"; - -let value: DeleteCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# DeleteCompanyRequest + +## Example Usage + +```typescript +import { DeleteCompanyRequest } from "@codat/platform/sdk/models/operations"; + +let value: DeleteCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/deleteconnectionrequest.md b/platform/docs/sdk/models/operations/deleteconnectionrequest.md index 9ef310cfe..8fa6f85b2 100644 --- a/platform/docs/sdk/models/operations/deleteconnectionrequest.md +++ b/platform/docs/sdk/models/operations/deleteconnectionrequest.md @@ -1,19 +1,19 @@ -# DeleteConnectionRequest - -## Example Usage - -```typescript -import { DeleteConnectionRequest } from "@codat/platform/sdk/models/operations"; - -let value: DeleteConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# DeleteConnectionRequest + +## Example Usage + +```typescript +import { DeleteConnectionRequest } from "@codat/platform/sdk/models/operations"; + +let value: DeleteConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/deletewebhookconsumerrequest.md b/platform/docs/sdk/models/operations/deletewebhookconsumerrequest.md index 178d2dd30..d3874002c 100644 --- a/platform/docs/sdk/models/operations/deletewebhookconsumerrequest.md +++ b/platform/docs/sdk/models/operations/deletewebhookconsumerrequest.md @@ -1,17 +1,17 @@ -# DeleteWebhookConsumerRequest - -## Example Usage - -```typescript -import { DeleteWebhookConsumerRequest } from "@codat/platform/sdk/models/operations"; - -let value: DeleteWebhookConsumerRequest = { - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +# DeleteWebhookConsumerRequest + +## Example Usage + +```typescript +import { DeleteWebhookConsumerRequest } from "@codat/platform/sdk/models/operations"; + +let value: DeleteWebhookConsumerRequest = { + webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | | `webhookId` | *string* | :heavy_check_mark: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcompanyaccesstokenrequest.md b/platform/docs/sdk/models/operations/getcompanyaccesstokenrequest.md index 620ef3ef6..0e398a944 100644 --- a/platform/docs/sdk/models/operations/getcompanyaccesstokenrequest.md +++ b/platform/docs/sdk/models/operations/getcompanyaccesstokenrequest.md @@ -1,17 +1,17 @@ -# GetCompanyAccessTokenRequest - -## Example Usage - -```typescript -import { GetCompanyAccessTokenRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCompanyAccessTokenRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyAccessTokenRequest + +## Example Usage + +```typescript +import { GetCompanyAccessTokenRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCompanyAccessTokenRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcompanydatastatusrequest.md b/platform/docs/sdk/models/operations/getcompanydatastatusrequest.md index e9052affa..1a1df1c25 100644 --- a/platform/docs/sdk/models/operations/getcompanydatastatusrequest.md +++ b/platform/docs/sdk/models/operations/getcompanydatastatusrequest.md @@ -1,17 +1,17 @@ -# GetCompanyDataStatusRequest - -## Example Usage - -```typescript -import { GetCompanyDataStatusRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCompanyDataStatusRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyDataStatusRequest + +## Example Usage + +```typescript +import { GetCompanyDataStatusRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCompanyDataStatusRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcompanypushhistoryrequest.md b/platform/docs/sdk/models/operations/getcompanypushhistoryrequest.md index 7644238a3..e869a48c0 100644 --- a/platform/docs/sdk/models/operations/getcompanypushhistoryrequest.md +++ b/platform/docs/sdk/models/operations/getcompanypushhistoryrequest.md @@ -1,23 +1,23 @@ -# GetCompanyPushHistoryRequest - -## Example Usage - -```typescript -import { GetCompanyPushHistoryRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCompanyPushHistoryRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# GetCompanyPushHistoryRequest + +## Example Usage + +```typescript +import { GetCompanyPushHistoryRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCompanyPushHistoryRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcompanyrequest.md b/platform/docs/sdk/models/operations/getcompanyrequest.md index 641698318..d8eb831b0 100644 --- a/platform/docs/sdk/models/operations/getcompanyrequest.md +++ b/platform/docs/sdk/models/operations/getcompanyrequest.md @@ -1,17 +1,17 @@ -# GetCompanyRequest - -## Example Usage - -```typescript -import { GetCompanyRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyRequest + +## Example Usage + +```typescript +import { GetCompanyRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcompanysyncsettingsrequest.md b/platform/docs/sdk/models/operations/getcompanysyncsettingsrequest.md index 4291d93bd..52f6ab266 100644 --- a/platform/docs/sdk/models/operations/getcompanysyncsettingsrequest.md +++ b/platform/docs/sdk/models/operations/getcompanysyncsettingsrequest.md @@ -1,17 +1,17 @@ -# GetCompanySyncSettingsRequest - -## Example Usage - -```typescript -import { GetCompanySyncSettingsRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCompanySyncSettingsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanySyncSettingsRequest + +## Example Usage + +```typescript +import { GetCompanySyncSettingsRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCompanySyncSettingsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md b/platform/docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md index cee933bca..9452fd880 100644 --- a/platform/docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md +++ b/platform/docs/sdk/models/operations/getconnectionmanagementaccesstokenrequest.md @@ -1,17 +1,17 @@ -# GetConnectionManagementAccessTokenRequest - -## Example Usage - -```typescript -import { GetConnectionManagementAccessTokenRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetConnectionManagementAccessTokenRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetConnectionManagementAccessTokenRequest + +## Example Usage + +```typescript +import { GetConnectionManagementAccessTokenRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetConnectionManagementAccessTokenRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getconnectionrequest.md b/platform/docs/sdk/models/operations/getconnectionrequest.md index 8cf868420..84b2909de 100644 --- a/platform/docs/sdk/models/operations/getconnectionrequest.md +++ b/platform/docs/sdk/models/operations/getconnectionrequest.md @@ -1,19 +1,19 @@ -# GetConnectionRequest - -## Example Usage - -```typescript -import { GetConnectionRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetConnectionRequest + +## Example Usage + +```typescript +import { GetConnectionRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md b/platform/docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md index c0d7bc4fa..8f8feed7c 100644 --- a/platform/docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md +++ b/platform/docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md @@ -1,21 +1,21 @@ -# GetCreateUpdateModelOptionsByDataTypeRequest - -## Example Usage - -```typescript -import { GetCreateUpdateModelOptionsByDataTypeRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCreateUpdateModelOptionsByDataTypeRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# GetCreateUpdateModelOptionsByDataTypeRequest + +## Example Usage + +```typescript +import { GetCreateUpdateModelOptionsByDataTypeRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCreateUpdateModelOptionsByDataTypeRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + dataType: "invoices", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `dataType` | [shared.SchemaDataType](../../../sdk/models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type. | invoices | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md b/platform/docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md index 51628b94e..473c58c02 100644 --- a/platform/docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md +++ b/platform/docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md @@ -1,19 +1,19 @@ -# GetCustomDataTypeConfigurationRequest - -## Example Usage - -```typescript -import { GetCustomDataTypeConfigurationRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetCustomDataTypeConfigurationRequest = { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +# GetCustomDataTypeConfigurationRequest + +## Example Usage + +```typescript +import { GetCustomDataTypeConfigurationRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetCustomDataTypeConfigurationRequest = { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | | `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getintegrationrequest.md b/platform/docs/sdk/models/operations/getintegrationrequest.md index d94506c86..097e2495b 100644 --- a/platform/docs/sdk/models/operations/getintegrationrequest.md +++ b/platform/docs/sdk/models/operations/getintegrationrequest.md @@ -1,17 +1,17 @@ -# GetIntegrationRequest - -## Example Usage - -```typescript -import { GetIntegrationRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetIntegrationRequest = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +# GetIntegrationRequest + +## Example Usage + +```typescript +import { GetIntegrationRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetIntegrationRequest = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getintegrationsbrandingrequest.md b/platform/docs/sdk/models/operations/getintegrationsbrandingrequest.md index 869ecc864..4baa33066 100644 --- a/platform/docs/sdk/models/operations/getintegrationsbrandingrequest.md +++ b/platform/docs/sdk/models/operations/getintegrationsbrandingrequest.md @@ -1,17 +1,17 @@ -# GetIntegrationsBrandingRequest - -## Example Usage - -```typescript -import { GetIntegrationsBrandingRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetIntegrationsBrandingRequest = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +# GetIntegrationsBrandingRequest + +## Example Usage + +```typescript +import { GetIntegrationsBrandingRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetIntegrationsBrandingRequest = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getpulloperationrequest.md b/platform/docs/sdk/models/operations/getpulloperationrequest.md index 23baf909e..2c8dace77 100644 --- a/platform/docs/sdk/models/operations/getpulloperationrequest.md +++ b/platform/docs/sdk/models/operations/getpulloperationrequest.md @@ -1,19 +1,18 @@ -# GetPullOperationRequest - -## Example Usage - -```typescript -import { GetPullOperationRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetPullOperationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "2e524c49-3726-44e5-9563-576172cc15aa", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetPullOperationRequest + +## Example Usage + +```typescript +import { GetPullOperationRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetPullOperationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `datasetId` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getpushoperationrequest.md b/platform/docs/sdk/models/operations/getpushoperationrequest.md index 1dbda6bc5..7d3677de1 100644 --- a/platform/docs/sdk/models/operations/getpushoperationrequest.md +++ b/platform/docs/sdk/models/operations/getpushoperationrequest.md @@ -1,19 +1,18 @@ -# GetPushOperationRequest - -## Example Usage - -```typescript -import { GetPushOperationRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetPushOperationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "14a4a880-31a4-4db5-88cb-40c00b392985", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetPushOperationRequest + +## Example Usage + +```typescript +import { GetPushOperationRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetPushOperationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `pushOperationKey` | *string* | :heavy_check_mark: | Push operation key. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getreadvalidationresultsrequest.md b/platform/docs/sdk/models/operations/getreadvalidationresultsrequest.md index 5db180c1f..1882f053d 100644 --- a/platform/docs/sdk/models/operations/getreadvalidationresultsrequest.md +++ b/platform/docs/sdk/models/operations/getreadvalidationresultsrequest.md @@ -1,19 +1,18 @@ -# GetReadValidationResultsRequest - -## Example Usage - -```typescript -import { GetReadValidationResultsRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetReadValidationResultsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "1de8e25b-3163-4226-821d-24f258b2878d", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetReadValidationResultsRequest + +## Example Usage + +```typescript +import { GetReadValidationResultsRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetReadValidationResultsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `datasetId` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md b/platform/docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md index eb20d89bf..dd35fdc2c 100644 --- a/platform/docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md +++ b/platform/docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md @@ -1,19 +1,19 @@ -# GetSupplementalDataConfigurationRequest - -## Example Usage - -```typescript -import { GetSupplementalDataConfigurationRequest } from "@codat/platform/sdk/models/operations"; - -let value: GetSupplementalDataConfigurationRequest = { - platformKey: "gbol", - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +# GetSupplementalDataConfigurationRequest + +## Example Usage + +```typescript +import { GetSupplementalDataConfigurationRequest } from "@codat/platform/sdk/models/operations"; + +let value: GetSupplementalDataConfigurationRequest = { + platformKey: "gbol", + dataType: "invoices", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `platformKey` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | | `dataType` | [operations.PathParamDataType](../../../sdk/models/operations/pathparamdatatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/listcompaniesrequest.md b/platform/docs/sdk/models/operations/listcompaniesrequest.md index fe713e6c9..5185a5605 100644 --- a/platform/docs/sdk/models/operations/listcompaniesrequest.md +++ b/platform/docs/sdk/models/operations/listcompaniesrequest.md @@ -1,23 +1,23 @@ -# ListCompaniesRequest - -## Example Usage - -```typescript -import { ListCompaniesRequest } from "@codat/platform/sdk/models/operations"; - -let value: ListCompaniesRequest = { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +# ListCompaniesRequest + +## Example Usage + +```typescript +import { ListCompaniesRequest } from "@codat/platform/sdk/models/operations"; + +let value: ListCompaniesRequest = { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `tags` | *string* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/listconnectionsrequest.md b/platform/docs/sdk/models/operations/listconnectionsrequest.md index 2797ca885..b234577eb 100644 --- a/platform/docs/sdk/models/operations/listconnectionsrequest.md +++ b/platform/docs/sdk/models/operations/listconnectionsrequest.md @@ -1,23 +1,23 @@ -# ListConnectionsRequest - -## Example Usage - -```typescript -import { ListConnectionsRequest } from "@codat/platform/sdk/models/operations"; - -let value: ListConnectionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListConnectionsRequest + +## Example Usage + +```typescript +import { ListConnectionsRequest } from "@codat/platform/sdk/models/operations"; + +let value: ListConnectionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/listcustomdatatyperecordsrequest.md b/platform/docs/sdk/models/operations/listcustomdatatyperecordsrequest.md index 8cd37e0d2..c8311b455 100644 --- a/platform/docs/sdk/models/operations/listcustomdatatyperecordsrequest.md +++ b/platform/docs/sdk/models/operations/listcustomdatatyperecordsrequest.md @@ -1,23 +1,23 @@ -# ListCustomDataTypeRecordsRequest - -## Example Usage - -```typescript -import { ListCustomDataTypeRecordsRequest } from "@codat/platform/sdk/models/operations"; - -let value: ListCustomDataTypeRecordsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +# ListCustomDataTypeRecordsRequest + +## Example Usage + +```typescript +import { ListCustomDataTypeRecordsRequest } from "@codat/platform/sdk/models/operations"; + +let value: ListCustomDataTypeRecordsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/listintegrationsrequest.md b/platform/docs/sdk/models/operations/listintegrationsrequest.md index 6cd2771d6..044d710ff 100644 --- a/platform/docs/sdk/models/operations/listintegrationsrequest.md +++ b/platform/docs/sdk/models/operations/listintegrationsrequest.md @@ -1,21 +1,21 @@ -# ListIntegrationsRequest - -## Example Usage - -```typescript -import { ListIntegrationsRequest } from "@codat/platform/sdk/models/operations"; - -let value: ListIntegrationsRequest = { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListIntegrationsRequest + +## Example Usage + +```typescript +import { ListIntegrationsRequest } from "@codat/platform/sdk/models/operations"; + +let value: ListIntegrationsRequest = { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/listpulloperationsrequest.md b/platform/docs/sdk/models/operations/listpulloperationsrequest.md index f879acbb7..b0af810de 100644 --- a/platform/docs/sdk/models/operations/listpulloperationsrequest.md +++ b/platform/docs/sdk/models/operations/listpulloperationsrequest.md @@ -1,23 +1,23 @@ -# ListPullOperationsRequest - -## Example Usage - -```typescript -import { ListPullOperationsRequest } from "@codat/platform/sdk/models/operations"; - -let value: ListPullOperationsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListPullOperationsRequest + +## Example Usage + +```typescript +import { ListPullOperationsRequest } from "@codat/platform/sdk/models/operations"; + +let value: ListPullOperationsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/pathparamdatatype.md b/platform/docs/sdk/models/operations/pathparamdatatype.md index a5c62e402..695ff1a18 100644 --- a/platform/docs/sdk/models/operations/pathparamdatatype.md +++ b/platform/docs/sdk/models/operations/pathparamdatatype.md @@ -1,17 +1,15 @@ -# PathParamDataType - -Data types that support supplemental data - -## Example Usage - -```typescript -import { PathParamDataType } from "@codat/platform/sdk/models/operations"; - -let value: PathParamDataType = "invoices"; -``` - -## Values - -```typescript -"chartOfAccounts" | "bills" | "company" | "creditNotes" | "customers" | "invoices" | "items" | "journalEntries" | "suppliers" | "taxRates" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-payments" | "commerce-paymentMethods" | "commerce-products" | "commerce-productCategories" | "commerce-taxComponents" | "commerce-transactions" +# PathParamDataType + +## Example Usage + +```typescript +import { PathParamDataType } from "@codat/platform/sdk/models/operations"; + +let value: PathParamDataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/refreshcompanydatarequest.md b/platform/docs/sdk/models/operations/refreshcompanydatarequest.md index 1db236eb8..1e7648f65 100644 --- a/platform/docs/sdk/models/operations/refreshcompanydatarequest.md +++ b/platform/docs/sdk/models/operations/refreshcompanydatarequest.md @@ -1,17 +1,17 @@ -# RefreshCompanyDataRequest - -## Example Usage - -```typescript -import { RefreshCompanyDataRequest } from "@codat/platform/sdk/models/operations"; - -let value: RefreshCompanyDataRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# RefreshCompanyDataRequest + +## Example Usage + +```typescript +import { RefreshCompanyDataRequest } from "@codat/platform/sdk/models/operations"; + +let value: RefreshCompanyDataRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/refreshcustomdatatyperequest.md b/platform/docs/sdk/models/operations/refreshcustomdatatyperequest.md index 64838d679..9845b19ec 100644 --- a/platform/docs/sdk/models/operations/refreshcustomdatatyperequest.md +++ b/platform/docs/sdk/models/operations/refreshcustomdatatyperequest.md @@ -1,21 +1,21 @@ -# RefreshCustomDataTypeRequest - -## Example Usage - -```typescript -import { RefreshCustomDataTypeRequest } from "@codat/platform/sdk/models/operations"; - -let value: RefreshCustomDataTypeRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# RefreshCustomDataTypeRequest + +## Example Usage + +```typescript +import { RefreshCustomDataTypeRequest } from "@codat/platform/sdk/models/operations"; + +let value: RefreshCustomDataTypeRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `customDataIdentifier` | *string* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/refreshdatatyperequest.md b/platform/docs/sdk/models/operations/refreshdatatyperequest.md index db7d28720..7b30935a5 100644 --- a/platform/docs/sdk/models/operations/refreshdatatyperequest.md +++ b/platform/docs/sdk/models/operations/refreshdatatyperequest.md @@ -1,20 +1,20 @@ -# RefreshDataTypeRequest - -## Example Usage - -```typescript -import { RefreshDataTypeRequest } from "@codat/platform/sdk/models/operations"; - -let value: RefreshDataTypeRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `dataType` | [shared.SchemaDataType](../../../sdk/models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type. | invoices | +# RefreshDataTypeRequest + +## Example Usage + +```typescript +import { RefreshDataTypeRequest } from "@codat/platform/sdk/models/operations"; + +let value: RefreshDataTypeRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataType` | [shared.SchemaDataType](../../../sdk/models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type. | invoices | | `connectionId` | *string* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/refreshproductdatarequest.md b/platform/docs/sdk/models/operations/refreshproductdatarequest.md index 8bf3e5520..f09b5a276 100644 --- a/platform/docs/sdk/models/operations/refreshproductdatarequest.md +++ b/platform/docs/sdk/models/operations/refreshproductdatarequest.md @@ -1,20 +1,20 @@ -# RefreshProductDataRequest - -## Example Usage - -```typescript -import { RefreshProductDataRequest } from "@codat/platform/sdk/models/operations"; - -let value: RefreshProductDataRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `productIdentifier` | *string* | :heavy_check_mark: | Human-readable product identifier for a product. | **Example 1:** bank-feeds
**Example 2:** lending
**Example 3:** payables
**Example 4:** expenses | +# RefreshProductDataRequest + +## Example Usage + +```typescript +import { RefreshProductDataRequest } from "@codat/platform/sdk/models/operations"; + +let value: RefreshProductDataRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `productIdentifier` | *string* | :heavy_check_mark: | Human-readable product identifier for a product. | **Example 1:** bank-feeds
**Example 2:** lending
**Example 3:** payables
**Example 4:** expenses | | `requestBody` | [operations.RefreshProductDataRequestBody](../../../sdk/models/operations/refreshproductdatarequestbody.md) | :heavy_minus_sign: | Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/refreshproductdatarequestbody.md b/platform/docs/sdk/models/operations/refreshproductdatarequestbody.md index 6c390fd3e..ad6add90b 100644 --- a/platform/docs/sdk/models/operations/refreshproductdatarequestbody.md +++ b/platform/docs/sdk/models/operations/refreshproductdatarequestbody.md @@ -1,17 +1,17 @@ -# RefreshProductDataRequestBody - -Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product. - -## Example Usage - -```typescript -import { RefreshProductDataRequestBody } from "@codat/platform/sdk/models/operations"; - -let value: RefreshProductDataRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +# RefreshProductDataRequestBody + +Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product. + +## Example Usage + +```typescript +import { RefreshProductDataRequestBody } from "@codat/platform/sdk/models/operations"; + +let value: RefreshProductDataRequestBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | `dataTypes` | *string*[] | :heavy_minus_sign: | One or more data types to refresh for the product. | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/removeproductrequest.md b/platform/docs/sdk/models/operations/removeproductrequest.md index 33db4566d..bf91f6fd5 100644 --- a/platform/docs/sdk/models/operations/removeproductrequest.md +++ b/platform/docs/sdk/models/operations/removeproductrequest.md @@ -1,19 +1,19 @@ -# RemoveProductRequest - -## Example Usage - -```typescript -import { RemoveProductRequest } from "@codat/platform/sdk/models/operations"; - -let value: RemoveProductRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# RemoveProductRequest + +## Example Usage + +```typescript +import { RemoveProductRequest } from "@codat/platform/sdk/models/operations"; + +let value: RemoveProductRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `productIdentifier` | *string* | :heavy_check_mark: | Human-readable product identifier for a product. | **Example 1:** bank-feeds
**Example 2:** lending
**Example 3:** payables
**Example 4:** expenses | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/replacecompanyrequest.md b/platform/docs/sdk/models/operations/replacecompanyrequest.md index 1b833476e..00a2d3269 100644 --- a/platform/docs/sdk/models/operations/replacecompanyrequest.md +++ b/platform/docs/sdk/models/operations/replacecompanyrequest.md @@ -1,18 +1,18 @@ -# ReplaceCompanyRequest - -## Example Usage - -```typescript -import { ReplaceCompanyRequest } from "@codat/platform/sdk/models/operations"; - -let value: ReplaceCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# ReplaceCompanyRequest + +## Example Usage + +```typescript +import { ReplaceCompanyRequest } from "@codat/platform/sdk/models/operations"; + +let value: ReplaceCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyRequestBody` | [shared.CompanyRequestBody](../../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/setcompanysyncsettingsrequest.md b/platform/docs/sdk/models/operations/setcompanysyncsettingsrequest.md index 4d3e26372..0625296fb 100644 --- a/platform/docs/sdk/models/operations/setcompanysyncsettingsrequest.md +++ b/platform/docs/sdk/models/operations/setcompanysyncsettingsrequest.md @@ -1,18 +1,18 @@ -# SetCompanySyncSettingsRequest - -## Example Usage - -```typescript -import { SetCompanySyncSettingsRequest } from "@codat/platform/sdk/models/operations"; - -let value: SetCompanySyncSettingsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# SetCompanySyncSettingsRequest + +## Example Usage + +```typescript +import { SetCompanySyncSettingsRequest } from "@codat/platform/sdk/models/operations"; + +let value: SetCompanySyncSettingsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [operations.SetCompanySyncSettingsRequestBody](../../../sdk/models/operations/setcompanysyncsettingsrequestbody.md) | :heavy_minus_sign: | Include a `syncSetting` object for each data type.
`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/setcompanysyncsettingsrequestbody.md b/platform/docs/sdk/models/operations/setcompanysyncsettingsrequestbody.md index 8604fc1c5..0faef8866 100644 --- a/platform/docs/sdk/models/operations/setcompanysyncsettingsrequestbody.md +++ b/platform/docs/sdk/models/operations/setcompanysyncsettingsrequestbody.md @@ -1,34 +1,34 @@ -# SetCompanySyncSettingsRequestBody - -Include a `syncSetting` object for each data type. -`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. - -## Example Usage - -```typescript -import { SetCompanySyncSettingsRequestBody } from "@codat/platform/sdk/models/operations"; - -let value: SetCompanySyncSettingsRequestBody = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_check_mark: | N/A | | +# SetCompanySyncSettingsRequestBody + +Include a `syncSetting` object for each data type. +`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. + +## Example Usage + +```typescript +import { SetCompanySyncSettingsRequestBody } from "@codat/platform/sdk/models/operations"; + +let value: SetCompanySyncSettingsRequestBody = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_check_mark: | N/A | | | `overridesDefaults` | *boolean* | :heavy_minus_sign: | Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/unlinkconnectionrequest.md b/platform/docs/sdk/models/operations/unlinkconnectionrequest.md index acbfdf8e9..c4f316259 100644 --- a/platform/docs/sdk/models/operations/unlinkconnectionrequest.md +++ b/platform/docs/sdk/models/operations/unlinkconnectionrequest.md @@ -1,20 +1,20 @@ -# UnlinkConnectionRequest - -## Example Usage - -```typescript -import { UnlinkConnectionRequest } from "@codat/platform/sdk/models/operations"; - -let value: UnlinkConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +# UnlinkConnectionRequest + +## Example Usage + +```typescript +import { UnlinkConnectionRequest } from "@codat/platform/sdk/models/operations"; + +let value: UnlinkConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `updateConnectionStatus` | [shared.UpdateConnectionStatus](../../../sdk/models/shared/updateconnectionstatus.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/updatecompanyrequest.md b/platform/docs/sdk/models/operations/updatecompanyrequest.md index 6e565da9e..653c760e6 100644 --- a/platform/docs/sdk/models/operations/updatecompanyrequest.md +++ b/platform/docs/sdk/models/operations/updatecompanyrequest.md @@ -1,18 +1,18 @@ -# UpdateCompanyRequest - -## Example Usage - -```typescript -import { UpdateCompanyRequest } from "@codat/platform/sdk/models/operations"; - -let value: UpdateCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# UpdateCompanyRequest + +## Example Usage + +```typescript +import { UpdateCompanyRequest } from "@codat/platform/sdk/models/operations"; + +let value: UpdateCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyUpdateRequest` | [shared.CompanyUpdateRequest](../../../sdk/models/shared/companyupdaterequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/updateconnectionauthorizationrequest.md b/platform/docs/sdk/models/operations/updateconnectionauthorizationrequest.md index 0cf08d05f..9a8398fa3 100644 --- a/platform/docs/sdk/models/operations/updateconnectionauthorizationrequest.md +++ b/platform/docs/sdk/models/operations/updateconnectionauthorizationrequest.md @@ -1,20 +1,20 @@ -# UpdateConnectionAuthorizationRequest - -## Example Usage - -```typescript -import { UpdateConnectionAuthorizationRequest } from "@codat/platform/sdk/models/operations"; - -let value: UpdateConnectionAuthorizationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestBody` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file +# UpdateConnectionAuthorizationRequest + +## Example Usage + +```typescript +import { UpdateConnectionAuthorizationRequest } from "@codat/platform/sdk/models/operations"; + +let value: UpdateConnectionAuthorizationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestBody` | *any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md b/platform/docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md index 6f716e847..7ea5f0498 100644 --- a/platform/docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md +++ b/platform/docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md @@ -1,34 +1,34 @@ -# UpdateProfileSyncSettingsRequestBody - -Include a `syncSetting` object for each data type. -`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. - -## Example Usage - -```typescript -import { UpdateProfileSyncSettingsRequestBody } from "@codat/platform/sdk/models/operations"; - -let value: UpdateProfileSyncSettingsRequestBody = { - clientId: "eb0cba37-2d9a-4e1d-b267-f39dcdd04b92", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `clientId` | *string* | :heavy_check_mark: | Unique identifier for your client in Codat. | -| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_check_mark: | N/A | +# UpdateProfileSyncSettingsRequestBody + +Include a `syncSetting` object for each data type. +`syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. + +## Example Usage + +```typescript +import { UpdateProfileSyncSettingsRequestBody } from "@codat/platform/sdk/models/operations"; + +let value: UpdateProfileSyncSettingsRequestBody = { + clientId: "string", + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | *string* | :heavy_check_mark: | Unique identifier for your client in Codat. | +| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_check_mark: | N/A | | `overridesDefaults` | *boolean* | :heavy_minus_sign: | Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/apikeydetails.md b/platform/docs/sdk/models/shared/apikeydetails.md index d99ebeb3b..defcd85b4 100644 --- a/platform/docs/sdk/models/shared/apikeydetails.md +++ b/platform/docs/sdk/models/shared/apikeydetails.md @@ -1,25 +1,25 @@ -# ApiKeyDetails - -Details of the API key. - -## Example Usage - -```typescript -import { ApiKeyDetails } from "@codat/platform/sdk/models/shared"; - -let value: ApiKeyDetails = { - id: "e288a972-b402-4b21-93f9-b5335ae5679c", - name: "azure-invoice-finance-processor", - apiKey: "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", - createdDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for the API key. | e288a972-b402-4b21-93f9-b5335ae5679c | -| `name` | *string* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | -| `apiKey` | *string* | :heavy_minus_sign: | The API key value used to make authenticated http requests. | ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd | +# ApiKeyDetails + +Details of the API key. + +## Example Usage + +```typescript +import { ApiKeyDetails } from "@codat/platform/sdk/models/shared"; + +let value: ApiKeyDetails = { + id: "e288a972-b402-4b21-93f9-b5335ae5679c", + name: "azure-invoice-finance-processor", + apiKey: "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", + createdDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for the API key. | e288a972-b402-4b21-93f9-b5335ae5679c | +| `name` | *string* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | +| `apiKey` | *string* | :heavy_minus_sign: | The API key value used to make authenticated http requests. | ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd | | `createdDate` | *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/apikeys.md b/platform/docs/sdk/models/shared/apikeys.md index 689ff589d..7f341cd60 100644 --- a/platform/docs/sdk/models/shared/apikeys.md +++ b/platform/docs/sdk/models/shared/apikeys.md @@ -1,24 +1,15 @@ -# ApiKeys - -## Example Usage - -```typescript -import { ApiKeys } from "@codat/platform/sdk/models/shared"; - -let value: ApiKeys = { - results: [ - { - id: "e288a972-b402-4b21-93f9-b5335ae5679c", - name: "azure-invoice-finance-processor", - apiKey: "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", - createdDate: "2022-10-23T00:00:00Z", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +# ApiKeys + +## Example Usage + +```typescript +import { ApiKeys } from "@codat/platform/sdk/models/shared"; + +let value: ApiKeys = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | `results` | [shared.ApiKeyDetails](../../../sdk/models/shared/apikeydetails.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/branding.md b/platform/docs/sdk/models/shared/branding.md index 73e6a62d9..2ab65d0a5 100644 --- a/platform/docs/sdk/models/shared/branding.md +++ b/platform/docs/sdk/models/shared/branding.md @@ -1,51 +1,47 @@ -# Branding - -## Example Usage - -```typescript -import { Branding } from "@codat/platform/sdk/models/shared"; - -let value: Branding = { - logo: { - full: { - image: { - src: - "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", - alt: "xero full icon", - }, - }, - square: { - image: { - src: - "https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png", - alt: "xero square icon", - }, - }, - }, - button: { - default: { - image: { - src: - "https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png", - alt: "xero default button icon", - }, - }, - hover: { - image: { - src: - "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", - alt: "xero hover button icon", - }, - }, - }, - sourceId: "35b92968-9851-4095-ad60-395c95cbcba4", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `logo` | [shared.BrandingLogo](../../../sdk/models/shared/brandinglogo.md) | :heavy_minus_sign: | Logo branding references. | | -| `button` | [shared.BrandingButton](../../../sdk/models/shared/brandingbutton.md) | :heavy_minus_sign: | Button branding references. | | +# Branding + +## Example Usage + +```typescript +import { Branding } from "@codat/platform/sdk/models/shared"; + +let value: Branding = { + logo: { + full: { + image: { + src: "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", + alt: "xero full icon", + }, + }, + square: { + image: { + src: "https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png", + alt: "xero square icon", + }, + }, + }, + button: { + default: { + image: { + src: "https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png", + alt: "xero default button icon", + }, + }, + hover: { + image: { + src: "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png", + alt: "xero hover button icon", + }, + }, + }, + sourceId: "35b92968-9851-4095-ad60-395c95cbcba4", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `logo` | [shared.BrandingLogo](../../../sdk/models/shared/brandinglogo.md) | :heavy_minus_sign: | Logo branding references. | | +| `button` | [shared.BrandingButton](../../../sdk/models/shared/brandingbutton.md) | :heavy_minus_sign: | Button branding references. | | | `sourceId` | *string* | :heavy_minus_sign: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/brandingbutton.md b/platform/docs/sdk/models/shared/brandingbutton.md index 6ac2941c0..9ac8bf55d 100644 --- a/platform/docs/sdk/models/shared/brandingbutton.md +++ b/platform/docs/sdk/models/shared/brandingbutton.md @@ -1,18 +1,18 @@ -# BrandingButton - -Button branding references. - -## Example Usage - -```typescript -import { BrandingButton } from "@codat/platform/sdk/models/shared"; - -let value: BrandingButton = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `default` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | +# BrandingButton + +Button branding references. + +## Example Usage + +```typescript +import { BrandingButton } from "@codat/platform/sdk/models/shared"; + +let value: BrandingButton = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `default` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | | `hover` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/brandingimage.md b/platform/docs/sdk/models/shared/brandingimage.md index 27131e90c..a219bbef1 100644 --- a/platform/docs/sdk/models/shared/brandingimage.md +++ b/platform/docs/sdk/models/shared/brandingimage.md @@ -1,15 +1,15 @@ -# BrandingImage - -## Example Usage - -```typescript -import { BrandingImage } from "@codat/platform/sdk/models/shared"; - -let value: BrandingImage = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +# BrandingImage + +## Example Usage + +```typescript +import { BrandingImage } from "@codat/platform/sdk/models/shared"; + +let value: BrandingImage = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | `image` | [shared.ImageReference](../../../sdk/models/shared/imagereference.md) | :heavy_minus_sign: | Image reference. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/brandinglogo.md b/platform/docs/sdk/models/shared/brandinglogo.md index 25a2446de..4e8a9b05c 100644 --- a/platform/docs/sdk/models/shared/brandinglogo.md +++ b/platform/docs/sdk/models/shared/brandinglogo.md @@ -1,18 +1,18 @@ -# BrandingLogo - -Logo branding references. - -## Example Usage - -```typescript -import { BrandingLogo } from "@codat/platform/sdk/models/shared"; - -let value: BrandingLogo = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `full` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | +# BrandingLogo + +Logo branding references. + +## Example Usage + +```typescript +import { BrandingLogo } from "@codat/platform/sdk/models/shared"; + +let value: BrandingLogo = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `full` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | | `square` | [shared.BrandingImage](../../../sdk/models/shared/brandingimage.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/clientratelimitwebhook.md b/platform/docs/sdk/models/shared/clientratelimitwebhook.md index ef7ee9b1b..c11fc7d3a 100644 --- a/platform/docs/sdk/models/shared/clientratelimitwebhook.md +++ b/platform/docs/sdk/models/shared/clientratelimitwebhook.md @@ -1,25 +1,22 @@ -# 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 | +# 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", +}; +``` + +## 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 index 7441544a6..52c32c59e 100644 --- a/platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ b/platform/docs/sdk/models/shared/clientratelimitwebhookpayload.md @@ -1,19 +1,19 @@ -# 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. | | +# 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/companies.md b/platform/docs/sdk/models/shared/companies.md index 013469d05..f38782300 100644 --- a/platform/docs/sdk/models/shared/companies.md +++ b/platform/docs/sdk/models/shared/companies.md @@ -1,31 +1,23 @@ -# Companies - -## Example Usage - -```typescript -import { Companies } from "@codat/platform/sdk/models/shared"; - -let value: Companies = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Companies + +## Example Usage + +```typescript +import { Companies } from "@codat/platform/sdk/models/shared"; + +let value: Companies = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | \ 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..e9325e1fa 100644 --- a/platform/docs/sdk/models/shared/company.md +++ b/platform/docs/sdk/models/shared/company.md @@ -1,63 +1,61 @@ -# Company - -In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - -Typically each company is one of your customers. - -When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - -## Example Usage - -```typescript -import { Company } from "@codat/platform/sdk/models/shared"; - -let value: Company = { - 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", - }, - ], -}; -``` - -## 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. | | +# Company + +In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + +Typically each company is one of your customers. + +When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + +## Example Usage + +```typescript +import { Company } from "@codat/platform/sdk/models/shared"; + +let value: Company = { + 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", + }, + ], +}; +``` + +## 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: | The parent entity or controlling organization of this company. Null if the company has no parent. | | +| `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/companyaccesstoken.md b/platform/docs/sdk/models/shared/companyaccesstoken.md index 411ab1ac5..31853afe7 100644 --- a/platform/docs/sdk/models/shared/companyaccesstoken.md +++ b/platform/docs/sdk/models/shared/companyaccesstoken.md @@ -1,23 +1,23 @@ -# CompanyAccessToken - -Details of the access token provisioned for a company. - -## Example Usage - -```typescript -import { CompanyAccessToken } from "@codat/platform/sdk/models/shared"; - -let value: CompanyAccessToken = { - expiresIn: 86400, - accessToken: "string", - tokenType: "Bearer", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `expiresIn` | *number* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | -| `accessToken` | *string* | :heavy_check_mark: | The access token for the company. | | +# CompanyAccessToken + +Details of the access token provisioned for a company. + +## Example Usage + +```typescript +import { CompanyAccessToken } from "@codat/platform/sdk/models/shared"; + +let value: CompanyAccessToken = { + expiresIn: 86400, + accessToken: "string", + tokenType: "Bearer", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `expiresIn` | *number* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | +| `accessToken` | *string* | :heavy_check_mark: | The access token for the company. | | | `tokenType` | *string* | :heavy_check_mark: | The type of token. | Bearer | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companydetails.md b/platform/docs/sdk/models/shared/companydetails.md index 68e95c243..fbe114f73 100644 --- a/platform/docs/sdk/models/shared/companydetails.md +++ b/platform/docs/sdk/models/shared/companydetails.md @@ -1,45 +1,32 @@ -# 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 | | +# 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", +}; +``` + +## 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: | The parent entity or controlling organization of this company. Null if the company has no parent. | | | `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/companyreference.md b/platform/docs/sdk/models/shared/companyreference.md index dbaa750ce..b458cc158 100644 --- a/platform/docs/sdk/models/shared/companyreference.md +++ b/platform/docs/sdk/models/shared/companyreference.md @@ -1,23 +1,23 @@ -# CompanyReference - -## Example Usage - -```typescript -import { CompanyReference } from "@codat/platform/sdk/models/shared"; - -let value: CompanyReference = { - 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 for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_minus_sign: | 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. | -| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +# CompanyReference + +## Example Usage + +```typescript +import { CompanyReference } from "@codat/platform/sdk/models/shared"; + +let value: CompanyReference = { + 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 for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_minus_sign: | 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. | +| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companyreferencelinks.md b/platform/docs/sdk/models/shared/companyreferencelinks.md index e9689a8c2..ae8e88477 100644 --- a/platform/docs/sdk/models/shared/companyreferencelinks.md +++ b/platform/docs/sdk/models/shared/companyreferencelinks.md @@ -1,17 +1,17 @@ -# CompanyReferenceLinks - -A collection of links for the company. - -## Example Usage - -```typescript -import { CompanyReferenceLinks } from "@codat/platform/sdk/models/shared"; - -let value: CompanyReferenceLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +# CompanyReferenceLinks + +A collection of links for the company. + +## Example Usage + +```typescript +import { CompanyReferenceLinks } from "@codat/platform/sdk/models/shared"; + +let value: CompanyReferenceLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | | `portal` | *string* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companyrequestbody.md b/platform/docs/sdk/models/shared/companyrequestbody.md index d5a14f87c..55c4b2777 100644 --- a/platform/docs/sdk/models/shared/companyrequestbody.md +++ b/platform/docs/sdk/models/shared/companyrequestbody.md @@ -1,20 +1,20 @@ -# CompanyRequestBody - -## Example Usage - -```typescript -import { CompanyRequestBody } from "@codat/platform/sdk/models/shared"; - -let value: CompanyRequestBody = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | -| `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. | +# CompanyRequestBody + +## Example Usage + +```typescript +import { CompanyRequestBody } from "@codat/platform/sdk/models/shared"; + +let value: CompanyRequestBody = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | +| `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. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companysyncsettings.md b/platform/docs/sdk/models/shared/companysyncsettings.md index 39762790f..bdbdbe555 100644 --- a/platform/docs/sdk/models/shared/companysyncsettings.md +++ b/platform/docs/sdk/models/shared/companysyncsettings.md @@ -1,31 +1,19 @@ -# CompanySyncSettings - -## Example Usage - -```typescript -import { CompanySyncSettings } from "@codat/platform/sdk/models/shared"; - -let value: CompanySyncSettings = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_minus_sign: | N/A | | +# CompanySyncSettings + +## Example Usage + +```typescript +import { CompanySyncSettings } from "@codat/platform/sdk/models/shared"; + +let value: CompanySyncSettings = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_minus_sign: | N/A | | | `overridesDefaults` | *boolean* | :heavy_minus_sign: | Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companyupdaterequest.md b/platform/docs/sdk/models/shared/companyupdaterequest.md index 24e3e56cf..8fb751181 100644 --- a/platform/docs/sdk/models/shared/companyupdaterequest.md +++ b/platform/docs/sdk/models/shared/companyupdaterequest.md @@ -1,20 +1,20 @@ -# CompanyUpdateRequest - -## Example Usage - -```typescript -import { CompanyUpdateRequest } from "@codat/platform/sdk/models/shared"; - -let value: CompanyUpdateRequest = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | -| `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. | +# CompanyUpdateRequest + +## Example Usage + +```typescript +import { CompanyUpdateRequest } from "@codat/platform/sdk/models/shared"; + +let value: CompanyUpdateRequest = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `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. | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/companywebhook.md b/platform/docs/sdk/models/shared/companywebhook.md index 0d565c3cb..1b041005b 100644 --- a/platform/docs/sdk/models/shared/companywebhook.md +++ b/platform/docs/sdk/models/shared/companywebhook.md @@ -1,43 +1,22 @@ -# 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 | +# 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", +}; +``` + +## 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/connection.md b/platform/docs/sdk/models/shared/connection.md index b4fb763af..489a14533 100644 --- a/platform/docs/sdk/models/shared/connection.md +++ b/platform/docs/sdk/models/shared/connection.md @@ -1,49 +1,48 @@ -# Connection - -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). - -## Example Usage - -```typescript -import { Connection } from "@codat/platform/sdk/models/shared"; - -let value: 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_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | -| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | -| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | -| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | -| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | -| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `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_check_mark: | 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 | -| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | +# Connection + +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). + +## Example Usage + +```typescript +import { Connection } from "@codat/platform/sdk/models/shared"; + +let value: 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_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | +| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | +| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | +| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | +| `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_check_mark: | 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 | +| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | | `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/connectionmanagementaccesstoken.md b/platform/docs/sdk/models/shared/connectionmanagementaccesstoken.md index a9b78e98d..218a55b2a 100644 --- a/platform/docs/sdk/models/shared/connectionmanagementaccesstoken.md +++ b/platform/docs/sdk/models/shared/connectionmanagementaccesstoken.md @@ -1,18 +1,17 @@ -# ConnectionManagementAccessToken - -## Example Usage - -```typescript -import { ConnectionManagementAccessToken } from "@codat/platform/sdk/models/shared"; - -let value: ConnectionManagementAccessToken = { - accessToken: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +# ConnectionManagementAccessToken + +## Example Usage + +```typescript +import { ConnectionManagementAccessToken } from "@codat/platform/sdk/models/shared"; + +let value: ConnectionManagementAccessToken = { + accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `accessToken` | *string* | :heavy_minus_sign: | Access token that allows SMBs to manage connections that have access to their data. | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/connectionmanagementallowedorigins.md b/platform/docs/sdk/models/shared/connectionmanagementallowedorigins.md index b0d9b8c4e..bd8fb3f72 100644 --- a/platform/docs/sdk/models/shared/connectionmanagementallowedorigins.md +++ b/platform/docs/sdk/models/shared/connectionmanagementallowedorigins.md @@ -1,21 +1,19 @@ -# ConnectionManagementAllowedOrigins - -Success - -## Example Usage - -```typescript -import { ConnectionManagementAllowedOrigins } from "@codat/platform/sdk/models/shared"; - -let value: ConnectionManagementAllowedOrigins = { - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# ConnectionManagementAllowedOrigins + +## Example Usage + +```typescript +import { ConnectionManagementAllowedOrigins } from "@codat/platform/sdk/models/shared"; + +let value: ConnectionManagementAllowedOrigins = { + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `allowedOrigins` | *string*[] | :heavy_minus_sign: | An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/connections.md b/platform/docs/sdk/models/shared/connections.md index e6ab70132..f76caa488 100644 --- a/platform/docs/sdk/models/shared/connections.md +++ b/platform/docs/sdk/models/shared/connections.md @@ -1,31 +1,23 @@ -# Connections - -## Example Usage - -```typescript -import { Connections } from "@codat/platform/sdk/models/shared"; - -let value: Connections = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Connections + +## Example Usage + +```typescript +import { Connections } from "@codat/platform/sdk/models/shared"; + +let value: Connections = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [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/connectionwebhook.md b/platform/docs/sdk/models/shared/connectionwebhook.md index 520672a23..34623ecf8 100644 --- a/platform/docs/sdk/models/shared/connectionwebhook.md +++ b/platform/docs/sdk/models/shared/connectionwebhook.md @@ -1,42 +1,22 @@ -# 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 | +# 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", +}; +``` + +## 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 index 687c1c7ce..09fdb039b 100644 --- a/platform/docs/sdk/models/shared/connectionwebhookpayload.md +++ b/platform/docs/sdk/models/shared/connectionwebhookpayload.md @@ -1,35 +1,29 @@ -# 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 | | +# ConnectionWebhookPayload + +## Example Usage + +```typescript +import { ConnectionWebhookPayload } from "@codat/platform/sdk/models/shared"; + +let value: ConnectionWebhookPayload = { + 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/content.md b/platform/docs/sdk/models/shared/content.md index 3e7b1bfc5..b40722c43 100644 --- a/platform/docs/sdk/models/shared/content.md +++ b/platform/docs/sdk/models/shared/content.md @@ -1,14 +1,14 @@ -# Content - -## Example Usage - -```typescript -import { Content } from "@codat/platform/sdk/models/shared"; - -let value: Content = {}; -``` - -## Fields - -| Field | Type | Required | Description | +# Content + +## Example Usage + +```typescript +import { Content } from "@codat/platform/sdk/models/shared"; + +let value: Content = {}; +``` + +## Fields + +| Field | Type | Required | Description | | ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/createapikey.md b/platform/docs/sdk/models/shared/createapikey.md index c0d0681cf..af2c52cd0 100644 --- a/platform/docs/sdk/models/shared/createapikey.md +++ b/platform/docs/sdk/models/shared/createapikey.md @@ -1,19 +1,19 @@ -# CreateApiKey - -Details about the newly created API key. - -## Example Usage - -```typescript -import { CreateApiKey } from "@codat/platform/sdk/models/shared"; - -let value: CreateApiKey = { - name: "azure-invoice-finance-processor", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +# CreateApiKey + +Details about the newly created API key. + +## Example Usage + +```typescript +import { CreateApiKey } from "@codat/platform/sdk/models/shared"; + +let value: CreateApiKey = { + name: "azure-invoice-finance-processor", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | | `name` | *string* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/customdatatypeconfiguration.md b/platform/docs/sdk/models/shared/customdatatypeconfiguration.md index 614eb3e83..9fdd4a521 100644 --- a/platform/docs/sdk/models/shared/customdatatypeconfiguration.md +++ b/platform/docs/sdk/models/shared/customdatatypeconfiguration.md @@ -1,37 +1,37 @@ -# CustomDataTypeConfiguration - -Client's configuration details for a specific custom data type and platform pair. - -## Example Usage - -```typescript -import { CustomDataTypeConfiguration } from "@codat/platform/sdk/models/shared"; - -let value: CustomDataTypeConfiguration = { - dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", - requiredData: { - "currencyCode": "$[*].currencyCode", - "id": "$[*].id", - "number": "$[*].number", - "orderDate": "$[*].orderDate", - "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", - "totalTaxAmount": "$[*].totalTaxAmount", - "vendorName": "$[*].number", - }, - keyBy: [ - "$[*].id", - ], - sourceModifiedDate: [ - "$[*].lastModifiedDateTime", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `dataSource` | *string* | :heavy_minus_sign: | Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. | -| `requiredData` | Record | :heavy_minus_sign: | Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. | -| `keyBy` | *string*[] | :heavy_minus_sign: | An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. | +# CustomDataTypeConfiguration + +Client's configuration details for a specific custom data type and platform pair. + +## Example Usage + +```typescript +import { CustomDataTypeConfiguration } from "@codat/platform/sdk/models/shared"; + +let value: CustomDataTypeConfiguration = { + dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", + requiredData: { + "currencyCode": "$[*].currencyCode", + "id": "$[*].id", + "number": "$[*].number", + "orderDate": "$[*].orderDate", + "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", + "totalTaxAmount": "$[*].totalTaxAmount", + "vendorName": "$[*].number", + }, + keyBy: [ + "$[*].id", + ], + sourceModifiedDate: [ + "$[*].lastModifiedDateTime", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `dataSource` | *string* | :heavy_minus_sign: | Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. | +| `requiredData` | Record | :heavy_minus_sign: | Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. | +| `keyBy` | *string*[] | :heavy_minus_sign: | An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. | | `sourceModifiedDate` | *string*[] | :heavy_minus_sign: | Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/customdatatyperecord.md b/platform/docs/sdk/models/shared/customdatatyperecord.md index 83a43afdf..c38d79270 100644 --- a/platform/docs/sdk/models/shared/customdatatyperecord.md +++ b/platform/docs/sdk/models/shared/customdatatyperecord.md @@ -1,21 +1,17 @@ -# CustomDataTypeRecord - -## Example Usage - -```typescript -import { CustomDataTypeRecord } from "@codat/platform/sdk/models/shared"; - -let value: CustomDataTypeRecord = { - modifiedDate: { - modifiedDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the record. | -| `content` | Record | :heavy_minus_sign: | Values from the source system for the properties defined in the custom data type configuration. | +# CustomDataTypeRecord + +## Example Usage + +```typescript +import { CustomDataTypeRecord } from "@codat/platform/sdk/models/shared"; + +let value: CustomDataTypeRecord = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the record. | +| `content` | Record | :heavy_minus_sign: | Values from the source system for the properties defined in the custom data type configuration. | | `modifiedDate` | [shared.ModifiedDate](../../../sdk/models/shared/modifieddate.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/customdatatyperecords.md b/platform/docs/sdk/models/shared/customdatatyperecords.md index 931a6ae0e..d05b991ff 100644 --- a/platform/docs/sdk/models/shared/customdatatyperecords.md +++ b/platform/docs/sdk/models/shared/customdatatyperecords.md @@ -1,28 +1,20 @@ -# CustomDataTypeRecords - -Resulting records pulled from the source platform for a specific custom data type. - -## Example Usage - -```typescript -import { CustomDataTypeRecords } from "@codat/platform/sdk/models/shared"; - -let value: CustomDataTypeRecords = { - results: [ - { - modifiedDate: { - modifiedDate: "2022-10-23T00:00:00Z", - }, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `results` | [shared.CustomDataTypeRecord](../../../sdk/models/shared/customdatatyperecord.md)[] | :heavy_minus_sign: | N/A | -| `pageNumber` | *number* | :heavy_minus_sign: | Current page number. | -| `pageSize` | *number* | :heavy_minus_sign: | Number of items to return in results array. | +# CustomDataTypeRecords + +Resulting records pulled from the source platform for a specific custom data type. + +## Example Usage + +```typescript +import { CustomDataTypeRecords } from "@codat/platform/sdk/models/shared"; + +let value: CustomDataTypeRecords = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `results` | [shared.CustomDataTypeRecord](../../../sdk/models/shared/customdatatyperecord.md)[] | :heavy_minus_sign: | N/A | +| `pageNumber` | *number* | :heavy_minus_sign: | Current page number. | +| `pageSize` | *number* | :heavy_minus_sign: | Number of items to return in results array. | | `totalResults` | *number* | :heavy_minus_sign: | Total number of items. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/dataconnectionerror.md b/platform/docs/sdk/models/shared/dataconnectionerror.md index dd554f4ee..22f6071d1 100644 --- a/platform/docs/sdk/models/shared/dataconnectionerror.md +++ b/platform/docs/sdk/models/shared/dataconnectionerror.md @@ -1,23 +1,23 @@ -# DataConnectionError - -## Example Usage - -```typescript -import { DataConnectionError } from "@codat/platform/sdk/models/shared"; - -let value: DataConnectionError = { - erroredOnUtc: "2022-10-23T00:00:00Z", - resolvedOnUtc: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | -| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | -| `erroredOnUtc` | *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.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +# DataConnectionError + +## Example Usage + +```typescript +import { DataConnectionError } from "@codat/platform/sdk/models/shared"; + +let value: DataConnectionError = { + erroredOnUtc: "2022-10-23T00:00:00Z", + resolvedOnUtc: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | +| `erroredOnUtc` | *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.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | | `resolvedOnUtc` | *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/dataconnectionstatus.md b/platform/docs/sdk/models/shared/dataconnectionstatus.md index 85c311a38..e8da66bd4 100644 --- a/platform/docs/sdk/models/shared/dataconnectionstatus.md +++ b/platform/docs/sdk/models/shared/dataconnectionstatus.md @@ -1,17 +1,17 @@ -# DataConnectionStatus - -The current authorization status of the data connection. - -## Example Usage - -```typescript -import { DataConnectionStatus } from "@codat/platform/sdk/models/shared"; - -let value: DataConnectionStatus = "Deauthorized"; -``` - -## Values - -```typescript -"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" +# DataConnectionStatus + +The current authorization status of the data connection. + +## Example Usage + +```typescript +import { DataConnectionStatus } from "@codat/platform/sdk/models/shared"; + +let value: DataConnectionStatus = "PendingAuth"; +``` + +## Values + +```typescript +"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datasetstatus.md b/platform/docs/sdk/models/shared/datasetstatus.md index 13df9de5d..6ca6ad7ea 100644 --- a/platform/docs/sdk/models/shared/datasetstatus.md +++ b/platform/docs/sdk/models/shared/datasetstatus.md @@ -1,17 +1,17 @@ -# DatasetStatus - -The current status of the dataset. - -## Example Usage - -```typescript -import { DatasetStatus } from "@codat/platform/sdk/models/shared"; - -let value: DatasetStatus = "RateLimitError"; -``` - -## Values - -```typescript -"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" +# DatasetStatus + +The current status of the dataset. + +## Example Usage + +```typescript +import { DatasetStatus } from "@codat/platform/sdk/models/shared"; + +let value: DatasetStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datastatus.md b/platform/docs/sdk/models/shared/datastatus.md index 13d6b66b5..49aa1a74e 100644 --- a/platform/docs/sdk/models/shared/datastatus.md +++ b/platform/docs/sdk/models/shared/datastatus.md @@ -1,27 +1,27 @@ -# DataStatus - -Describes the state of data in the Codat cache for a company and data type - -## Example Usage - -```typescript -import { DataStatus } from "@codat/platform/sdk/models/shared"; - -let value: DataStatus = { - dataType: "itemReceipts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Processing", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dataType` | [shared.DataTypes](../../../sdk/models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | -| `lastSuccessfulSync` | *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 | -| `currentStatus` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | -| `latestSyncId` | *string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | +# DataStatus + +Describes the state of data in the Codat cache for a company and data type + +## Example Usage + +```typescript +import { DataStatus } from "@codat/platform/sdk/models/shared"; + +let value: DataStatus = { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [shared.DataTypes](../../../sdk/models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | +| `lastSuccessfulSync` | *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 | +| `currentStatus` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | +| `latestSyncId` | *string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | | `latestSuccessfulSyncId` | *string* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datastatuses.md b/platform/docs/sdk/models/shared/datastatuses.md index 6d1e7bb23..d93edb61d 100644 --- a/platform/docs/sdk/models/shared/datastatuses.md +++ b/platform/docs/sdk/models/shared/datastatuses.md @@ -1,359 +1,254 @@ -# DataStatuses - -## Example Usage - -```typescript -import { DataStatuses } from "@codat/platform/sdk/models/shared"; - -let value: DataStatuses = { - accountTransactions: { - dataType: "banking-accounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - balanceSheet: { - dataType: "balanceSheet", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Initial", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankAccounts: { - dataType: "chartOfAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Fetching", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankTransactions: { - dataType: "commerce-transactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - billCreditNotes: { - dataType: "commerce-transactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - billPayments: { - dataType: "customers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "AuthError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bills: { - dataType: "chartOfAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PrerequisiteNotMet", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - cashFlowStatement: { - dataType: "commerce-disputes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - chartOfAccounts: { - dataType: "suppliers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Processing", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - company: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - creditNotes: { - dataType: "purchaseOrders", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ValidationError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - customers: { - dataType: "banking-transactionCategories", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - directCosts: { - dataType: "commerce-disputes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "RateLimitError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - directIncomes: { - dataType: "taxRates", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PermissionsError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - invoices: { - dataType: "items", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Cancelled", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - itemReceipts: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PermissionsError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - items: { - dataType: "items", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ValidationError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - journalEntries: { - dataType: "profitAndLoss", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - journals: { - dataType: "commerce-companyInfo", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - paymentMethods: { - dataType: "chartOfAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Mapping", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - payments: { - dataType: "commerce-locations", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - profitAndLoss: { - dataType: "items", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - purchaseOrders: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - salesOrders: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Processing", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - suppliers: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - taxRates: { - dataType: "taxRates", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PrerequisiteNotMet", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - trackingCategories: { - dataType: "itemReceipts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Initial", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - transfers: { - dataType: "cashFlowStatement", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingAccountBalances: { - dataType: "bankAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingAccounts: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "AuthError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingTransactionCategories: { - dataType: "customers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingTransactions: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ValidationError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceCompanyInfo: { - dataType: "cashFlowStatement", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Complete", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceCustomers: { - dataType: "commerce-companyInfo", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Cancelled", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceDisputes: { - dataType: "commerce-payments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Fetching", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceLocations: { - dataType: "commerce-transactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceOrders: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commercePaymentMethods: { - dataType: "billCreditNotes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commercePayments: { - dataType: "billCreditNotes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Complete", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceProductCategories: { - dataType: "banking-accountBalances", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceProducts: { - dataType: "billPayments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "RateLimitError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceTaxComponents: { - dataType: "journals", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PrerequisiteNotMet", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceTransactions: { - dataType: "billCreditNotes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Cancelled", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `accountTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `balanceSheet` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `billCreditNotes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `billPayments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bills` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `cashFlowStatement` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `chartOfAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `company` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `creditNotes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `customers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `directCosts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `directIncomes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `invoices` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `itemReceipts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `items` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `journalEntries` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `journals` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `paymentMethods` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `payments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `profitAndLoss` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `purchaseOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `salesOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `suppliers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `taxRates` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `trackingCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `transfers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankingAccountBalances` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankingAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankingTransactionCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `bankingTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceCompanyInfo` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceCustomers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceDisputes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceLocations` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commercePaymentMethods` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commercePayments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceProductCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceProducts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceTaxComponents` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | -| `commerceTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | \ No newline at end of file +# DataStatuses + +## Example Usage + +```typescript +import { DataStatuses } from "@codat/platform/sdk/models/shared"; + +let value: DataStatuses = { + accountTransactions: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + balanceSheet: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + bankAccounts: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + bankTransactions: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + billCreditNotes: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + billPayments: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + bills: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + cashFlowStatement: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + chartOfAccounts: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + company: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + creditNotes: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + customers: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + directCosts: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + directIncomes: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + invoices: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + itemReceipts: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + items: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + journalEntries: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + journals: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + paymentMethods: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + payments: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + profitAndLoss: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + purchaseOrders: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + salesOrders: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + suppliers: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + taxRates: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + trackingCategories: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, + transfers: { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `balanceSheet` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bankAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bankTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `billCreditNotes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `billPayments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bills` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `cashFlowStatement` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `chartOfAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `company` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `creditNotes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `customers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `directCosts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `directIncomes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `invoices` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `itemReceipts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `items` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journalEntries` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journals` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `paymentMethods` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `payments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `profitAndLoss` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `purchaseOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `salesOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `suppliers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `taxRates` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `trackingCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `transfers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bankingAccountBalances` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `bankingAccounts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `bankingTransactionCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `bankingTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceCompanyInfo` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceCustomers` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceDisputes` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceLocations` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceOrders` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commercePaymentMethods` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commercePayments` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceProductCategories` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceProducts` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceTaxComponents` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | +| `commerceTransactions` | [shared.DataStatus](../../../sdk/models/shared/datastatus.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatype.md b/platform/docs/sdk/models/shared/datatype.md index 08150e774..14b15eeff 100644 --- a/platform/docs/sdk/models/shared/datatype.md +++ b/platform/docs/sdk/models/shared/datatype.md @@ -1,17 +1,17 @@ -# DataType - -Available data types - -## Example Usage - -```typescript -import { DataType } from "@codat/platform/sdk/models/shared"; - -let value: DataType = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# DataType + +Available data types + +## Example Usage + +```typescript +import { DataType } from "@codat/platform/sdk/models/shared"; + +let value: DataType = "accountTransactions"; +``` + +## Values + +```typescript +"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypefeature.md b/platform/docs/sdk/models/shared/datatypefeature.md index 36ab7bf33..068cc1989 100644 --- a/platform/docs/sdk/models/shared/datatypefeature.md +++ b/platform/docs/sdk/models/shared/datatypefeature.md @@ -1,25 +1,25 @@ -# DataTypeFeature - -Describes support for a given datatype and associated operations - -## Example Usage - -```typescript -import { DataTypeFeature } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeFeature = { - supportedFeatures: [ - { - featureType: "Get", - featureState: "Release", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +# DataTypeFeature + +Describes support for a given datatype and associated operations + +## Example Usage + +```typescript +import { DataTypeFeature } from "@codat/platform/sdk/models/shared"; + +let value: DataTypeFeature = { + supportedFeatures: [ + { + featureType: "Get", + featureState: "Release", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `supportedFeatures` | [shared.SupportedFeature](../../../sdk/models/shared/supportedfeature.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypereadsummary.md b/platform/docs/sdk/models/shared/datatypereadsummary.md index 80c8f0877..ed2a8927d 100644 --- a/platform/docs/sdk/models/shared/datatypereadsummary.md +++ b/platform/docs/sdk/models/shared/datatypereadsummary.md @@ -1,38 +1,19 @@ -# 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 +# DataTypeReadSummary + +## Example Usage + +```typescript +import { DataTypeReadSummary } from "@codat/platform/sdk/models/shared"; + +let value: DataTypeReadSummary = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `connectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | +| `recordsModified` | *boolean* | :heavy_minus_sign: | `True` if records have been created, updated or deleted in Codat's cache. | +| `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/datatypes.md b/platform/docs/sdk/models/shared/datatypes.md index 02ef4d202..adf0af85a 100644 --- a/platform/docs/sdk/models/shared/datatypes.md +++ b/platform/docs/sdk/models/shared/datatypes.md @@ -1,17 +1,17 @@ -# DataTypes - -Available data types - -## Example Usage - -```typescript -import { DataTypes } from "@codat/platform/sdk/models/shared"; - -let value: DataTypes = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# DataTypes + +Available data types + +## Example Usage + +```typescript +import { DataTypes } from "@codat/platform/sdk/models/shared"; + +let value: DataTypes = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/datatypewritewebhook.md b/platform/docs/sdk/models/shared/datatypewritewebhook.md index 917940bab..dc0fadba6 100644 --- a/platform/docs/sdk/models/shared/datatypewritewebhook.md +++ b/platform/docs/sdk/models/shared/datatypewritewebhook.md @@ -1,32 +1,22 @@ -# 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 | +# 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", +}; +``` + +## 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 index e3f3be19f..c939e4275 100644 --- a/platform/docs/sdk/models/shared/datatypewritewebhookpayload.md +++ b/platform/docs/sdk/models/shared/datatypewritewebhookpayload.md @@ -1,32 +1,23 @@ -# 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 +# DataTypeWriteWebhookPayload + +## Example Usage + +```typescript +import { DataTypeWriteWebhookPayload } from "@codat/platform/sdk/models/shared"; + +let value: DataTypeWriteWebhookPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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: | N/A | +| `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. | +| `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. | +| `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. | +| `status` | [shared.WriteStatus](../../../sdk/models/shared/writestatus.md) | :heavy_minus_sign: | N/A | +| `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 index 95e308b9e..e914c094c 100644 --- a/platform/docs/sdk/models/shared/datatypewritewebhookrecord.md +++ b/platform/docs/sdk/models/shared/datatypewritewebhookrecord.md @@ -1,15 +1,15 @@ -# DataTypeWriteWebhookRecord - -## Example Usage - -```typescript -import { DataTypeWriteWebhookRecord } from "@codat/platform/sdk/models/shared"; - -let value: DataTypeWriteWebhookRecord = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +# 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/errormessage.md b/platform/docs/sdk/models/shared/errormessage.md index cb492cfd1..70bb69e23 100644 --- a/platform/docs/sdk/models/shared/errormessage.md +++ b/platform/docs/sdk/models/shared/errormessage.md @@ -1,23 +1,21 @@ -# ErrorMessage - -Too many requests were made in a given amount of time. Wait a short period and then try again. - -## Example Usage - -```typescript -import { ErrorMessage } from "@codat/platform/sdk/models/shared"; - -let value: ErrorMessage = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | -| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | -| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | -| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +# ErrorMessage + +## Example Usage + +```typescript +import { ErrorMessage } from "@codat/platform/sdk/models/shared"; + +let value: ErrorMessage = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | +| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | +| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | | `detailedErrorCode` | *number* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/errorstatus.md b/platform/docs/sdk/models/shared/errorstatus.md index b4c58ebac..32ec07c19 100644 --- a/platform/docs/sdk/models/shared/errorstatus.md +++ b/platform/docs/sdk/models/shared/errorstatus.md @@ -1,17 +1,17 @@ -# ErrorStatus - -The current status of a transient error. Null statuses indicate that the error is not transient. - -## Example Usage - -```typescript -import { ErrorStatus } from "@codat/platform/sdk/models/shared"; - -let value: ErrorStatus = "Resolved"; -``` - -## Values - -```typescript -"Active" | "Resolved" +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + +## Example Usage + +```typescript +import { ErrorStatus } from "@codat/platform/sdk/models/shared"; + +let value: ErrorStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/errorvalidation.md b/platform/docs/sdk/models/shared/errorvalidation.md index 8de2da74e..11ca22195 100644 --- a/platform/docs/sdk/models/shared/errorvalidation.md +++ b/platform/docs/sdk/models/shared/errorvalidation.md @@ -1,18 +1,18 @@ -# ErrorValidation - -A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { ErrorValidation } from "@codat/platform/sdk/models/shared"; - -let value: ErrorValidation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | +# ErrorValidation + +A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { ErrorValidation } from "@codat/platform/sdk/models/shared"; + +let value: ErrorValidation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/errorvalidationitem.md b/platform/docs/sdk/models/shared/errorvalidationitem.md index a777a3273..595b028ee 100644 --- a/platform/docs/sdk/models/shared/errorvalidationitem.md +++ b/platform/docs/sdk/models/shared/errorvalidationitem.md @@ -1,17 +1,17 @@ -# ErrorValidationItem - -## Example Usage - -```typescript -import { ErrorValidationItem } from "@codat/platform/sdk/models/shared"; - -let value: ErrorValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ErrorValidationItem + +## Example Usage + +```typescript +import { ErrorValidationItem } from "@codat/platform/sdk/models/shared"; + +let value: ErrorValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/featurestate.md b/platform/docs/sdk/models/shared/featurestate.md index bed9284e9..43df56ad3 100644 --- a/platform/docs/sdk/models/shared/featurestate.md +++ b/platform/docs/sdk/models/shared/featurestate.md @@ -1,17 +1,17 @@ -# FeatureState - -The current release state of the feature. - -## Example Usage - -```typescript -import { FeatureState } from "@codat/platform/sdk/models/shared"; - -let value: FeatureState = "Release"; -``` - -## Values - -```typescript -"Release" | "Alpha" | "Beta" | "Deprecated" | "NotSupported" | "NotImplemented" +# FeatureState + +The current release state of the feature. + +## Example Usage + +```typescript +import { FeatureState } from "@codat/platform/sdk/models/shared"; + +let value: FeatureState = "Release"; +``` + +## Values + +```typescript +"Release" | "Alpha" | "Beta" | "Deprecated" | "NotSupported" | "NotImplemented" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/featuretype.md b/platform/docs/sdk/models/shared/featuretype.md index 68ad73a88..558e39514 100644 --- a/platform/docs/sdk/models/shared/featuretype.md +++ b/platform/docs/sdk/models/shared/featuretype.md @@ -1,17 +1,17 @@ -# FeatureType - -The type of feature. - -## Example Usage - -```typescript -import { FeatureType } from "@codat/platform/sdk/models/shared"; - -let value: FeatureType = "Get"; -``` - -## Values - -```typescript -"Get" | "Post" | "Categorization" | "Delete" | "Put" | "GetAsPdf" | "DownloadAttachment" | "GetAttachment" | "GetAttachments" | "UploadAttachment" +# FeatureType + +The type of feature. + +## Example Usage + +```typescript +import { FeatureType } from "@codat/platform/sdk/models/shared"; + +let value: FeatureType = "Get"; +``` + +## Values + +```typescript +"Get" | "Post" | "Categorization" | "Delete" | "Put" | "GetAsPdf" | "DownloadAttachment" | "GetAttachment" | "GetAttachments" | "UploadAttachment" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/halref.md b/platform/docs/sdk/models/shared/halref.md index e764a29bf..3e2aba998 100644 --- a/platform/docs/sdk/models/shared/halref.md +++ b/platform/docs/sdk/models/shared/halref.md @@ -1,15 +1,15 @@ -# HalRef - -## Example Usage - -```typescript -import { HalRef } from "@codat/platform/sdk/models/shared"; - -let value: HalRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +# HalRef + +## Example Usage + +```typescript +import { HalRef } from "@codat/platform/sdk/models/shared"; + +let value: HalRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | | `href` | *string* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/imagereference.md b/platform/docs/sdk/models/shared/imagereference.md index d1646ee8e..41f0f0e55 100644 --- a/platform/docs/sdk/models/shared/imagereference.md +++ b/platform/docs/sdk/models/shared/imagereference.md @@ -1,18 +1,18 @@ -# ImageReference - -Image reference. - -## Example Usage - -```typescript -import { ImageReference } from "@codat/platform/sdk/models/shared"; - -let value: ImageReference = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `src` | *string* | :heavy_minus_sign: | Source URL for image. | +# ImageReference + +Image reference. + +## Example Usage + +```typescript +import { ImageReference } from "@codat/platform/sdk/models/shared"; + +let value: ImageReference = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `src` | *string* | :heavy_minus_sign: | Source URL for image. | | `alt` | *string* | :heavy_minus_sign: | Alternative text when image is not available. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/integration.md b/platform/docs/sdk/models/shared/integration.md index cdf6eff3f..befddfa2f 100644 --- a/platform/docs/sdk/models/shared/integration.md +++ b/platform/docs/sdk/models/shared/integration.md @@ -1,48 +1,49 @@ -# Integration - -An integration that Codat supports - -## Example Usage - -```typescript -import { Integration } from "@codat/platform/sdk/models/shared"; - -let value: Integration = { - key: "gbol", - logoUrl: "http://example.com", - name: "Xero", - enabled: true, - sourceId: "accounting", - sourceType: "Commerce", - integrationId: "497a18ca-284e-40c0-985d-f72be35d468e", - isOfflineConnector: true, - isBeta: true, - dataProvidedBy: "string", - datatypeFeatures: [ - { - supportedFeatures: [ - { - featureType: "UploadAttachment", - featureState: "NotImplemented", - }, - ], - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `key` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | -| `logoUrl` | *string* | :heavy_check_mark: | Static url for integration's logo. | | -| `name` | *string* | :heavy_check_mark: | Name of integration. | Xero | -| `enabled` | *boolean* | :heavy_check_mark: | Whether this integration is enabled for your customers to use. | | -| `sourceId` | *string* | :heavy_minus_sign: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | -| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_minus_sign: | The type of platform of the connection. | Accounting | -| `integrationId` | *string* | :heavy_minus_sign: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | -| `isOfflineConnector` | *boolean* | :heavy_minus_sign: | `True` if the integration is to an application installed and run locally on an SMBs computer. | | -| `isBeta` | *boolean* | :heavy_minus_sign: | `True` if the integration is currently in beta release. | | -| `dataProvidedBy` | *string* | :heavy_minus_sign: | The name of the data provider. | | +# Integration + +An integration that Codat supports + +## Example Usage + +```typescript +import { Integration } from "@codat/platform/sdk/models/shared"; + +let value: Integration = { + key: "gbol", + logoUrl: "http://example.com", + name: "Xero", + enabled: true, + sourceId: "accounting", + sourceType: "8193a927-ab7a-45a3-9dc2-d357a4932dfe", + integrationId: "497a18ca-284e-40c0-985d-f72be35d468e", + isOfflineConnector: true, + isBeta: true, + dataProvidedBy: "string", + datatypeFeatures: [ + { + supportedFeatures: [ + { + featureType: "get", + featureState: "release", + }, + ], + datatype: "invoices", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | +| `logoUrl` | *string* | :heavy_check_mark: | Static url for integration's logo. | | +| `name` | *string* | :heavy_check_mark: | Name of integration. | Xero | +| `enabled` | *boolean* | :heavy_check_mark: | Whether this integration is enabled for your customers to use. | | +| `sourceId` | *string* | :heavy_minus_sign: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | +| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_minus_sign: | The type of platform of the connection. | Accounting | +| `integrationId` | *string* | :heavy_minus_sign: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `isOfflineConnector` | *boolean* | :heavy_minus_sign: | `True` if the integration is to an application installed and run locally on an SMBs computer. | | +| `isBeta` | *boolean* | :heavy_minus_sign: | `True` if the integration is currently in beta release. | | +| `dataProvidedBy` | *string* | :heavy_minus_sign: | The name of the data provider. | | | `datatypeFeatures` | [shared.DataTypeFeature](../../../sdk/models/shared/datatypefeature.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/integrations.md b/platform/docs/sdk/models/shared/integrations.md index ae7d91bc8..4df6919d3 100644 --- a/platform/docs/sdk/models/shared/integrations.md +++ b/platform/docs/sdk/models/shared/integrations.md @@ -1,31 +1,23 @@ -# Integrations - -## Example Usage - -```typescript -import { Integrations } from "@codat/platform/sdk/models/shared"; - -let value: Integrations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Integration](../../../sdk/models/shared/integration.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Integrations + +## Example Usage + +```typescript +import { Integrations } from "@codat/platform/sdk/models/shared"; + +let value: Integrations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Integration](../../../sdk/models/shared/integration.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/issue.md b/platform/docs/sdk/models/shared/issue.md index 0e7948ed7..bab8c888f 100644 --- a/platform/docs/sdk/models/shared/issue.md +++ b/platform/docs/sdk/models/shared/issue.md @@ -1,31 +1,22 @@ -# 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. | +# 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.", +}; +``` + +## 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 index d648c6caf..790507c63 100644 --- a/platform/docs/sdk/models/shared/issuelinks.md +++ b/platform/docs/sdk/models/shared/issuelinks.md @@ -1,24 +1,21 @@ -# 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 | +# 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/links.md b/platform/docs/sdk/models/shared/links.md index 876d190cc..25aa07dac 100644 --- a/platform/docs/sdk/models/shared/links.md +++ b/platform/docs/sdk/models/shared/links.md @@ -1,25 +1,25 @@ -# Links - -## Example Usage - -```typescript -import { Links } from "@codat/platform/sdk/models/shared"; - -let value: Links = { - self: { - href: "/companies", - }, - current: { - href: "/companies?page=1&pageSize=10", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | +# Links + +## Example Usage + +```typescript +import { Links } from "@codat/platform/sdk/models/shared"; + +let value: Links = { + self: { + href: "/companies", + }, + current: { + href: "/companies?page=1&pageSize=10", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | | `previous` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/modifieddate.md b/platform/docs/sdk/models/shared/modifieddate.md index 488e53ecf..7c0148f63 100644 --- a/platform/docs/sdk/models/shared/modifieddate.md +++ b/platform/docs/sdk/models/shared/modifieddate.md @@ -1,17 +1,17 @@ -# ModifiedDate - -## Example Usage - -```typescript -import { ModifiedDate } from "@codat/platform/sdk/models/shared"; - -let value: ModifiedDate = { - modifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +# ModifiedDate + +## Example Usage + +```typescript +import { ModifiedDate } from "@codat/platform/sdk/models/shared"; + +let value: ModifiedDate = { + modifiedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **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/profile.md b/platform/docs/sdk/models/shared/profile.md index 5d85ae547..9b0eb399f 100644 --- a/platform/docs/sdk/models/shared/profile.md +++ b/platform/docs/sdk/models/shared/profile.md @@ -1,35 +1,33 @@ -# Profile - -Describes your Codat client instance - -## Example Usage - -```typescript -import { Profile } from "@codat/platform/sdk/models/shared"; - -let value: Profile = { - name: "Bob's Burgers", - logoUrl: - "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", - iconUrl: - "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", - redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", - whiteListUrls: [ - "https://bobs-burgers.com", - "https://bobs-burgers.co.uk", - ], - confirmCompanyName: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | The name given to the instance. | Bob's Burgers | -| `logoUrl` | *string* | :heavy_minus_sign: | Static url to your organization's logo. | https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png | -| `iconUrl` | *string* | :heavy_minus_sign: | Static url to your organization's icon. | https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico | -| `redirectUrl` | *string* | :heavy_check_mark: | The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. | https://bobs-burgers.{countrySuffix}/{companyId} | -| `whiteListUrls` | *string*[] | :heavy_minus_sign: | A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. | | -| ~~`apiKey`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The API key for this Codat instance. | sartANTjHAkLdbyDfaynoTQb7pkmj6hXHmnQKMrB | +# Profile + +Describes your Codat client instance + +## Example Usage + +```typescript +import { Profile } from "@codat/platform/sdk/models/shared"; + +let value: Profile = { + name: "Bob's Burgers", + logoUrl: "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", + iconUrl: "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", + redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", + whiteListUrls: [ + "https://bobs-burgers.com", + "https://bobs-burgers.co.uk", + ], + confirmCompanyName: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name given to the instance. | Bob's Burgers | +| `logoUrl` | *string* | :heavy_minus_sign: | Static url to your organization's logo. | https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png | +| `iconUrl` | *string* | :heavy_minus_sign: | Static url to your organization's icon. | https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico | +| `redirectUrl` | *string* | :heavy_check_mark: | The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. | https://bobs-burgers.{countrySuffix}/{companyId} | +| `whiteListUrls` | *string*[] | :heavy_minus_sign: | A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. | | +| ~~`apiKey`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The API key for this Codat instance. | sartANTjHAkLdbyDfaynoTQb7pkmj6hXHmnQKMrB | | ~~`confirmCompanyName`~~ | *boolean* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`True` if the company name has been confirmed. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pulloperation.md b/platform/docs/sdk/models/shared/pulloperation.md index f2f6a7610..0ff6ac05f 100644 --- a/platform/docs/sdk/models/shared/pulloperation.md +++ b/platform/docs/sdk/models/shared/pulloperation.md @@ -1,40 +1,40 @@ -# PullOperation - -Information about a queued, in progress or completed pull operation. -*Formally called `dataset`* - -## Example Usage - -```typescript -import { PullOperation } from "@codat/platform/sdk/models/shared"; - -let value: PullOperation = { - id: "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", - companyId: "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", - connectionId: "51baa045-4836-4317-a42e-3542e991e581", - dataType: "invoices", - status: "Initial", - statusDescription: "Paused until 2022-10-23T00:00:00.000Z", - requested: "2022-11-14T11:18:37.2798351Z", - progress: 10, - isCompleted: false, - isErrored: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | -| `dataType` | *string* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | -| `status` | [shared.DatasetStatus](../../../sdk/models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | -| `statusDescription` | *string* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | -| `requested` | *string* | :heavy_check_mark: | 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 | -| `completed` | *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 | -| `progress` | *number* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | -| `isCompleted` | *boolean* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | +# PullOperation + +Information about a queued, in progress or completed pull operation. +*Formally called `dataset`* + +## Example Usage + +```typescript +import { PullOperation } from "@codat/platform/sdk/models/shared"; + +let value: PullOperation = { + id: "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", + companyId: "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", + connectionId: "51baa045-4836-4317-a42e-3542e991e581", + dataType: "invoices", + status: "Initial", + statusDescription: "Paused until 2022-10-23T00:00:00.000Z", + requested: "2022-11-14T11:18:37.2798351Z", + progress: 10, + isCompleted: false, + isErrored: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | +| `dataType` | *string* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | +| `status` | [shared.DatasetStatus](../../../sdk/models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | +| `statusDescription` | *string* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | +| `requested` | *string* | :heavy_check_mark: | 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 | +| `completed` | *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 | +| `progress` | *number* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | +| `isCompleted` | *boolean* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | | `isErrored` | *boolean* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pulloperations.md b/platform/docs/sdk/models/shared/pulloperations.md index 31cd22223..3a5e4dafb 100644 --- a/platform/docs/sdk/models/shared/pulloperations.md +++ b/platform/docs/sdk/models/shared/pulloperations.md @@ -1,31 +1,23 @@ -# PullOperations - -## Example Usage - -```typescript -import { PullOperations } from "@codat/platform/sdk/models/shared"; - -let value: PullOperations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.PullOperation](../../../sdk/models/shared/pulloperation.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# PullOperations + +## Example Usage + +```typescript +import { PullOperations } from "@codat/platform/sdk/models/shared"; + +let value: PullOperations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.PullOperation](../../../sdk/models/shared/pulloperation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushchangetype.md b/platform/docs/sdk/models/shared/pushchangetype.md index da6c98fa6..8339c3422 100644 --- a/platform/docs/sdk/models/shared/pushchangetype.md +++ b/platform/docs/sdk/models/shared/pushchangetype.md @@ -1,17 +1,17 @@ -# PushChangeType - -Type of change being applied to record in third party platform. - -## Example Usage - -```typescript -import { PushChangeType } from "@codat/platform/sdk/models/shared"; - -let value: PushChangeType = "Created"; -``` - -## Values - -```typescript -"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" +# PushChangeType + +Type of change being applied to record in third party platform. + +## Example Usage + +```typescript +import { PushChangeType } from "@codat/platform/sdk/models/shared"; + +let value: PushChangeType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushfieldvalidation.md b/platform/docs/sdk/models/shared/pushfieldvalidation.md index 98172ed93..83ebb1043 100644 --- a/platform/docs/sdk/models/shared/pushfieldvalidation.md +++ b/platform/docs/sdk/models/shared/pushfieldvalidation.md @@ -1,19 +1,19 @@ -# PushFieldValidation - -## Example Usage - -```typescript -import { PushFieldValidation } from "@codat/platform/sdk/models/shared"; - -let value: PushFieldValidation = { - details: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | -| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | +# PushFieldValidation + +## Example Usage + +```typescript +import { PushFieldValidation } from "@codat/platform/sdk/models/shared"; + +let value: PushFieldValidation = { + details: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | | `ref` | *string* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoperation.md b/platform/docs/sdk/models/shared/pushoperation.md index b50671be3..a8f4a9930 100644 --- a/platform/docs/sdk/models/shared/pushoperation.md +++ b/platform/docs/sdk/models/shared/pushoperation.md @@ -1,37 +1,36 @@ -# PushOperation - -## Example Usage - -```typescript -import { PushOperation } from "@codat/platform/sdk/models/shared"; - -let value: PushOperation = { - changes: null, - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "9c39f707-db6c-421b-b270-d82fde811810", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 143409, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `requestedOnUtc` | *string* | :heavy_check_mark: | 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 | -| `completedOnUtc` | *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 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +# PushOperation + +## Example Usage + +```typescript +import { PushOperation } from "@codat/platform/sdk/models/shared"; + +let value: PushOperation = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "2022-10-23T00:00:00Z", + completedOnUtc: "2022-10-23T00:00:00Z", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `pushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | 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 | +| `completedOnUtc` | *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 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | | `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoperationchange.md b/platform/docs/sdk/models/shared/pushoperationchange.md index 083b16dc3..7cbb3600b 100644 --- a/platform/docs/sdk/models/shared/pushoperationchange.md +++ b/platform/docs/sdk/models/shared/pushoperationchange.md @@ -1,21 +1,17 @@ -# PushOperationChange - -## Example Usage - -```typescript -import { PushOperationChange } from "@codat/platform/sdk/models/shared"; - -let value: PushOperationChange = { - recordRef: { - dataType: "invoices", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | -| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +# PushOperationChange + +## Example Usage + +```typescript +import { PushOperationChange } from "@codat/platform/sdk/models/shared"; + +let value: PushOperationChange = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | N/A | +| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | | `attachmentId` | *string* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoperationref.md b/platform/docs/sdk/models/shared/pushoperationref.md index 28e8772a8..c4aad3c67 100644 --- a/platform/docs/sdk/models/shared/pushoperationref.md +++ b/platform/docs/sdk/models/shared/pushoperationref.md @@ -1,18 +1,16 @@ -# PushOperationRef - -## Example Usage - -```typescript -import { PushOperationRef } from "@codat/platform/sdk/models/shared"; - -let value: PushOperationRef = { - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file +# PushOperationRef + +## Example Usage + +```typescript +import { PushOperationRef } from "@codat/platform/sdk/models/shared"; + +let value: PushOperationRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_minus_sign: | Available data types | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoperations.md b/platform/docs/sdk/models/shared/pushoperations.md index b9c08aa7f..a89d2129b 100644 --- a/platform/docs/sdk/models/shared/pushoperations.md +++ b/platform/docs/sdk/models/shared/pushoperations.md @@ -1,31 +1,23 @@ -# PushOperations - -## Example Usage - -```typescript -import { PushOperations } from "@codat/platform/sdk/models/shared"; - -let value: PushOperations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# PushOperations + +## Example Usage + +```typescript +import { PushOperations } from "@codat/platform/sdk/models/shared"; + +let value: PushOperations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoperationstatus.md b/platform/docs/sdk/models/shared/pushoperationstatus.md index c75d37cde..61ec86d77 100644 --- a/platform/docs/sdk/models/shared/pushoperationstatus.md +++ b/platform/docs/sdk/models/shared/pushoperationstatus.md @@ -1,17 +1,17 @@ -# PushOperationStatus - -The current status of the push operation. - -## Example Usage - -```typescript -import { PushOperationStatus } from "@codat/platform/sdk/models/shared"; - -let value: PushOperationStatus = "Failed"; -``` - -## Values - -```typescript -"Pending" | "Failed" | "Success" | "TimedOut" +# PushOperationStatus + +The current status of the push operation. + +## Example Usage + +```typescript +import { PushOperationStatus } from "@codat/platform/sdk/models/shared"; + +let value: PushOperationStatus = "Pending"; +``` + +## Values + +```typescript +"Pending" | "Failed" | "Success" | "TimedOut" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoption.md b/platform/docs/sdk/models/shared/pushoption.md index a91aa1032..41eb3af3d 100644 --- a/platform/docs/sdk/models/shared/pushoption.md +++ b/platform/docs/sdk/models/shared/pushoption.md @@ -1,25 +1,25 @@ -# PushOption - -## Example Usage - -```typescript -import { PushOption } from "@codat/platform/sdk/models/shared"; - -let value: PushOption = { - type: "MultiPart", - displayName: "Travis.Ebert-Fahey", - required: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOption + +## Example Usage + +```typescript +import { PushOption } from "@codat/platform/sdk/models/shared"; + +let value: PushOption = { + type: "string", + displayName: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoptionchoice.md b/platform/docs/sdk/models/shared/pushoptionchoice.md index 4240342e8..b5ab8b664 100644 --- a/platform/docs/sdk/models/shared/pushoptionchoice.md +++ b/platform/docs/sdk/models/shared/pushoptionchoice.md @@ -1,19 +1,19 @@ -# PushOptionChoice - -## Example Usage - -```typescript -import { PushOptionChoice } from "@codat/platform/sdk/models/shared"; - -let value: PushOptionChoice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | -| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | +# PushOptionChoice + +## Example Usage + +```typescript +import { PushOptionChoice } from "@codat/platform/sdk/models/shared"; + +let value: PushOptionChoice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | +| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | | `required` | *boolean* | :heavy_minus_sign: | The property is required if `True`. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoptionproperty.md b/platform/docs/sdk/models/shared/pushoptionproperty.md index 220725e19..6ab752847 100644 --- a/platform/docs/sdk/models/shared/pushoptionproperty.md +++ b/platform/docs/sdk/models/shared/pushoptionproperty.md @@ -1,27 +1,26 @@ -# PushOptionProperty - -## Example Usage - -```typescript -import { PushOptionProperty } from "@codat/platform/sdk/models/shared"; - -let value: PushOptionProperty = { - type: "Array", - displayName: "Fannie10", - description: - "sonar very sympathetically notwithstanding alarmed modulo grizzled", - required: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_check_mark: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOptionProperty + +## Example Usage + +```typescript +import { PushOptionProperty } from "@codat/platform/sdk/models/shared"; + +let value: PushOptionProperty = { + type: "string", + displayName: "string", + description: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_check_mark: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushoptiontype.md b/platform/docs/sdk/models/shared/pushoptiontype.md index f96bd53ea..cf118c7f4 100644 --- a/platform/docs/sdk/models/shared/pushoptiontype.md +++ b/platform/docs/sdk/models/shared/pushoptiontype.md @@ -1,17 +1,17 @@ -# PushOptionType - -The option type. - -## Example Usage - -```typescript -import { PushOptionType } from "@codat/platform/sdk/models/shared"; - -let value: PushOptionType = "DateTime"; -``` - -## Values - -```typescript -"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" +# PushOptionType + +The option type. + +## Example Usage + +```typescript +import { PushOptionType } from "@codat/platform/sdk/models/shared"; + +let value: PushOptionType = "Array"; +``` + +## Values + +```typescript +"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/pushvalidationinfo.md b/platform/docs/sdk/models/shared/pushvalidationinfo.md index 976ca04d3..36e13c123 100644 --- a/platform/docs/sdk/models/shared/pushvalidationinfo.md +++ b/platform/docs/sdk/models/shared/pushvalidationinfo.md @@ -1,16 +1,16 @@ -# PushValidationInfo - -## Example Usage - -```typescript -import { PushValidationInfo } from "@codat/platform/sdk/models/shared"; - -let value: PushValidationInfo = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | +# PushValidationInfo + +## Example Usage + +```typescript +import { PushValidationInfo } from "@codat/platform/sdk/models/shared"; + +let value: PushValidationInfo = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | | `information` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/readcompletedwebhook.md b/platform/docs/sdk/models/shared/readcompletedwebhook.md index cb71ac729..fe6f5ad48 100644 --- a/platform/docs/sdk/models/shared/readcompletedwebhook.md +++ b/platform/docs/sdk/models/shared/readcompletedwebhook.md @@ -1,51 +1,21 @@ -# 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 | +# 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", +}; +``` + +## 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 index fb29e779b..525733d10 100644 --- a/platform/docs/sdk/models/shared/readcompletedwebhookpayload.md +++ b/platform/docs/sdk/models/shared/readcompletedwebhookpayload.md @@ -1,46 +1,17 @@ -# 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 +# ReadCompletedWebhookPayload + +## Example Usage + +```typescript +import { ReadCompletedWebhookPayload } from "@codat/platform/sdk/models/shared"; + +let value: ReadCompletedWebhookPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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. | +| `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/schemadatatype.md b/platform/docs/sdk/models/shared/schemadatatype.md index 54ebf76d2..e7489ab20 100644 --- a/platform/docs/sdk/models/shared/schemadatatype.md +++ b/platform/docs/sdk/models/shared/schemadatatype.md @@ -1,17 +1,15 @@ -# SchemaDataType - -Available data types - -## Example Usage - -```typescript -import { SchemaDataType } from "@codat/platform/sdk/models/shared"; - -let value: SchemaDataType = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# SchemaDataType + +## Example Usage + +```typescript +import { SchemaDataType } from "@codat/platform/sdk/models/shared"; + +let value: SchemaDataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/security.md b/platform/docs/sdk/models/shared/security.md index 570497a1f..1773d015b 100644 --- a/platform/docs/sdk/models/shared/security.md +++ b/platform/docs/sdk/models/shared/security.md @@ -1,17 +1,15 @@ -# Security - -## Example Usage - -```typescript -import { Security } from "@codat/platform/sdk/models/shared"; - -let value: Security = { - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `authHeader` | *string* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file +# Security + +## Example Usage + +```typescript +import { Security } from "@codat/platform/sdk/models/shared"; + +let value: Security = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `authHeader` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/sourcetype.md b/platform/docs/sdk/models/shared/sourcetype.md index 8ec02b1fd..1432317ae 100644 --- a/platform/docs/sdk/models/shared/sourcetype.md +++ b/platform/docs/sdk/models/shared/sourcetype.md @@ -1,17 +1,17 @@ -# SourceType - -The type of platform of the connection. - -## Example Usage - -```typescript -import { SourceType } from "@codat/platform/sdk/models/shared"; - -let value: SourceType = "Accounting"; -``` - -## Values - -```typescript -"Accounting" | "Banking" | "BankFeed" | "Commerce" | "Expense" | "Other" | "Unknown" +# SourceType + +The type of platform of the connection. + +## Example Usage + +```typescript +import { SourceType } from "@codat/platform/sdk/models/shared"; + +let value: SourceType = "Accounting"; +``` + +## Values + +```typescript +"Accounting" | "Banking" | "BankFeed" | "Commerce" | "Expense" | "Other" | "Unknown" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/status.md b/platform/docs/sdk/models/shared/status.md index 7a98b6153..7d6daae9d 100644 --- a/platform/docs/sdk/models/shared/status.md +++ b/platform/docs/sdk/models/shared/status.md @@ -1,17 +1,17 @@ -# Status - -The current status of the dataset. - -## Example Usage - -```typescript -import { Status } from "@codat/platform/sdk/models/shared"; - -let value: Status = "Validating"; -``` - -## Values - -```typescript -"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" +# Status + +The current status of the dataset. + +## Example Usage + +```typescript +import { Status } from "@codat/platform/sdk/models/shared"; + +let value: Status = "Initial"; +``` + +## Values + +```typescript +"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" ``` \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/supplementaldataconfiguration.md b/platform/docs/sdk/models/shared/supplementaldataconfiguration.md index 8abb9c9fd..c76473335 100644 --- a/platform/docs/sdk/models/shared/supplementaldataconfiguration.md +++ b/platform/docs/sdk/models/shared/supplementaldataconfiguration.md @@ -1,27 +1,27 @@ -# SupplementalDataConfiguration - -## Example Usage - -```typescript -import { SupplementalDataConfiguration } from "@codat/platform/sdk/models/shared"; - -let value: SupplementalDataConfiguration = { - supplementalDataConfig: { - "orders-supplemental-data": { - dataSource: "/orders", - pullData: { - "orderNumber": "order_num", - }, - pushData: { - "orderNumber": "order_num", - }, - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +# SupplementalDataConfiguration + +## Example Usage + +```typescript +import { SupplementalDataConfiguration } from "@codat/platform/sdk/models/shared"; + +let value: SupplementalDataConfiguration = { + supplementalDataConfig: { + "orders-supplemental-data": { + dataSource: "/orders", + pullData: { + "orderNumber": "order_num", + }, + pushData: { + "orderNumber": "order_num", + }, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `supplementalDataConfig` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/supplementaldatasourceconfiguration.md b/platform/docs/sdk/models/shared/supplementaldatasourceconfiguration.md index 0fc38e7d6..d705f098d 100644 --- a/platform/docs/sdk/models/shared/supplementaldatasourceconfiguration.md +++ b/platform/docs/sdk/models/shared/supplementaldatasourceconfiguration.md @@ -1,19 +1,19 @@ -# SupplementalDataSourceConfiguration - -The client's defined name for the object. - -## Example Usage - -```typescript -import { SupplementalDataSourceConfiguration } from "@codat/platform/sdk/models/shared"; - -let value: SupplementalDataSourceConfiguration = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `dataSource` | *string* | :heavy_minus_sign: | The underlying endpoint of the source system which the configuration is targeting. | -| `pullData` | Record | :heavy_minus_sign: | The additional properties that are required when pulling records. | +# SupplementalDataSourceConfiguration + +The client's defined name for the object. + +## Example Usage + +```typescript +import { SupplementalDataSourceConfiguration } from "@codat/platform/sdk/models/shared"; + +let value: SupplementalDataSourceConfiguration = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `dataSource` | *string* | :heavy_minus_sign: | The underlying endpoint of the source system which the configuration is targeting. | +| `pullData` | Record | :heavy_minus_sign: | The additional properties that are required when pulling records. | | `pushData` | Record | :heavy_minus_sign: | The additional properties that are required to create and/or update records. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/supportedfeature.md b/platform/docs/sdk/models/shared/supportedfeature.md index 98c35c953..4dd7db6a2 100644 --- a/platform/docs/sdk/models/shared/supportedfeature.md +++ b/platform/docs/sdk/models/shared/supportedfeature.md @@ -1,19 +1,16 @@ -# SupportedFeature - -## Example Usage - -```typescript -import { SupportedFeature } from "@codat/platform/sdk/models/shared"; - -let value: SupportedFeature = { - featureType: "Get", - featureState: "Release", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `featureType` | [shared.FeatureType](../../../sdk/models/shared/featuretype.md) | :heavy_check_mark: | The type of feature. | Get | -| `featureState` | [shared.FeatureState](../../../sdk/models/shared/featurestate.md) | :heavy_check_mark: | The current release state of the feature. | Release | \ No newline at end of file +# SupportedFeature + +## Example Usage + +```typescript +import { SupportedFeature } from "@codat/platform/sdk/models/shared"; + +let value: SupportedFeature = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `featureType` | [shared.FeatureType](../../../sdk/models/shared/featuretype.md) | :heavy_check_mark: | N/A | +| `featureState` | [shared.FeatureState](../../../sdk/models/shared/featurestate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/syncsetting.md b/platform/docs/sdk/models/shared/syncsetting.md index d6ab3f02a..e02ecafe0 100644 --- a/platform/docs/sdk/models/shared/syncsetting.md +++ b/platform/docs/sdk/models/shared/syncsetting.md @@ -1,33 +1,33 @@ -# SyncSetting - -Describes how often, and how much history, should be fetched for the given data type when a pull operation is queued. - -## Example Usage - -```typescript -import { SyncSetting } from "@codat/platform/sdk/models/shared"; - -let value: SyncSetting = { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_check_mark: | Available data types | invoices | -| `fetchOnFirstLink` | *boolean* | :heavy_check_mark: | Whether this data type should be queued after a company has authorized a connection. | | -| `syncSchedule` | *number* | :heavy_check_mark: | Number of hours after which this data type should be refreshed. | 24 | -| `syncOrder` | *number* | :heavy_check_mark: | The sync in which data types are queued for a sync. | | -| `syncFromUtc` | *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 | -| `syncFromWindow` | *number* | :heavy_minus_sign: | Number of months of data to be fetched. Set this *or* `syncFromUTC`. | 24 | -| `monthsToSync` | *number* | :heavy_minus_sign: | Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. | 24 | +# SyncSetting + +Describes how often, and how much history, should be fetched for the given data type when a pull operation is queued. + +## Example Usage + +```typescript +import { SyncSetting } from "@codat/platform/sdk/models/shared"; + +let value: SyncSetting = { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_check_mark: | Available data types | invoices | +| `fetchOnFirstLink` | *boolean* | :heavy_check_mark: | Whether this data type should be queued after a company has authorized a connection. | | +| `syncSchedule` | *number* | :heavy_check_mark: | Number of hours after which this data type should be refreshed. | 24 | +| `syncOrder` | *number* | :heavy_check_mark: | The sync in which data types are queued for a sync. | | +| `syncFromUtc` | *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 | +| `syncFromWindow` | *number* | :heavy_minus_sign: | Number of months of data to be fetched. Set this *or* `syncFromUTC`. | 24 | +| `monthsToSync` | *number* | :heavy_minus_sign: | Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. | 24 | | `isLocked` | *boolean* | :heavy_minus_sign: | `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/syncsettings.md b/platform/docs/sdk/models/shared/syncsettings.md index cc2b1d5ad..88050e0a0 100644 --- a/platform/docs/sdk/models/shared/syncsettings.md +++ b/platform/docs/sdk/models/shared/syncsettings.md @@ -1,30 +1,17 @@ -# SyncSettings - -## Example Usage - -```typescript -import { SyncSettings } from "@codat/platform/sdk/models/shared"; - -let value: SyncSettings = { - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `clientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_minus_sign: | N/A | +# SyncSettings + +## Example Usage + +```typescript +import { SyncSettings } from "@codat/platform/sdk/models/shared"; + +let value: SyncSettings = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `settings` | [shared.SyncSetting](../../../sdk/models/shared/syncsetting.md)[] | :heavy_minus_sign: | N/A | | `overridesDefaults` | *boolean* | :heavy_minus_sign: | Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/updateconnectionstatus.md b/platform/docs/sdk/models/shared/updateconnectionstatus.md index 3dfce0901..92ad70d7d 100644 --- a/platform/docs/sdk/models/shared/updateconnectionstatus.md +++ b/platform/docs/sdk/models/shared/updateconnectionstatus.md @@ -1,15 +1,15 @@ -# UpdateConnectionStatus - -## Example Usage - -```typescript -import { UpdateConnectionStatus } from "@codat/platform/sdk/models/shared"; - -let value: UpdateConnectionStatus = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +# UpdateConnectionStatus + +## Example Usage + +```typescript +import { UpdateConnectionStatus } from "@codat/platform/sdk/models/shared"; + +let value: UpdateConnectionStatus = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/validation.md b/platform/docs/sdk/models/shared/validation.md index ffa69ff19..41266e483 100644 --- a/platform/docs/sdk/models/shared/validation.md +++ b/platform/docs/sdk/models/shared/validation.md @@ -1,18 +1,18 @@ -# Validation - -A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { Validation } from "@codat/platform/sdk/models/shared"; - -let value: Validation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `errors` | [shared.ValidationItem1](../../../sdk/models/shared/validationitem1.md)[] | :heavy_minus_sign: | N/A | +# Validation + +A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { Validation } from "@codat/platform/sdk/models/shared"; + +let value: Validation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `errors` | [shared.ValidationItem1](../../../sdk/models/shared/validationitem1.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ValidationItem1](../../../sdk/models/shared/validationitem1.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/validationitem.md b/platform/docs/sdk/models/shared/validationitem.md index 0e9a8c316..2be01dda6 100644 --- a/platform/docs/sdk/models/shared/validationitem.md +++ b/platform/docs/sdk/models/shared/validationitem.md @@ -1,18 +1,18 @@ -# ValidationItem - -## Example Usage - -```typescript -import { ValidationItem } from "@codat/platform/sdk/models/shared"; - -let value: ValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ruleId` | *string* | :heavy_minus_sign: | The unique identifier of the rule that wasn't met. | -| `itemId` | *string* | :heavy_minus_sign: | The unique identifier of the item that was validated. | -| `message` | *string* | :heavy_minus_sign: | The message that describes the validation warning or error. | +# ValidationItem + +## Example Usage + +```typescript +import { ValidationItem } from "@codat/platform/sdk/models/shared"; + +let value: ValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ruleId` | *string* | :heavy_minus_sign: | The unique identifier of the rule that wasn't met. | +| `itemId` | *string* | :heavy_minus_sign: | The unique identifier of the item that was validated. | +| `message` | *string* | :heavy_minus_sign: | The message that describes the validation warning or error. | | `validatorName` | *string* | :heavy_minus_sign: | The name of the validator that was used to validate the item. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/validationitem1.md b/platform/docs/sdk/models/shared/validationitem1.md index 42624d40e..d887ff886 100644 --- a/platform/docs/sdk/models/shared/validationitem1.md +++ b/platform/docs/sdk/models/shared/validationitem1.md @@ -1,17 +1,17 @@ -# ValidationItem1 - -## Example Usage - -```typescript -import { ValidationItem1 } from "@codat/platform/sdk/models/shared"; - -let value: ValidationItem1 = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ValidationItem1 + +## Example Usage + +```typescript +import { ValidationItem1 } from "@codat/platform/sdk/models/shared"; + +let value: ValidationItem1 = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/validationresult.md b/platform/docs/sdk/models/shared/validationresult.md index 97150b68b..91d6ca311 100644 --- a/platform/docs/sdk/models/shared/validationresult.md +++ b/platform/docs/sdk/models/shared/validationresult.md @@ -1,16 +1,16 @@ -# ValidationResult - -## Example Usage - -```typescript -import { ValidationResult } from "@codat/platform/sdk/models/shared"; - -let value: ValidationResult = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | +# ValidationResult + +## Example Usage + +```typescript +import { ValidationResult } from "@codat/platform/sdk/models/shared"; + +let value: ValidationResult = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/webhookconsumer.md b/platform/docs/sdk/models/shared/webhookconsumer.md index 73b394759..dfc448fb2 100644 --- a/platform/docs/sdk/models/shared/webhookconsumer.md +++ b/platform/docs/sdk/models/shared/webhookconsumer.md @@ -1,26 +1,26 @@ -# WebhookConsumer - -A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. - -See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - - -## Example Usage - -```typescript -import { WebhookConsumer } from "@codat/platform/sdk/models/shared"; - -let value: WebhookConsumer = { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | -| `disabled` | *boolean* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | -| `eventTypes` | *string*[] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | +# WebhookConsumer + +A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. + +See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + + +## Example Usage + +```typescript +import { WebhookConsumer } from "@codat/platform/sdk/models/shared"; + +let value: WebhookConsumer = { + id: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | +| `disabled` | *boolean* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | +| `eventTypes` | *string*[] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | | `companyTags` | *string*[] | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/webhookconsumerprototype.md b/platform/docs/sdk/models/shared/webhookconsumerprototype.md index c193effb3..61c154b8d 100644 --- a/platform/docs/sdk/models/shared/webhookconsumerprototype.md +++ b/platform/docs/sdk/models/shared/webhookconsumerprototype.md @@ -1,18 +1,18 @@ -# WebhookConsumerPrototype - -## Example Usage - -```typescript -import { WebhookConsumerPrototype } from "@codat/platform/sdk/models/shared"; - -let value: WebhookConsumerPrototype = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | -| `disabled` | *boolean* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | -| `eventTypes` | *string*[] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | +# WebhookConsumerPrototype + +## Example Usage + +```typescript +import { WebhookConsumerPrototype } from "@codat/platform/sdk/models/shared"; + +let value: WebhookConsumerPrototype = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | +| `disabled` | *boolean* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | +| `eventTypes` | *string*[] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | `companyTags` | *string*[] | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | \ No newline at end of file diff --git a/platform/docs/sdk/models/shared/webhookconsumers.md b/platform/docs/sdk/models/shared/webhookconsumers.md index 55769a986..884b14900 100644 --- a/platform/docs/sdk/models/shared/webhookconsumers.md +++ b/platform/docs/sdk/models/shared/webhookconsumers.md @@ -1,21 +1,15 @@ -# WebhookConsumers - -## Example Usage - -```typescript -import { WebhookConsumers } from "@codat/platform/sdk/models/shared"; - -let value: WebhookConsumers = { - results: [ - { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +# WebhookConsumers + +## Example Usage + +```typescript +import { WebhookConsumers } from "@codat/platform/sdk/models/shared"; + +let value: WebhookConsumers = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `results` | [shared.WebhookConsumer](../../../sdk/models/shared/webhookconsumer.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 index df9cbc797..f90f99747 100644 --- a/platform/docs/sdk/models/shared/writestatus.md +++ b/platform/docs/sdk/models/shared/writestatus.md @@ -1,17 +1,17 @@ -# 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" +# 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 index 0a3c6740c..2130ca5b9 100644 --- a/platform/docs/sdk/models/shared/writetype.md +++ b/platform/docs/sdk/models/shared/writetype.md @@ -1,17 +1,17 @@ -# 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" +# WriteType + +Type of write request. + +## Example Usage + +```typescript +import { WriteType } from "@codat/platform/sdk/models/shared"; + +let value: WriteType = "Create"; +``` + +## Values + +```typescript +"Create" | "Update" | "Delete" | "UploadAttachment" ``` \ No newline at end of file diff --git a/platform/docs/sdks/companies/README.md b/platform/docs/sdks/companies/README.md index b1ac040b3..902e507c3 100644 --- a/platform/docs/sdks/companies/README.md +++ b/platform/docs/sdks/companies/README.md @@ -1,1568 +1,1568 @@ -# Companies - -## Overview - -Create and manage your SMB users' companies. - -### Available Operations - -* [list](#list) - List companies -* [create](#create) - Create company -* [get](#get) - Get company -* [delete](#delete) - Delete a company -* [replace](#replace) - Replace company -* [update](#update) - Update company -* [addProduct](#addproduct) - Add product -* [removeProduct](#removeproduct) - Remove product -* [refreshProductData](#refreshproductdata) - Refresh product data -* [getAccessToken](#getaccesstoken) - Get company access token -* [getCompanySyncSettings](#getcompanysyncsettings) - Get company sync settings -* [setCompanySyncSettings](#setcompanysyncsettings) - Set company sync settings - -## list - -The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -## Filter by tags - -The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - -- equals (`=`) -- not equals (`!=`) -- contains (`~`) - -For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: -- Foreign key: `uid = {yourCustomerId}` -- Region: `region != uk` -- Owning team and region: `region = uk && owningTeam = invoice-finance` - -### Example Usage: List of Companies - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesList } from "@codat/platform/funcs/companiesList.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatPlatform, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` -### Example Usage: One company - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesList } from "@codat/platform/funcs/companiesList.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatPlatform, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - -### Example Usage: Malformed query - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatPlatform, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a description - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.create({ - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatPlatform, { - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a tag - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatPlatform, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With no description - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.create({ - name: "Technicalium", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatPlatform, { - name: "Technicalium", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get company* endpoint returns a single company for a given `companyId`. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage: Parent multi-entity company - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Simple company - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Subsidiary multi-entity company - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.companies.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesDelete } from "@codat/platform/funcs/companiesDelete.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesDelete(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## replace - -Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update description - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -Use the *Update company* endpoint to update the name, description, or tags of the company. - -The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - -A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update tags - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## addProduct - -Use the *Add product* endpoint to enable a product for the company specified by `companyId`. - -> Note: This feature is currently in alpha and available only to participants in the development program. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.companies.addProduct({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesAddProduct } from "@codat/platform/funcs/companiesAddProduct.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesAddProduct(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesAddProduct failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.AddProductRequest](../../sdk/models/operations/addproductrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## removeProduct - -Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. - -> Note: This feature is currently in alpha and available only to participants in the development program. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.companies.removeProduct({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesRemoveProduct } from "@codat/platform/funcs/companiesRemoveProduct.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesRemoveProduct(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesRemoveProduct failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RemoveProductRequest](../../sdk/models/operations/removeproductrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## refreshProductData - -Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. - -### Tips and traps - -- This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead. -- If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. -- If a company has multiple custom products enabled, you can refresh data for each product individually. - - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual. - - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.companies.refreshProductData({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - requestBody: { - dataTypes: [ - "invoices", - "payments", - ], - }, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesRefreshProductData } from "@codat/platform/funcs/companiesRefreshProductData.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesRefreshProductData(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - productIdentifier: "bank-feeds", - requestBody: { - dataTypes: [ - "invoices", - "payments", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesRefreshProductData failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshProductDataRequest](../../sdk/models/operations/refreshproductdatarequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getAccessToken - -Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - -The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.getAccessToken({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesGetAccessToken } from "@codat/platform/funcs/companiesGetAccessToken.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGetAccessToken(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGetAccessToken failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyAccessTokenRequest](../../sdk/models/operations/getcompanyaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyAccessToken](../../sdk/models/shared/companyaccesstoken.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getCompanySyncSettings - -Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.companies.getCompanySyncSettings({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesGetCompanySyncSettings } from "@codat/platform/funcs/companiesGetCompanySyncSettings.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGetCompanySyncSettings(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGetCompanySyncSettings failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanySyncSettingsRequest](../../sdk/models/operations/getcompanysyncsettingsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanySyncSettings](../../sdk/models/shared/companysyncsettings.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## setCompanySyncSettings - -Set the sync settings for a specific company. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.companies.setCompanySyncSettings({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], - }, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { companiesSetCompanySyncSettings } from "@codat/platform/funcs/companiesSetCompanySyncSettings.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesSetCompanySyncSettings(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesSetCompanySyncSettings failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.SetCompanySyncSettingsRequest](../../sdk/models/operations/setcompanysyncsettingsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Companies + +## Overview + +Create and manage your SMB users' companies. + +### Available Operations + +* [list](#list) - List companies +* [create](#create) - Create company +* [get](#get) - Get company +* [delete](#delete) - Delete a company +* [replace](#replace) - Replace company +* [update](#update) - Update company +* [addProduct](#addproduct) - Add product +* [removeProduct](#removeproduct) - Remove product +* [refreshProductData](#refreshproductdata) - Refresh product data +* [getAccessToken](#getaccesstoken) - Get company access token +* [getCompanySyncSettings](#getcompanysyncsettings) - Get company sync settings +* [setCompanySyncSettings](#setcompanysyncsettings) - Set company sync settings + +## list + +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + +### Example Usage: List of Companies + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesList } from "@codat/platform/funcs/companiesList.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatPlatform, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` +### Example Usage: One company + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesList } from "@codat/platform/funcs/companiesList.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatPlatform, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + +### Example Usage: Malformed query + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatPlatform, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a description + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.create({ + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatPlatform, { + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a tag + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatPlatform, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With no description + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.create({ + name: "Technicalium", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesCreate } from "@codat/platform/funcs/companiesCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatPlatform, { + name: "Technicalium", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get company* endpoint returns a single company for a given `companyId`. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage: Parent multi-entity company + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Simple company + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subsidiary multi-entity company + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesGet } from "@codat/platform/funcs/companiesGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.companies.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesDelete } from "@codat/platform/funcs/companiesDelete.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesDelete(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## replace + +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update description + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesReplace } from "@codat/platform/funcs/companiesReplace.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update tags + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesUpdate } from "@codat/platform/funcs/companiesUpdate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## addProduct + +Use the *Add product* endpoint to enable a product for the company specified by `companyId`. + +> Note: This feature is currently in alpha and available only to participants in the development program. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.companies.addProduct({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesAddProduct } from "@codat/platform/funcs/companiesAddProduct.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesAddProduct(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesAddProduct failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AddProductRequest](../../sdk/models/operations/addproductrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## removeProduct + +Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. + +> Note: This feature is currently in alpha and available only to participants in the development program. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.companies.removeProduct({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesRemoveProduct } from "@codat/platform/funcs/companiesRemoveProduct.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesRemoveProduct(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesRemoveProduct failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RemoveProductRequest](../../sdk/models/operations/removeproductrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## refreshProductData + +Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. + +### Tips and traps + +- This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead. +- If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. +- If a company has multiple custom products enabled, you can refresh data for each product individually. + - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual. + - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.companies.refreshProductData({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + requestBody: { + dataTypes: [ + "invoices", + "payments", + ], + }, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesRefreshProductData } from "@codat/platform/funcs/companiesRefreshProductData.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesRefreshProductData(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + productIdentifier: "bank-feeds", + requestBody: { + dataTypes: [ + "invoices", + "payments", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesRefreshProductData failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshProductDataRequest](../../sdk/models/operations/refreshproductdatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getAccessToken + +Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. + +The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.getAccessToken({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesGetAccessToken } from "@codat/platform/funcs/companiesGetAccessToken.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGetAccessToken(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGetAccessToken failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyAccessTokenRequest](../../sdk/models/operations/getcompanyaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyAccessToken](../../sdk/models/shared/companyaccesstoken.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCompanySyncSettings + +Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.companies.getCompanySyncSettings({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesGetCompanySyncSettings } from "@codat/platform/funcs/companiesGetCompanySyncSettings.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGetCompanySyncSettings(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGetCompanySyncSettings failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanySyncSettingsRequest](../../sdk/models/operations/getcompanysyncsettingsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanySyncSettings](../../sdk/models/shared/companysyncsettings.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## setCompanySyncSettings + +Set the sync settings for a specific company. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.companies.setCompanySyncSettings({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], + }, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { companiesSetCompanySyncSettings } from "@codat/platform/funcs/companiesSetCompanySyncSettings.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesSetCompanySyncSettings(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesSetCompanySyncSettings failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.SetCompanySyncSettingsRequest](../../sdk/models/operations/setcompanysyncsettingsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connectionmanagement/README.md b/platform/docs/sdks/connectionmanagement/README.md index 9f645690b..0b26a2237 100644 --- a/platform/docs/sdks/connectionmanagement/README.md +++ b/platform/docs/sdks/connectionmanagement/README.md @@ -1,92 +1,92 @@ -# ~~ConnectionManagement~~ - -> [!WARNING] -> This SDK is **DEPRECATED** - -## Overview - -Configure UI and retrieve access tokens for authentication used by **Connections SDK**. - -### Available Operations - -* [~~get~~](#get) - Get access token (old) :warning: **Deprecated** Use [getAccessToken](docs/sdks/companies/README.md#getaccesstoken) instead. - -## ~~get~~ - -The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. - -> :warning: **DEPRECATED**: The endpoint for generating company-specific connection management access tokens has been deprecated. -Codat now supports a global company access token, providing seamless access across multiple products. -Update your integration to use the global token for improved efficiency and consistency. -. Use `getAccessToken` instead. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connectionManagement.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionManagementGet } from "@codat/platform/funcs/connectionManagementGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionManagementGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionManagementGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionManagementAccessTokenRequest](../../sdk/models/operations/getconnectionmanagementaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ConnectionManagementAccessToken](../../sdk/models/shared/connectionmanagementaccesstoken.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# ~~ConnectionManagement~~ + +> [!WARNING] +> This SDK is **DEPRECATED** + +## Overview + +Configure UI and retrieve access tokens for authentication used by **Connections SDK**. + +### Available Operations + +* [~~get~~](#get) - Get access token (old) :warning: **Deprecated** Use [getAccessToken](docs/sdks/companies/README.md#getaccesstoken) instead. + +## ~~get~~ + +The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. + +> :warning: **DEPRECATED**: The endpoint for generating company-specific connection management access tokens has been deprecated. +Codat now supports a global company access token, providing seamless access across multiple products. +Update your integration to use the global token for improved efficiency and consistency. +. Use `getAccessToken` instead. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connectionManagement.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionManagementGet } from "@codat/platform/funcs/connectionManagementGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionManagementGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionManagementGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionManagementAccessTokenRequest](../../sdk/models/operations/getconnectionmanagementaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ConnectionManagementAccessToken](../../sdk/models/shared/connectionmanagementaccesstoken.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connections/README.md b/platform/docs/sdks/connections/README.md index bc0ad2ca3..efb2e09fb 100644 --- a/platform/docs/sdks/connections/README.md +++ b/platform/docs/sdks/connections/README.md @@ -1,546 +1,546 @@ -# Connections - -## Overview - -Create new and manage existing data connections for a company. - -### Available Operations - -* [list](#list) - List connections -* [create](#create) - Create connection -* [get](#get) - Get connection -* [delete](#delete) - Delete connection -* [unlink](#unlink) - Unlink connection -* [updateAuthorization](#updateauthorization) - Update authorization - -## list - -List the connections for a company. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsList } from "@codat/platform/funcs/connectionsList.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsList(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Creates a connection for the company by providing a valid `platformKey`. - -Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - -### Example Usage: Connection - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsCreate } from "@codat/platform/funcs/connectionsCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsCreate } from "@codat/platform/funcs/connectionsCreate.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsGet } from "@codat/platform/funcs/connectionsGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -Revoke and remove a connection from a company. -This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.connections.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsDelete } from "@codat/platform/funcs/connectionsDelete.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsDelete(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("connectionsDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## unlink - -This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.unlink({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - updateConnectionStatus: { - status: "Unlinked", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsUnlink } from "@codat/platform/funcs/connectionsUnlink.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsUnlink(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - updateConnectionStatus: { - status: "Unlinked", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsUnlink failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## updateAuthorization - -Update data connection's authorization. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.connections.updateAuthorization({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { connectionsUpdateAuthorization } from "@codat/platform/funcs/connectionsUpdateAuthorization.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsUpdateAuthorization(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsUpdateAuthorization failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateConnectionAuthorizationRequest](../../sdk/models/operations/updateconnectionauthorizationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Connections + +## Overview + +Create new and manage existing data connections for a company. + +### Available Operations + +* [list](#list) - List connections +* [create](#create) - Create connection +* [get](#get) - Get connection +* [delete](#delete) - Delete connection +* [unlink](#unlink) - Unlink connection +* [updateAuthorization](#updateauthorization) - Update authorization + +## list + +List the connections for a company. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsList } from "@codat/platform/funcs/connectionsList.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsList(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Creates a connection for the company by providing a valid `platformKey`. + +Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + +### Example Usage: Connection + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsCreate } from "@codat/platform/funcs/connectionsCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsCreate } from "@codat/platform/funcs/connectionsCreate.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsGet } from "@codat/platform/funcs/connectionsGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Revoke and remove a connection from a company. +This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.connections.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsDelete } from "@codat/platform/funcs/connectionsDelete.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsDelete(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("connectionsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## unlink + +This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.unlink({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + updateConnectionStatus: { + status: "Unlinked", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsUnlink } from "@codat/platform/funcs/connectionsUnlink.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsUnlink(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + updateConnectionStatus: { + status: "Unlinked", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsUnlink failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## updateAuthorization + +Update data connection's authorization. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.connections.updateAuthorization({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { connectionsUpdateAuthorization } from "@codat/platform/funcs/connectionsUpdateAuthorization.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsUpdateAuthorization(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsUpdateAuthorization failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateConnectionAuthorizationRequest](../../sdk/models/operations/updateconnectionauthorizationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/cors/README.md b/platform/docs/sdks/cors/README.md index 7cc250dae..10b29de8f 100644 --- a/platform/docs/sdks/cors/README.md +++ b/platform/docs/sdks/cors/README.md @@ -1,225 +1,225 @@ -# ~~Cors~~ - -> [!WARNING] -> This SDK is **DEPRECATED** - -## Overview - -### Available Operations - -* [~~get~~](#get) - Get CORS settings (old) :warning: **Deprecated** Use [get](docs/sdks/settings/README.md#get) instead. -* [~~set~~](#set) - Set CORS settings (old) :warning: **Deprecated** Use [set](docs/sdks/settings/README.md#set) instead. - -## ~~get~~ - -The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - -Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - -> :warning: **DEPRECATED**: The new [Get CORS settings](https://docs.codat.io/platform-api#/operations/get-cors-settings) endpoint replaces this endpoint and includes additional functionality. -Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. -. Use `get` instead. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.cors.get(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { corsGet } from "@codat/platform/funcs/corsGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await corsGet(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("corsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## ~~set~~ - -The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - -Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - -> :warning: **DEPRECATED**: The new [Set CORS settings](https://docs.codat.io/platform-api#/operations/set-cors-settings) endpoint replaces this endpoint and includes additional functionality. -Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. -. Use `set` instead. - -### Example Usage: Allowed origins - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.cors.set({ - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { corsSet } from "@codat/platform/funcs/corsSet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await corsSet(codatPlatform, { - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("corsSet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.cors.set({ - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { corsSet } from "@codat/platform/funcs/corsSet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await corsSet(codatPlatform, { - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("corsSet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# ~~Cors~~ + +> [!WARNING] +> This SDK is **DEPRECATED** + +## Overview + +### Available Operations + +* [~~get~~](#get) - Get CORS settings (old) :warning: **Deprecated** Use [get](docs/sdks/settings/README.md#get) instead. +* [~~set~~](#set) - Set CORS settings (old) :warning: **Deprecated** Use [set](docs/sdks/settings/README.md#set) instead. + +## ~~get~~ + +The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. + +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +> :warning: **DEPRECATED**: The new [Get CORS settings](https://docs.codat.io/platform-api#/operations/get-cors-settings) endpoint replaces this endpoint and includes additional functionality. +Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. +. Use `get` instead. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.cors.get(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { corsGet } from "@codat/platform/funcs/corsGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await corsGet(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("corsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## ~~set~~ + +The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +> :warning: **DEPRECATED**: The new [Set CORS settings](https://docs.codat.io/platform-api#/operations/set-cors-settings) endpoint replaces this endpoint and includes additional functionality. +Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. +. Use `set` instead. + +### Example Usage: Allowed origins + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.cors.set({ + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { corsSet } from "@codat/platform/funcs/corsSet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await corsSet(codatPlatform, { + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("corsSet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.cors.set({ + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { corsSet } from "@codat/platform/funcs/corsSet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await corsSet(codatPlatform, { + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("corsSet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/customdatatype/README.md b/platform/docs/sdks/customdatatype/README.md index 3eaa58ef5..35fef49e3 100644 --- a/platform/docs/sdks/customdatatype/README.md +++ b/platform/docs/sdks/customdatatype/README.md @@ -1,694 +1,694 @@ -# CustomDataType - -## Overview - -Configure and pull additional data types that are not included in Codat's standardized data model. - -### Available Operations - -* [configure](#configure) - Configure custom data type -* [getConfiguration](#getconfiguration) - Get custom data configuration -* [refresh](#refresh) - Refresh custom data type -* [list](#list) - List custom data type records - -## configure - -The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. - -A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - -### Tips and traps - -- You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - -- You can only indicate a single data source for each customer data type. - -- Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. - -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.configure({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "api/purchaseOrders", - requiredData: { - "currency": "$[*].currencyCode", - "number": "$[*].number", - "date": "$[*].orderDate", - "totalexvat": "$[*].totalAmountExcludingTax", - "totaltax": "$[*].totalTaxAmount", - "vendor": "$[*].number", - }, - keyBy: [ - "$[*].id", - ], - sourceModifiedDate: [ - "$[*].lastModifiedDateTime", - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeConfigure(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "api/purchaseOrders", - requiredData: { - "currency": "$[*].currencyCode", - "number": "$[*].number", - "date": "$[*].orderDate", - "totalexvat": "$[*].totalAmountExcludingTax", - "totaltax": "$[*].totalTaxAmount", - "vendor": "$[*].number", - }, - keyBy: [ - "$[*].id", - ], - sourceModifiedDate: [ - "$[*].lastModifiedDateTime", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.configure({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/query?query=select * from Account", - requiredData: { - "id": "$.Id", - "Currentbal": "$.CurrentBalance", - "SubAcc": "$.SubAccount", - }, - keyBy: [ - "$.Id", - ], - sourceModifiedDate: [ - "$.time", - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeConfigure(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/query?query=select * from Account", - requiredData: { - "id": "$.Id", - "Currentbal": "$.CurrentBalance", - "SubAcc": "$.SubAccount", - }, - keyBy: [ - "$.Id", - ], - sourceModifiedDate: [ - "$.time", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.configure({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", - requiredData: { - "currencyCode": "$[*].currencyCode", - "id": "$[*].id", - "number": "$[*].number", - "orderDate": "$[*].orderDate", - "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", - "totalTaxAmount": "$[*].totalTaxAmount", - "vendorName": "$[*].number", - }, - keyBy: [ - "$[*].id", - ], - sourceModifiedDate: [ - "$[*].lastModifiedDateTime", - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeConfigure(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", - requiredData: { - "currencyCode": "$[*].currencyCode", - "id": "$[*].id", - "number": "$[*].number", - "orderDate": "$[*].orderDate", - "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", - "totalTaxAmount": "$[*].totalTaxAmount", - "vendorName": "$[*].number", - }, - keyBy: [ - "$[*].id", - ], - sourceModifiedDate: [ - "$[*].lastModifiedDateTime", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero Mapping Arrays - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.configure({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/api.xro/2.0/Invoices", - requiredData: { - "invNumber": "$.InvoiceNumber", - "type": "$.Type", - "InvoiceID": "$.InvoiceID", - "lines": "$.LineItems[*]", - }, - keyBy: [ - "$.InvoiceID", - ], - sourceModifiedDate: [ - "$.UpdatedDateUTC", - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeConfigure(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/api.xro/2.0/Invoices", - requiredData: { - "invNumber": "$.InvoiceNumber", - "type": "$.Type", - "InvoiceID": "$.InvoiceID", - "lines": "$.LineItems[*]", - }, - keyBy: [ - "$.InvoiceID", - ], - sourceModifiedDate: [ - "$.UpdatedDateUTC", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero Simple Record - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.configure({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/api.xro/2.0/Accounts", - requiredData: { - "code": "$.Code", - "accountId": "$.AccountID", - "type": "$.Type", - "SysAcc": "$.SystemAccount", - }, - keyBy: [ - "$.AccountID", - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeConfigure(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - customDataTypeConfiguration: { - dataSource: "/api.xro/2.0/Accounts", - requiredData: { - "code": "$.Code", - "accountId": "$.AccountID", - "type": "$.Type", - "SysAcc": "$.SystemAccount", - }, - keyBy: [ - "$.AccountID", - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeConfigure failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ConfigureCustomDataTypeRequest](../../sdk/models/operations/configurecustomdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CustomDataTypeConfiguration](../../sdk/models/shared/customdatatypeconfiguration.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getConfiguration - -The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. - -A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.getConfiguration({ - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeGetConfiguration } from "@codat/platform/funcs/customDataTypeGetConfiguration.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeGetConfiguration(codatPlatform, { - platformKey: "gbol", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeGetConfiguration failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCustomDataTypeConfigurationRequest](../../sdk/models/operations/getcustomdatatypeconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CustomDataTypeRecords](../../sdk/models/shared/customdatatyperecords.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## refresh - -The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.refresh({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeRefresh } from "@codat/platform/funcs/customDataTypeRefresh.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeRefresh(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeRefresh failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshCustomDataTypeRequest](../../sdk/models/operations/refreshcustomdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429, 451 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## list - -The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. - -A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.customDataType.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { customDataTypeList } from "@codat/platform/funcs/customDataTypeList.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customDataTypeList(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customDataIdentifier: "DynamicsPurchaseOrders", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customDataTypeList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCustomDataTypeRecordsRequest](../../sdk/models/operations/listcustomdatatyperecordsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CustomDataTypeRecords](../../sdk/models/shared/customdatatyperecords.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 451 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# CustomDataType + +## Overview + +Configure and pull additional data types that are not included in Codat's standardized data model. + +### Available Operations + +* [configure](#configure) - Configure custom data type +* [getConfiguration](#getconfiguration) - Get custom data configuration +* [refresh](#refresh) - Refresh custom data type +* [list](#list) - List custom data type records + +## configure + +The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. + +A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. + +### Tips and traps + +- You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. + +- You can only indicate a single data source for each customer data type. + +- Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. + +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.configure({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "api/purchaseOrders", + requiredData: { + "currency": "$[*].currencyCode", + "number": "$[*].number", + "date": "$[*].orderDate", + "totalexvat": "$[*].totalAmountExcludingTax", + "totaltax": "$[*].totalTaxAmount", + "vendor": "$[*].number", + }, + keyBy: [ + "$[*].id", + ], + sourceModifiedDate: [ + "$[*].lastModifiedDateTime", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeConfigure(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "api/purchaseOrders", + requiredData: { + "currency": "$[*].currencyCode", + "number": "$[*].number", + "date": "$[*].orderDate", + "totalexvat": "$[*].totalAmountExcludingTax", + "totaltax": "$[*].totalTaxAmount", + "vendor": "$[*].number", + }, + keyBy: [ + "$[*].id", + ], + sourceModifiedDate: [ + "$[*].lastModifiedDateTime", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.configure({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/query?query=select * from Account", + requiredData: { + "id": "$.Id", + "Currentbal": "$.CurrentBalance", + "SubAcc": "$.SubAccount", + }, + keyBy: [ + "$.Id", + ], + sourceModifiedDate: [ + "$.time", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeConfigure(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/query?query=select * from Account", + requiredData: { + "id": "$.Id", + "Currentbal": "$.CurrentBalance", + "SubAcc": "$.SubAccount", + }, + keyBy: [ + "$.Id", + ], + sourceModifiedDate: [ + "$.time", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.configure({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", + requiredData: { + "currencyCode": "$[*].currencyCode", + "id": "$[*].id", + "number": "$[*].number", + "orderDate": "$[*].orderDate", + "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", + "totalTaxAmount": "$[*].totalTaxAmount", + "vendorName": "$[*].number", + }, + keyBy: [ + "$[*].id", + ], + sourceModifiedDate: [ + "$[*].lastModifiedDateTime", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeConfigure(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "api/purchaseOrders?$filter=currencyCode eq 'NOK'", + requiredData: { + "currencyCode": "$[*].currencyCode", + "id": "$[*].id", + "number": "$[*].number", + "orderDate": "$[*].orderDate", + "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", + "totalTaxAmount": "$[*].totalTaxAmount", + "vendorName": "$[*].number", + }, + keyBy: [ + "$[*].id", + ], + sourceModifiedDate: [ + "$[*].lastModifiedDateTime", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero Mapping Arrays + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.configure({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/api.xro/2.0/Invoices", + requiredData: { + "invNumber": "$.InvoiceNumber", + "type": "$.Type", + "InvoiceID": "$.InvoiceID", + "lines": "$.LineItems[*]", + }, + keyBy: [ + "$.InvoiceID", + ], + sourceModifiedDate: [ + "$.UpdatedDateUTC", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeConfigure(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/api.xro/2.0/Invoices", + requiredData: { + "invNumber": "$.InvoiceNumber", + "type": "$.Type", + "InvoiceID": "$.InvoiceID", + "lines": "$.LineItems[*]", + }, + keyBy: [ + "$.InvoiceID", + ], + sourceModifiedDate: [ + "$.UpdatedDateUTC", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero Simple Record + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.configure({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/api.xro/2.0/Accounts", + requiredData: { + "code": "$.Code", + "accountId": "$.AccountID", + "type": "$.Type", + "SysAcc": "$.SystemAccount", + }, + keyBy: [ + "$.AccountID", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeConfigure } from "@codat/platform/funcs/customDataTypeConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeConfigure(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + customDataTypeConfiguration: { + dataSource: "/api.xro/2.0/Accounts", + requiredData: { + "code": "$.Code", + "accountId": "$.AccountID", + "type": "$.Type", + "SysAcc": "$.SystemAccount", + }, + keyBy: [ + "$.AccountID", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeConfigure failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ConfigureCustomDataTypeRequest](../../sdk/models/operations/configurecustomdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CustomDataTypeConfiguration](../../sdk/models/shared/customdatatypeconfiguration.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getConfiguration + +The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. + +A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.getConfiguration({ + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeGetConfiguration } from "@codat/platform/funcs/customDataTypeGetConfiguration.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeGetConfiguration(codatPlatform, { + platformKey: "gbol", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeGetConfiguration failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCustomDataTypeConfigurationRequest](../../sdk/models/operations/getcustomdatatypeconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CustomDataTypeRecords](../../sdk/models/shared/customdatatyperecords.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## refresh + +The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.refresh({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeRefresh } from "@codat/platform/funcs/customDataTypeRefresh.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeRefresh(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeRefresh failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshCustomDataTypeRequest](../../sdk/models/operations/refreshcustomdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 451 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. + +A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.customDataType.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { customDataTypeList } from "@codat/platform/funcs/customDataTypeList.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customDataTypeList(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customDataIdentifier: "DynamicsPurchaseOrders", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customDataTypeList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCustomDataTypeRecordsRequest](../../sdk/models/operations/listcustomdatatyperecordsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CustomDataTypeRecords](../../sdk/models/shared/customdatatyperecords.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 451 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/integrations/README.md b/platform/docs/sdks/integrations/README.md index e922543c4..730e1182c 100644 --- a/platform/docs/sdks/integrations/README.md +++ b/platform/docs/sdks/integrations/README.md @@ -1,238 +1,238 @@ -# Integrations - -## Overview - -Get a list of integrations supported by Codat and their logos. - -### Available Operations - -* [list](#list) - List integrations -* [get](#get) - Get integration -* [getBranding](#getbranding) - Get branding - -## list - -List your available integrations - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.integrations.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { integrationsList } from "@codat/platform/funcs/integrationsList.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await integrationsList(codatPlatform, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("integrationsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListIntegrationsRequest](../../sdk/models/operations/listintegrationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Integrations](../../sdk/models/shared/integrations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get single integration, by platformKey - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.integrations.get({ - platformKey: "gbol", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { integrationsGet } from "@codat/platform/funcs/integrationsGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await integrationsGet(codatPlatform, { - platformKey: "gbol", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("integrationsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetIntegrationRequest](../../sdk/models/operations/getintegrationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Integration](../../sdk/models/shared/integration.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getBranding - -Get branding for platform. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.integrations.getBranding({ - platformKey: "gbol", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { integrationsGetBranding } from "@codat/platform/funcs/integrationsGetBranding.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await integrationsGetBranding(codatPlatform, { - platformKey: "gbol", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("integrationsGetBranding failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetIntegrationsBrandingRequest](../../sdk/models/operations/getintegrationsbrandingrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Branding](../../sdk/models/shared/branding.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Integrations + +## Overview + +Get a list of integrations supported by Codat and their logos. + +### Available Operations + +* [list](#list) - List integrations +* [get](#get) - Get integration +* [getBranding](#getbranding) - Get branding + +## list + +List your available integrations + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.integrations.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { integrationsList } from "@codat/platform/funcs/integrationsList.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await integrationsList(codatPlatform, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("integrationsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListIntegrationsRequest](../../sdk/models/operations/listintegrationsrequest.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Integrations](../../sdk/models/shared/integrations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get single integration, by platformKey + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.integrations.get({ + platformKey: "gbol", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { integrationsGet } from "@codat/platform/funcs/integrationsGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await integrationsGet(codatPlatform, { + platformKey: "gbol", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("integrationsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetIntegrationRequest](../../sdk/models/operations/getintegrationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Integration](../../sdk/models/shared/integration.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getBranding + +Get branding for platform. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.integrations.getBranding({ + platformKey: "gbol", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { integrationsGetBranding } from "@codat/platform/funcs/integrationsGetBranding.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await integrationsGetBranding(codatPlatform, { + platformKey: "gbol", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("integrationsGetBranding failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetIntegrationsBrandingRequest](../../sdk/models/operations/getintegrationsbrandingrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Branding](../../sdk/models/shared/branding.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/pushdata/README.md b/platform/docs/sdks/pushdata/README.md index 00231222f..d20909860 100644 --- a/platform/docs/sdks/pushdata/README.md +++ b/platform/docs/sdks/pushdata/README.md @@ -1,254 +1,252 @@ -# PushData - -## Overview - -Initiate and monitor Create, Update, and Delete operations. - -### Available Operations - -* [getModelOptions](#getmodeloptions) - Get push options -* [listOperations](#listoperations) - List push operations -* [getOperation](#getoperation) - Get push operation - -## getModelOptions - -This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. - -Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. - -Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.pushData.getModelOptions({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { pushDataGetModelOptions } from "@codat/platform/funcs/pushDataGetModelOptions.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await pushDataGetModelOptions(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - dataType: "invoices", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("pushDataGetModelOptions failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateUpdateModelOptionsByDataTypeRequest](../../sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listOperations - -The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. - -Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.pushData.listOperations({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { pushDataListOperations } from "@codat/platform/funcs/pushDataListOperations.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await pushDataListOperations(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("pushDataListOperations failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyPushHistoryRequest](../../sdk/models/operations/getcompanypushhistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getOperation - -The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - -Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.pushData.getOperation({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { pushDataGetOperation } from "@codat/platform/funcs/pushDataGetOperation.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await pushDataGetOperation(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("pushDataGetOperation failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetPushOperationRequest](../../sdk/models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# PushData + +## Overview + +Initiate and monitor Create, Update, and Delete operations. + +### Available Operations + +* [getModelOptions](#getmodeloptions) - Get push options +* [listOperations](#listoperations) - List push operations +* [getOperation](#getoperation) - Get push operation + +## getModelOptions + +This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. + +Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. + +Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.pushData.getModelOptions({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + dataType: "invoices", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { pushDataGetModelOptions } from "@codat/platform/funcs/pushDataGetModelOptions.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await pushDataGetModelOptions(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + dataType: "invoices", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("pushDataGetModelOptions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateUpdateModelOptionsByDataTypeRequest](../../sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listOperations + +The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.pushData.listOperations({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { pushDataListOperations } from "@codat/platform/funcs/pushDataListOperations.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await pushDataListOperations(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("pushDataListOperations failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyPushHistoryRequest](../../sdk/models/operations/getcompanypushhistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getOperation + +The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.pushData.getOperation({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { pushDataGetOperation } from "@codat/platform/funcs/pushDataGetOperation.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await pushDataGetOperation(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("pushDataGetOperation failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPushOperationRequest](../../sdk/models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/readdata/README.md b/platform/docs/sdks/readdata/README.md index 79d62c950..0a602513f 100644 --- a/platform/docs/sdks/readdata/README.md +++ b/platform/docs/sdks/readdata/README.md @@ -1,91 +1,89 @@ -# ReadData - -## Overview - -View validation outcomes for completed read data operations. - -### Available Operations - -* [getValidationResults](#getvalidationresults) - Get validation results - -## getValidationResults - -Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. - -The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - -- **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. -- **`errors`** array contains critical issues that must be resolved before the data type can be used. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.readData.getValidationResults({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "0812af6e-436a-491f-9056-db91cb961ad3", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { readDataGetValidationResults } from "@codat/platform/funcs/readDataGetValidationResults.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await readDataGetValidationResults(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "0812af6e-436a-491f-9056-db91cb961ad3", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("readDataGetValidationResults failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetReadValidationResultsRequest](../../sdk/models/operations/getreadvalidationresultsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ValidationResult](../../sdk/models/shared/validationresult.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# ReadData + +## Overview + +View validation outcomes for completed read data operations. + +### Available Operations + +* [getValidationResults](#getvalidationresults) - Get validation results + +## getValidationResults + +Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. + +The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: + +- **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. +- **`errors`** array contains critical issues that must be resolved before the data type can be used. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.readData.getValidationResults({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { readDataGetValidationResults } from "@codat/platform/funcs/readDataGetValidationResults.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await readDataGetValidationResults(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("readDataGetValidationResults failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetReadValidationResultsRequest](../../sdk/models/operations/getreadvalidationresultsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ValidationResult](../../sdk/models/shared/validationresult.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/refreshdata/README.md b/platform/docs/sdks/refreshdata/README.md index 73a47f90d..ac12e30e2 100644 --- a/platform/docs/sdks/refreshdata/README.md +++ b/platform/docs/sdks/refreshdata/README.md @@ -1,402 +1,400 @@ -# RefreshData - -## Overview - -Initiate data refreshes, view pull status and history. - -### Available Operations - -* [all](#all) - Refresh all data -* [byDataType](#bydatatype) - Refresh data type -* [get](#get) - Get data status -* [listPullOperations](#listpulloperations) - List pull operations -* [getPullOperation](#getpulloperation) - Get pull operation - -## all - -Refreshes all data types with `fetch on first link` set to `true` for a given company. - -This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - -[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.refreshData.all({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { refreshDataAll } from "@codat/platform/funcs/refreshDataAll.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await refreshDataAll(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("refreshDataAll failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshCompanyDataRequest](../../sdk/models/operations/refreshcompanydatarequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## byDataType - -Refreshes a given data type for a given company. - -This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.refreshData.byDataType({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { refreshDataByDataType } from "@codat/platform/funcs/refreshDataByDataType.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await refreshDataByDataType(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("refreshDataByDataType failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshDataTypeRequest](../../sdk/models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get the state of each data type for a company - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.refreshData.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { refreshDataGet } from "@codat/platform/funcs/refreshDataGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await refreshDataGet(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("refreshDataGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyDataStatusRequest](../../sdk/models/operations/getcompanydatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.DataStatuses](../../sdk/models/shared/datastatuses.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listPullOperations - -Gets the pull operation history (datasets) for a given company. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.refreshData.listPullOperations({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { refreshDataListPullOperations } from "@codat/platform/funcs/refreshDataListPullOperations.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await refreshDataListPullOperations(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("refreshDataListPullOperations failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListPullOperationsRequest](../../sdk/models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperations](../../sdk/models/shared/pulloperations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getPullOperation - -Retrieve information about a single dataset or pull operation. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.refreshData.getPullOperation({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { refreshDataGetPullOperation } from "@codat/platform/funcs/refreshDataGetPullOperation.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await refreshDataGetPullOperation(codatPlatform, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("refreshDataGetPullOperation failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetPullOperationRequest](../../sdk/models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# RefreshData + +## Overview + +Initiate data refreshes, view pull status and history. + +### Available Operations + +* [all](#all) - Refresh all data +* [byDataType](#bydatatype) - Refresh data type +* [get](#get) - Get data status +* [listPullOperations](#listpulloperations) - List pull operations +* [getPullOperation](#getpulloperation) - Get pull operation + +## all + +Refreshes all data types with `fetch on first link` set to `true` for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.refreshData.all({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { refreshDataAll } from "@codat/platform/funcs/refreshDataAll.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await refreshDataAll(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("refreshDataAll failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshCompanyDataRequest](../../sdk/models/operations/refreshcompanydatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## byDataType + +Refreshes a given data type for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.refreshData.byDataType({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { refreshDataByDataType } from "@codat/platform/funcs/refreshDataByDataType.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await refreshDataByDataType(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("refreshDataByDataType failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshDataTypeRequest](../../sdk/models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get the state of each data type for a company + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.refreshData.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { refreshDataGet } from "@codat/platform/funcs/refreshDataGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await refreshDataGet(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("refreshDataGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyDataStatusRequest](../../sdk/models/operations/getcompanydatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.DataStatuses](../../sdk/models/shared/datastatuses.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listPullOperations + +Gets the pull operation history (datasets) for a given company. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.refreshData.listPullOperations({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { refreshDataListPullOperations } from "@codat/platform/funcs/refreshDataListPullOperations.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await refreshDataListPullOperations(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("refreshDataListPullOperations failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListPullOperationsRequest](../../sdk/models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperations](../../sdk/models/shared/pulloperations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getPullOperation + +Retrieve information about a single dataset or pull operation. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.refreshData.getPullOperation({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { refreshDataGetPullOperation } from "@codat/platform/funcs/refreshDataGetPullOperation.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await refreshDataGetPullOperation(codatPlatform, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("refreshDataGetPullOperation failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPullOperationRequest](../../sdk/models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/settings/README.md b/platform/docs/sdks/settings/README.md index 75b5f2167..87674546f 100644 --- a/platform/docs/sdks/settings/README.md +++ b/platform/docs/sdks/settings/README.md @@ -1,943 +1,941 @@ -# Settings - -## Overview - -Manage company profile configuration, sync settings, and API keys. - -### Available Operations - -* [get](#get) - Get CORS settings -* [set](#set) - Set CORS settings -* [getProfile](#getprofile) - Get profile -* [updateProfile](#updateprofile) - Update profile -* [getSyncSettings](#getsyncsettings) - Get sync settings -* [updateSyncSettings](#updatesyncsettings) - Update all sync settings -* [listApiKeys](#listapikeys) - List API keys -* [createApiKey](#createapikey) - Create API key -* [deleteApiKey](#deleteapikey) - Delete API key - -## get - -The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - -Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.get(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsGet } from "@codat/platform/funcs/settingsGet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsGet(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## set - -The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - -Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - -### Example Usage: Allowed origins - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.set({ - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsSet } from "@codat/platform/funcs/settingsSet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsSet(codatPlatform, { - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsSet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.set({ - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsSet } from "@codat/platform/funcs/settingsSet.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsSet(codatPlatform, { - allowedOrigins: [ - "https://www.bank-of-dave.com", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsSet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getProfile - -Fetch your Codat profile. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.getProfile(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsGetProfile } from "@codat/platform/funcs/settingsGetProfile.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsGetProfile(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsGetProfile failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Profile](../../sdk/models/shared/profile.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| errors.ErrorMessage | 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## updateProfile - -Update your Codat profile - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.updateProfile({ - name: "Bob's Burgers", - logoUrl: "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", - iconUrl: "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", - redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", - whiteListUrls: [ - "https://bobs-burgers.com", - "https://bobs-burgers.co.uk", - ], - confirmCompanyName: true, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsUpdateProfile } from "@codat/platform/funcs/settingsUpdateProfile.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsUpdateProfile(codatPlatform, { - name: "Bob's Burgers", - logoUrl: "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", - iconUrl: "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", - redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", - whiteListUrls: [ - "https://bobs-burgers.com", - "https://bobs-burgers.co.uk", - ], - confirmCompanyName: true, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsUpdateProfile failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.Profile](../../sdk/models/shared/profile.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Profile](../../sdk/models/shared/profile.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| errors.ErrorMessage | 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getSyncSettings - -Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.getSyncSettings(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsGetSyncSettings } from "@codat/platform/funcs/settingsGetSyncSettings.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsGetSyncSettings(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsGetSyncSettings failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.SyncSettings](../../sdk/models/shared/syncsettings.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| errors.ErrorMessage | 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## updateSyncSettings - -Update sync settings for all data types. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.settings.updateSyncSettings({ - clientId: "9807ce3e-cfa5-4370-b4f2-09c282b1598b", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsUpdateSyncSettings } from "@codat/platform/funcs/settingsUpdateSyncSettings.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsUpdateSyncSettings(codatPlatform, { - clientId: "9807ce3e-cfa5-4370-b4f2-09c282b1598b", - settings: [ - { - dataType: "invoices", - fetchOnFirstLink: true, - syncSchedule: 24, - syncOrder: 0, - syncFromUtc: "2020-01-01T12:00:00.000Z", - syncFromWindow: 24, - monthsToSync: 24, - isLocked: true, - }, - ], - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("settingsUpdateSyncSettings failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateProfileSyncSettingsRequestBody](../../sdk/models/operations/updateprofilesyncsettingsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| errors.ErrorMessage | 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listApiKeys - -Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. - -[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - -You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.listApiKeys(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsListApiKeys } from "@codat/platform/funcs/settingsListApiKeys.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsListApiKeys(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsListApiKeys failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ApiKeys](../../sdk/models/shared/apikeys.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| errors.ErrorMessage | 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## createApiKey - -Use the *Create API keys* endpoint to generate a new API key for your client. - -[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - -You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - -### Tips and pitfalls - -* Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). -* If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. -* The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. - -### Example Usage: API key details - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.createApiKey({ - name: "azure-invoice-finance-processor", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsCreateApiKey(codatPlatform, { - name: "azure-invoice-finance-processor", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsCreateApiKey failed:", res.error); - } -} - -run(); -``` -### Example Usage: API key details with name - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.createApiKey({ - name: "azure-invoice-finance-processor", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsCreateApiKey(codatPlatform, { - name: "azure-invoice-finance-processor", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsCreateApiKey failed:", res.error); - } -} - -run(); -``` -### Example Usage: Create API key with name - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.createApiKey({ - name: "azure-invoice-finance-processor", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsCreateApiKey(codatPlatform, { - name: "azure-invoice-finance-processor", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsCreateApiKey failed:", res.error); - } -} - -run(); -``` -### Example Usage: Max length for name reached - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.createApiKey({ - name: "azure-invoice-finance-processor", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsCreateApiKey(codatPlatform, { - name: "azure-invoice-finance-processor", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsCreateApiKey failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.CreateApiKey](../../sdk/models/shared/createapikey.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ApiKeyDetails](../../sdk/models/shared/apikeydetails.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## deleteApiKey - -Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. - -[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - -You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - -### Tips and pitfalls - -* It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. -* It is possible to delete the API key used to authenticate the *Delete API key* request. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.settings.deleteApiKey({ - apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { settingsDeleteApiKey } from "@codat/platform/funcs/settingsDeleteApiKey.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await settingsDeleteApiKey(codatPlatform, { - apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("settingsDeleteApiKey failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteApiKeyRequest](../../sdk/models/operations/deleteapikeyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.ErrorMessage](../../sdk/models/shared/errormessage.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Settings + +## Overview + +Manage company profile configuration, sync settings, and API keys. + +### Available Operations + +* [get](#get) - Get CORS settings +* [set](#set) - Set CORS settings +* [getProfile](#getprofile) - Get profile +* [updateProfile](#updateprofile) - Update profile +* [getSyncSettings](#getsyncsettings) - Get sync settings +* [updateSyncSettings](#updatesyncsettings) - Update all sync settings +* [listApiKeys](#listapikeys) - List API keys +* [createApiKey](#createapikey) - Create API key +* [deleteApiKey](#deleteapikey) - Delete API key + +## get + +The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. + +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.get(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsGet } from "@codat/platform/funcs/settingsGet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsGet(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## set + +The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +### Example Usage: Allowed origins + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.set({ + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsSet } from "@codat/platform/funcs/settingsSet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsSet(codatPlatform, { + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsSet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.set({ + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsSet } from "@codat/platform/funcs/settingsSet.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsSet(codatPlatform, { + allowedOrigins: [ + "https://www.bank-of-dave.com", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsSet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ConnectionManagementAllowedOrigins](../../sdk/models/shared/connectionmanagementallowedorigins.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getProfile + +Fetch your Codat profile. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.getProfile(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsGetProfile } from "@codat/platform/funcs/settingsGetProfile.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsGetProfile(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsGetProfile failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Profile](../../sdk/models/shared/profile.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## updateProfile + +Update your Codat profile + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.updateProfile({ + name: "Bob's Burgers", + logoUrl: "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", + iconUrl: "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", + redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", + whiteListUrls: [ + "https://bobs-burgers.com", + "https://bobs-burgers.co.uk", + ], + confirmCompanyName: true, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsUpdateProfile } from "@codat/platform/funcs/settingsUpdateProfile.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsUpdateProfile(codatPlatform, { + name: "Bob's Burgers", + logoUrl: "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", + iconUrl: "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", + redirectUrl: "https://bobs-burgers.{countrySuffix}/{companyId}", + whiteListUrls: [ + "https://bobs-burgers.com", + "https://bobs-burgers.co.uk", + ], + confirmCompanyName: true, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsUpdateProfile failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.Profile](../../sdk/models/shared/profile.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Profile](../../sdk/models/shared/profile.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getSyncSettings + +Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.getSyncSettings(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsGetSyncSettings } from "@codat/platform/funcs/settingsGetSyncSettings.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsGetSyncSettings(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsGetSyncSettings failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.SyncSettings](../../sdk/models/shared/syncsettings.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## updateSyncSettings + +Update sync settings for all data types. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.settings.updateSyncSettings({ + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsUpdateSyncSettings } from "@codat/platform/funcs/settingsUpdateSyncSettings.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsUpdateSyncSettings(codatPlatform, { + settings: [ + { + dataType: "invoices", + fetchOnFirstLink: true, + syncSchedule: 24, + syncOrder: 0, + syncFromUtc: "2020-01-01T12:00:00.000Z", + syncFromWindow: 24, + monthsToSync: 24, + isLocked: true, + }, + ], + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("settingsUpdateSyncSettings failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateProfileSyncSettingsRequestBody](../../sdk/models/operations/updateprofilesyncsettingsrequestbody.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listApiKeys + +Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. + +[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. + +You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.listApiKeys(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsListApiKeys } from "@codat/platform/funcs/settingsListApiKeys.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsListApiKeys(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsListApiKeys failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ApiKeys](../../sdk/models/shared/apikeys.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## createApiKey + +Use the *Create API keys* endpoint to generate a new API key for your client. + +[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. + +You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. + +### Tips and pitfalls + +* Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). +* If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. +* The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. + +### Example Usage: API key details + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.createApiKey({ + name: "azure-invoice-finance-processor", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsCreateApiKey(codatPlatform, { + name: "azure-invoice-finance-processor", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsCreateApiKey failed:", res.error); + } +} + +run(); +``` +### Example Usage: API key details with name + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.createApiKey({ + name: "azure-invoice-finance-processor", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsCreateApiKey(codatPlatform, { + name: "azure-invoice-finance-processor", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsCreateApiKey failed:", res.error); + } +} + +run(); +``` +### Example Usage: Create API key with name + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.createApiKey({ + name: "azure-invoice-finance-processor", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsCreateApiKey(codatPlatform, { + name: "azure-invoice-finance-processor", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsCreateApiKey failed:", res.error); + } +} + +run(); +``` +### Example Usage: Max length for name reached + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.createApiKey({ + name: "azure-invoice-finance-processor", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsCreateApiKey } from "@codat/platform/funcs/settingsCreateApiKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsCreateApiKey(codatPlatform, { + name: "azure-invoice-finance-processor", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsCreateApiKey failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.CreateApiKey](../../sdk/models/shared/createapikey.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ApiKeyDetails](../../sdk/models/shared/apikeydetails.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deleteApiKey + +Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. + +[API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. + +You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. + +### Tips and pitfalls + +* It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. +* It is possible to delete the API key used to authenticate the *Delete API key* request. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.settings.deleteApiKey({ + apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { settingsDeleteApiKey } from "@codat/platform/funcs/settingsDeleteApiKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await settingsDeleteApiKey(codatPlatform, { + apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("settingsDeleteApiKey failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteApiKeyRequest](../../sdk/models/operations/deleteapikeyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.ErrorMessage](../../sdk/models/shared/errormessage.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/supplementaldata/README.md b/platform/docs/sdks/supplementaldata/README.md index 8be9e1527..935e63b06 100644 --- a/platform/docs/sdks/supplementaldata/README.md +++ b/platform/docs/sdks/supplementaldata/README.md @@ -1,568 +1,568 @@ -# SupplementalData - -## Overview - -Configure and pull additional data you can include in Codat's standard data types. - -### Available Operations - -* [configure](#configure) - Configure -* [getConfiguration](#getconfiguration) - Get configuration - -## configure - -The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. - -[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - -**Integration-specific behavior** -See the *examples* for integration-specific frequently requested properties. - -### Example Usage: QBO - Customers - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: QBO - Invoices - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: { - supplementalDataConfig: { - "orders-supplemental-data": { - dataSource: "/orders", - pullData: { - "orderNumber": "order_num", - }, - pushData: { - "orderNumber": "order_num", - }, - }, - }, - }, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: { - supplementalDataConfig: { - "orders-supplemental-data": { - dataSource: "/orders", - pullData: { - "orderNumber": "order_num", - }, - pushData: { - "orderNumber": "order_num", - }, - }, - }, - }, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - Accounts - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - Contacts - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - Invoices - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - Items - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - Tax rates - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.supplementalData.configure({ - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataConfigure(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - supplementalDataConfiguration: {}, - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("supplementalDataConfigure failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ConfigureSupplementalDataRequest](../../sdk/models/operations/configuresupplementaldatarequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getConfiguration - -The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. - -[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.supplementalData.getConfiguration({ - platformKey: "gbol", - dataType: "invoices", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { supplementalDataGetConfiguration } from "@codat/platform/funcs/supplementalDataGetConfiguration.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await supplementalDataGetConfiguration(codatPlatform, { - platformKey: "gbol", - dataType: "invoices", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("supplementalDataGetConfiguration failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSupplementalDataConfigurationRequest](../../sdk/models/operations/getsupplementaldataconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.SupplementalDataConfiguration](../../sdk/models/shared/supplementaldataconfiguration.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# SupplementalData + +## Overview + +Configure and pull additional data you can include in Codat's standard data types. + +### Available Operations + +* [configure](#configure) - Configure +* [getConfiguration](#getconfiguration) - Get configuration + +## configure + +The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. + +[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + +**Integration-specific behavior** +See the *examples* for integration-specific frequently requested properties. + +### Example Usage: QBO - Customers + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: QBO - Invoices + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: { + supplementalDataConfig: { + "orders-supplemental-data": { + dataSource: "/orders", + pullData: { + "orderNumber": "order_num", + }, + pushData: { + "orderNumber": "order_num", + }, + }, + }, + }, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: { + supplementalDataConfig: { + "orders-supplemental-data": { + dataSource: "/orders", + pullData: { + "orderNumber": "order_num", + }, + pushData: { + "orderNumber": "order_num", + }, + }, + }, + }, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero - Accounts + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero - Contacts + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero - Invoices + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero - Items + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero - Tax rates + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.supplementalData.configure({ + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataConfigure } from "@codat/platform/funcs/supplementalDataConfigure.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataConfigure(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + supplementalDataConfiguration: {}, + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("supplementalDataConfigure failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ConfigureSupplementalDataRequest](../../sdk/models/operations/configuresupplementaldatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getConfiguration + +The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. + +[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.supplementalData.getConfiguration({ + platformKey: "gbol", + dataType: "invoices", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { supplementalDataGetConfiguration } from "@codat/platform/funcs/supplementalDataGetConfiguration.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await supplementalDataGetConfiguration(codatPlatform, { + platformKey: "gbol", + dataType: "invoices", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("supplementalDataGetConfiguration failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSupplementalDataConfigurationRequest](../../sdk/models/operations/getsupplementaldataconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.SupplementalDataConfiguration](../../sdk/models/shared/supplementaldataconfiguration.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/webhooks/README.md b/platform/docs/sdks/webhooks/README.md index a7d2a14f9..67d017dd2 100644 --- a/platform/docs/sdks/webhooks/README.md +++ b/platform/docs/sdks/webhooks/README.md @@ -1,305 +1,384 @@ -# Webhooks - -## Overview - -Create and manage webhooks that listen to Codat's events. - -### Available Operations - -* [listConsumers](#listconsumers) - List webhook consumers -* [createConsumer](#createconsumer) - Create webhook consumer -* [deleteConsumer](#deleteconsumer) - Delete webhook consumer - -## listConsumers - -Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. - -[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.webhooks.listConsumers(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { webhooksListConsumers } from "@codat/platform/funcs/webhooksListConsumers.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await webhooksListConsumers(codatPlatform); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("webhooksListConsumers failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.WebhookConsumers](../../sdk/models/shared/webhookconsumers.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## createConsumer - -Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. - -[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - -### Tips and traps -- The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. - -### Example Usage: Subscribe consumer to one or more event types - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.webhooks.createConsumer({ - url: "https://example.com/webhoook-consumer", - eventTypes: [ - "DataSyncCompleted", - "Dataset data changed", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { webhooksCreateConsumer } from "@codat/platform/funcs/webhooksCreateConsumer.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await webhooksCreateConsumer(codatPlatform, { - url: "https://example.com/webhoook-consumer", - eventTypes: [ - "DataSyncCompleted", - "Dataset data changed", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("webhooksCreateConsumer failed:", res.error); - } -} - -run(); -``` -### Example Usage: Subscribe consumer with disabled endpoint - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatPlatform.webhooks.createConsumer({ - url: "https://example.com/webhoook-consumer", - disabled: true, - eventTypes: [ - "DataSyncCompleted", - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { webhooksCreateConsumer } from "@codat/platform/funcs/webhooksCreateConsumer.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await webhooksCreateConsumer(codatPlatform, { - url: "https://example.com/webhoook-consumer", - disabled: true, - eventTypes: [ - "DataSyncCompleted", - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("webhooksCreateConsumer failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.WebhookConsumerPrototype](../../sdk/models/shared/webhookconsumerprototype.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.WebhookConsumer](../../sdk/models/shared/webhookconsumer.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## deleteConsumer - -Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. - -[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - -### Example Usage - - -```typescript -import { CodatPlatform } from "@codat/platform"; - -const codatPlatform = new CodatPlatform({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatPlatform.webhooks.deleteConsumer({ - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatPlatformCore } from "@codat/platform/core.js"; -import { webhooksDeleteConsumer } from "@codat/platform/funcs/webhooksDeleteConsumer.js"; - -// Use `CodatPlatformCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatPlatform = new CodatPlatformCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await webhooksDeleteConsumer(codatPlatform, { - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("webhooksDeleteConsumer failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteWebhookConsumerRequest](../../sdk/models/operations/deletewebhookconsumerrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +# Webhooks + +## Overview + +Create and manage webhooks that listen to Codat's events. + +### Available Operations + +* [listConsumers](#listconsumers) - List webhook consumers +* [createConsumer](#createconsumer) - Create webhook consumer +* [deleteConsumer](#deleteconsumer) - Delete webhook consumer +* [rotateZapierKey](#rotatezapierkey) - Rotate Zapier key + +## listConsumers + +Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.webhooks.listConsumers(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { webhooksListConsumers } from "@codat/platform/funcs/webhooksListConsumers.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await webhooksListConsumers(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("webhooksListConsumers failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.WebhookConsumers](../../sdk/models/shared/webhookconsumers.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## createConsumer + +Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Tips and traps +- The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + +### Example Usage: Subscribe consumer to one or more event types + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.webhooks.createConsumer({ + url: "https://example.com/webhoook-consumer", + eventTypes: [ + "DataSyncCompleted", + "Dataset data changed", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { webhooksCreateConsumer } from "@codat/platform/funcs/webhooksCreateConsumer.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await webhooksCreateConsumer(codatPlatform, { + url: "https://example.com/webhoook-consumer", + eventTypes: [ + "DataSyncCompleted", + "Dataset data changed", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("webhooksCreateConsumer failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subscribe consumer with disabled endpoint + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.webhooks.createConsumer({ + url: "https://example.com/webhoook-consumer", + disabled: true, + eventTypes: [ + "DataSyncCompleted", + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { webhooksCreateConsumer } from "@codat/platform/funcs/webhooksCreateConsumer.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await webhooksCreateConsumer(codatPlatform, { + url: "https://example.com/webhoook-consumer", + disabled: true, + eventTypes: [ + "DataSyncCompleted", + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("webhooksCreateConsumer failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.WebhookConsumerPrototype](../../sdk/models/shared/webhookconsumerprototype.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.WebhookConsumer](../../sdk/models/shared/webhookconsumer.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## deleteConsumer + +Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatPlatform.webhooks.deleteConsumer({ + webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { webhooksDeleteConsumer } from "@codat/platform/funcs/webhooksDeleteConsumer.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await webhooksDeleteConsumer(codatPlatform, { + webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("webhooksDeleteConsumer failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteWebhookConsumerRequest](../../sdk/models/operations/deletewebhookconsumerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## rotateZapierKey + +The *Rotate Zapier key* endpoint returns the Zapier integration key needed to configure Zaps triggered by Codat's webhooks. + +If a key has already been created, calling this will revoke that existing key. + +The key changes each time this endpoint is called. If you are already using our Zapier integration and called this endpoint again, you need to reauthenticate using the latest integration key returned in the response. + +Our Zapier integration makes it simple for you to set up and receive user notifications in your preferred ways, such as via email or Slack. See our [Zapier documentation](https://docs.codat.io/using-the-api/webhooks/zapier-integration) for detailed instructions on setting up this integration. + + + +### Example Usage + + +```typescript +import { CodatPlatform } from "@codat/platform"; + +const codatPlatform = new CodatPlatform({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatPlatform.webhooks.rotateZapierKey(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatPlatformCore } from "@codat/platform/core.js"; +import { webhooksRotateZapierKey } from "@codat/platform/funcs/webhooksRotateZapierKey.js"; + +// Use `CodatPlatformCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatPlatform = new CodatPlatformCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await webhooksRotateZapierKey(codatPlatform); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("webhooksRotateZapierKey failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[WebhookZapierKey](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/files.gen b/platform/files.gen deleted file mode 100755 index 25df67e66..000000000 --- a/platform/files.gen +++ /dev/null @@ -1,350 +0,0 @@ -src/sdk/settings.ts -src/sdk/companies.ts -src/sdk/connections.ts -src/sdk/customdatatype.ts -src/sdk/pushdata.ts -src/sdk/refreshdata.ts -src/sdk/groups.ts -src/sdk/integrations.ts -src/sdk/supplementaldata.ts -src/sdk/webhooks.ts -src/sdk/sdk.ts -.eslintrc.yml -jest.config.js -package-lock.json -package.json -src/index.ts -src/internal/utils/contenttype.ts -src/internal/utils/headers.ts -src/internal/utils/index.ts -src/internal/utils/pathparams.ts -src/internal/utils/queryparams.ts -src/internal/utils/requestbody.ts -src/internal/utils/retries.ts -src/internal/utils/security.ts -src/internal/utils/utils.ts -src/sdk/index.ts -src/sdk/models/errors/sdkerror.ts -src/sdk/types/index.ts -src/sdk/types/rfcdate.ts -tsconfig.json -src/sdk/models/operations/createapikey.ts -src/sdk/models/operations/deleteapikey.ts -src/sdk/models/operations/getprofile.ts -src/sdk/models/operations/getprofilesyncsettings.ts -src/sdk/models/operations/listapikeys.ts -src/sdk/models/operations/updateprofile.ts -src/sdk/models/operations/updateprofilesyncsettings.ts -src/sdk/models/operations/createcompany.ts -src/sdk/models/operations/deletecompany.ts -src/sdk/models/operations/getcompany.ts -src/sdk/models/operations/listcompanies.ts -src/sdk/models/operations/updatecompany.ts -src/sdk/models/operations/createconnection.ts -src/sdk/models/operations/deleteconnection.ts -src/sdk/models/operations/getconnection.ts -src/sdk/models/operations/listconnections.ts -src/sdk/models/operations/unlinkconnection.ts -src/sdk/models/operations/updateconnectionauthorization.ts -src/sdk/models/operations/configurecustomdatatype.ts -src/sdk/models/operations/getcustomdatatypeconfiguration.ts -src/sdk/models/operations/listcustomdatatyperecords.ts -src/sdk/models/operations/refreshcustomdatatype.ts -src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts -src/sdk/models/operations/getpushoperation.ts -src/sdk/models/operations/getcompanypushhistory.ts -src/sdk/models/operations/refreshcompanydata.ts -src/sdk/models/operations/refreshdatatype.ts -src/sdk/models/operations/getcompanydatastatus.ts -src/sdk/models/operations/getpulloperation.ts -src/sdk/models/operations/listpulloperations.ts -src/sdk/models/operations/addcompanytogroup.ts -src/sdk/models/operations/creategroup.ts -src/sdk/models/operations/listgroups.ts -src/sdk/models/operations/removecompanyfromgroup.ts -src/sdk/models/operations/getintegration.ts -src/sdk/models/operations/getintegrationsbranding.ts -src/sdk/models/operations/listintegrations.ts -src/sdk/models/operations/configuresupplementaldata.ts -src/sdk/models/operations/getsupplementaldataconfiguration.ts -src/sdk/models/operations/createrule.ts -src/sdk/models/operations/getwebhook.ts -src/sdk/models/operations/listrules.ts -src/sdk/models/shared/errormessage.ts -src/sdk/models/shared/apikeydetails.ts -src/sdk/models/shared/createapikey.ts -src/sdk/models/shared/profile.ts -src/sdk/models/shared/syncsettings.ts -src/sdk/models/shared/syncsetting.ts -src/sdk/models/shared/datatype.ts -src/sdk/models/shared/apikeys.ts -src/sdk/models/shared/company.ts -src/sdk/models/shared/groupref.ts -src/sdk/models/shared/connection.ts -src/sdk/models/shared/dataconnectionstatus.ts -src/sdk/models/shared/sourcetype.ts -src/sdk/models/shared/dataconnectionerror.ts -src/sdk/models/shared/companyrequestbody.ts -src/sdk/models/shared/companies.ts -src/sdk/models/shared/links.ts -src/sdk/models/shared/halref.ts -src/sdk/models/shared/connections.ts -src/sdk/models/shared/updateconnectionstatus.ts -src/sdk/models/shared/customdatatypeconfiguration.ts -src/sdk/models/shared/customdatatyperecords.ts -src/sdk/models/shared/customdatatyperecord.ts -src/sdk/models/shared/pulloperation.ts -src/sdk/models/shared/pushoption.ts -src/sdk/models/shared/pushvalidationinfo.ts -src/sdk/models/shared/pushfieldvalidation.ts -src/sdk/models/shared/pushoptiontype.ts -src/sdk/models/shared/pushoptionproperty.ts -src/sdk/models/shared/pushoptionchoice.ts -src/sdk/models/shared/schemadatatype.ts -src/sdk/models/shared/pushoperation.ts -src/sdk/models/shared/validation.ts -src/sdk/models/shared/validationitem.ts -src/sdk/models/shared/pushoperationstatus.ts -src/sdk/models/shared/pushoperationchange.ts -src/sdk/models/shared/pushchangetype.ts -src/sdk/models/shared/pushoperationref.ts -src/sdk/models/shared/pushoperations.ts -src/sdk/models/shared/datastatus.ts -src/sdk/models/shared/pulloperations.ts -src/sdk/models/shared/companygroupassignment.ts -src/sdk/models/shared/group.ts -src/sdk/models/shared/groupprototype.ts -src/sdk/models/shared/groups.ts -src/sdk/models/shared/integration.ts -src/sdk/models/shared/datatypefeature.ts -src/sdk/models/shared/supportedfeature.ts -src/sdk/models/shared/featuretype.ts -src/sdk/models/shared/featurestate.ts -src/sdk/models/shared/branding.ts -src/sdk/models/shared/brandinglogo.ts -src/sdk/models/shared/brandingimage.ts -src/sdk/models/shared/imagereference.ts -src/sdk/models/shared/brandingbutton.ts -src/sdk/models/shared/integrations.ts -src/sdk/models/shared/supplementaldataconfiguration.ts -src/sdk/models/shared/webhook.ts -src/sdk/models/shared/webhooknotifier.ts -src/sdk/models/shared/createrule.ts -src/sdk/models/shared/webhooks.ts -src/sdk/models/shared/security.ts -src/sdk/models/shared/clientratelimitreachedwebhook.ts -src/sdk/models/shared/clientratelimitreachedwebhookdata.ts -src/sdk/models/shared/clientratelimitresetwebhook.ts -src/sdk/models/shared/clientratelimitresetwebhookdata.ts -src/sdk/models/shared/connectionstatuschangedwebhook.ts -src/sdk/models/shared/connectionstatuschangedwebhookdata.ts -src/sdk/models/shared/datasynccompletedwebhook.ts -src/sdk/models/shared/datasynccompletedwebhookdata.ts -src/sdk/models/shared/datasetdatachangedwebhook.ts -src/sdk/models/shared/datasetstatuschangederrorwebhook.ts -src/sdk/models/shared/datasetstatuschangederrorwebhookdata.ts -src/sdk/models/shared/newcompanysynchronizedwebhook.ts -src/sdk/models/shared/newcompanysynchronizedwebhookdata.ts -src/sdk/models/shared/pushoperationtimedoutwebhook.ts -src/sdk/models/shared/pushoperationtimedoutwebhookdata.ts -src/sdk/models/shared/pushoperationstatuschangedwebhook.ts -src/sdk/models/shared/pushoperationstatuschangedwebhookdata.ts -src/sdk/models/webhooks/clientratelimitreached.ts -src/sdk/models/webhooks/clientratelimitreset.ts -src/sdk/models/webhooks/companydataconnectionstatuschanged.ts -src/sdk/models/webhooks/datasynccompleted.ts -src/sdk/models/webhooks/datasetdatachanged.ts -src/sdk/models/webhooks/datasetstatushaschangedtoanerrorstate.ts -src/sdk/models/webhooks/newcompanysynchronized.ts -src/sdk/models/webhooks/pushoperationhastimedout.ts -src/sdk/models/webhooks/pushoperationstatushaschanged.ts -src/sdk/models/errors/index.ts -src/sdk/models/operations/index.ts -src/sdk/models/shared/index.ts -src/sdk/models/webhooks/index.ts -docs/sdk/models/operations/createapikeyresponse.md -docs/sdk/models/operations/deleteapikeyrequest.md -docs/sdk/models/operations/deleteapikeyresponse.md -docs/sdk/models/operations/getprofileresponse.md -docs/sdk/models/operations/getprofilesyncsettingsresponse.md -docs/sdk/models/operations/listapikeysresponse.md -docs/sdk/models/operations/updateprofileresponse.md -docs/sdk/models/operations/updateprofilesyncsettingsrequestbody.md -docs/sdk/models/operations/updateprofilesyncsettingsresponse.md -docs/sdk/models/operations/createcompanyresponse.md -docs/sdk/models/operations/deletecompanyrequest.md -docs/sdk/models/operations/deletecompanyresponse.md -docs/sdk/models/operations/getcompanyrequest.md -docs/sdk/models/operations/getcompanyresponse.md -docs/sdk/models/operations/listcompaniesrequest.md -docs/sdk/models/operations/listcompaniesresponse.md -docs/sdk/models/operations/updatecompanyrequest.md -docs/sdk/models/operations/updatecompanyresponse.md -docs/sdk/models/operations/createconnectionrequestbody.md -docs/sdk/models/operations/createconnectionrequest.md -docs/sdk/models/operations/createconnectionresponse.md -docs/sdk/models/operations/deleteconnectionrequest.md -docs/sdk/models/operations/deleteconnectionresponse.md -docs/sdk/models/operations/getconnectionrequest.md -docs/sdk/models/operations/getconnectionresponse.md -docs/sdk/models/operations/listconnectionsrequest.md -docs/sdk/models/operations/listconnectionsresponse.md -docs/sdk/models/operations/unlinkconnectionrequest.md -docs/sdk/models/operations/unlinkconnectionresponse.md -docs/sdk/models/operations/updateconnectionauthorizationrequest.md -docs/sdk/models/operations/updateconnectionauthorizationresponse.md -docs/sdk/models/operations/configurecustomdatatyperequest.md -docs/sdk/models/operations/configurecustomdatatyperesponse.md -docs/sdk/models/operations/getcustomdatatypeconfigurationrequest.md -docs/sdk/models/operations/getcustomdatatypeconfigurationresponse.md -docs/sdk/models/operations/listcustomdatatyperecordsrequest.md -docs/sdk/models/operations/listcustomdatatyperecordsresponse.md -docs/sdk/models/operations/refreshcustomdatatyperequest.md -docs/sdk/models/operations/refreshcustomdatatyperesponse.md -docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md -docs/sdk/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md -docs/sdk/models/operations/getpushoperationrequest.md -docs/sdk/models/operations/getpushoperationresponse.md -docs/sdk/models/operations/getcompanypushhistoryrequest.md -docs/sdk/models/operations/getcompanypushhistoryresponse.md -docs/sdk/models/operations/refreshcompanydatarequest.md -docs/sdk/models/operations/refreshcompanydataresponse.md -docs/sdk/models/operations/refreshdatatyperequest.md -docs/sdk/models/operations/refreshdatatyperesponse.md -docs/sdk/models/operations/getcompanydatastatusrequest.md -docs/sdk/models/operations/getcompanydatastatusresponse.md -docs/sdk/models/operations/getpulloperationrequest.md -docs/sdk/models/operations/getpulloperationresponse.md -docs/sdk/models/operations/listpulloperationsrequest.md -docs/sdk/models/operations/listpulloperationsresponse.md -docs/sdk/models/operations/addcompanytogrouprequest.md -docs/sdk/models/operations/addcompanytogroupresponse.md -docs/sdk/models/operations/creategroupresponse.md -docs/sdk/models/operations/listgroupsresponse.md -docs/sdk/models/operations/removecompanyfromgrouprequest.md -docs/sdk/models/operations/removecompanyfromgroupresponse.md -docs/sdk/models/operations/getintegrationrequest.md -docs/sdk/models/operations/getintegrationresponse.md -docs/sdk/models/operations/getintegrationsbrandingrequest.md -docs/sdk/models/operations/getintegrationsbrandingresponse.md -docs/sdk/models/operations/listintegrationsrequest.md -docs/sdk/models/operations/listintegrationsresponse.md -docs/sdk/models/operations/datatype.md -docs/sdk/models/operations/configuresupplementaldatarequest.md -docs/sdk/models/operations/configuresupplementaldataresponse.md -docs/sdk/models/operations/pathparamdatatype.md -docs/sdk/models/operations/getsupplementaldataconfigurationrequest.md -docs/sdk/models/operations/getsupplementaldataconfigurationresponse.md -docs/sdk/models/operations/createruleresponse.md -docs/sdk/models/operations/getwebhookrequest.md -docs/sdk/models/operations/getwebhookresponse.md -docs/sdk/models/operations/listrulesrequest.md -docs/sdk/models/operations/listrulesresponse.md -docs/sdk/models/shared/errormessage.md -docs/sdk/models/shared/apikeydetails.md -docs/sdk/models/shared/createapikey.md -docs/sdk/models/shared/profile.md -docs/sdk/models/shared/syncsettings.md -docs/sdk/models/shared/syncsetting.md -docs/sdk/models/shared/datatype.md -docs/sdk/models/shared/apikeys.md -docs/sdk/models/shared/company.md -docs/sdk/models/shared/groupref.md -docs/sdk/models/shared/connection.md -docs/sdk/models/shared/dataconnectionstatus.md -docs/sdk/models/shared/sourcetype.md -docs/sdk/models/shared/dataconnectionerror.md -docs/sdk/models/shared/companyrequestbody.md -docs/sdk/models/shared/companies.md -docs/sdk/models/shared/links.md -docs/sdk/models/shared/halref.md -docs/sdk/models/shared/connections.md -docs/sdk/models/shared/updateconnectionstatus.md -docs/sdk/models/shared/customdatatypeconfiguration.md -docs/sdk/models/shared/customdatatyperecords.md -docs/sdk/models/shared/content.md -docs/sdk/models/shared/modifieddate.md -docs/sdk/models/shared/customdatatyperecord.md -docs/sdk/models/shared/status.md -docs/sdk/models/shared/pulloperation.md -docs/sdk/models/shared/pushoption.md -docs/sdk/models/shared/pushvalidationinfo.md -docs/sdk/models/shared/pushfieldvalidation.md -docs/sdk/models/shared/pushoptiontype.md -docs/sdk/models/shared/pushoptionproperty.md -docs/sdk/models/shared/pushoptionchoice.md -docs/sdk/models/shared/schemadatatype.md -docs/sdk/models/shared/pushoperation.md -docs/sdk/models/shared/validation.md -docs/sdk/models/shared/validationitem.md -docs/sdk/models/shared/pushoperationstatus.md -docs/sdk/models/shared/pushoperationchange.md -docs/sdk/models/shared/pushchangetype.md -docs/sdk/models/shared/pushoperationref.md -docs/sdk/models/shared/pushoperations.md -docs/sdk/models/shared/datatypes.md -docs/sdk/models/shared/datastatus.md -docs/sdk/models/shared/pulloperations.md -docs/sdk/models/shared/companygroupassignment.md -docs/sdk/models/shared/group.md -docs/sdk/models/shared/groupprototype.md -docs/sdk/models/shared/groups.md -docs/sdk/models/shared/integration.md -docs/sdk/models/shared/datatypefeature.md -docs/sdk/models/shared/supportedfeature.md -docs/sdk/models/shared/featuretype.md -docs/sdk/models/shared/featurestate.md -docs/sdk/models/shared/branding.md -docs/sdk/models/shared/brandinglogo.md -docs/sdk/models/shared/brandingimage.md -docs/sdk/models/shared/imagereference.md -docs/sdk/models/shared/brandingbutton.md -docs/sdk/models/shared/integrations.md -docs/sdk/models/shared/supplementaldatasourceconfiguration.md -docs/sdk/models/shared/supplementaldataconfiguration.md -docs/sdk/models/shared/webhook.md -docs/sdk/models/shared/webhooknotifier.md -docs/sdk/models/shared/createrule.md -docs/sdk/models/shared/webhooks.md -docs/sdk/models/shared/security.md -docs/sdk/models/shared/clientratelimitreachedwebhook.md -docs/sdk/models/shared/clientratelimitreachedwebhookdata.md -docs/sdk/models/shared/clientratelimitresetwebhook.md -docs/sdk/models/shared/clientratelimitresetwebhookdata.md -docs/sdk/models/shared/connectionstatuschangedwebhook.md -docs/sdk/models/shared/connectionstatuschangedwebhookdata.md -docs/sdk/models/shared/datasynccompletedwebhook.md -docs/sdk/models/shared/datasynccompletedwebhookdata.md -docs/sdk/models/shared/datasetdatachangedwebhookdata.md -docs/sdk/models/shared/datasetdatachangedwebhook.md -docs/sdk/models/shared/datasetstatuschangederrorwebhook.md -docs/sdk/models/shared/datasetstatuschangederrorwebhookdata.md -docs/sdk/models/shared/newcompanysynchronizedwebhook.md -docs/sdk/models/shared/newcompanysynchronizedwebhookdata.md -docs/sdk/models/shared/pushoperationtimedoutwebhook.md -docs/sdk/models/shared/pushoperationtimedoutwebhookdata.md -docs/sdk/models/shared/pushoperationstatuschangedwebhook.md -docs/sdk/models/shared/pushoperationstatuschangedwebhookdata.md -docs/sdk/models/webhooks/clientratelimitreachedresponse.md -docs/sdk/models/webhooks/clientratelimitresetresponse.md -docs/sdk/models/webhooks/companydataconnectionstatuschangedresponse.md -docs/sdk/models/webhooks/datasynccompletedresponse.md -docs/sdk/models/webhooks/datasetdatachangedresponse.md -docs/sdk/models/webhooks/datasetstatushaschangedtoanerrorstateresponse.md -docs/sdk/models/webhooks/newcompanysynchronizedresponse.md -docs/sdk/models/webhooks/pushoperationhastimedoutresponse.md -docs/sdk/models/webhooks/pushoperationstatushaschangedresponse.md -docs/sdks/codatplatform/README.md -docs/internal/utils/retryconfig.md -docs/sdks/settings/README.md -docs/sdks/companies/README.md -docs/sdks/connections/README.md -docs/sdks/customdatatype/README.md -docs/sdks/pushdata/README.md -docs/sdks/refreshdata/README.md -docs/sdks/groups/README.md -docs/sdks/integrations/README.md -docs/sdks/supplementaldata/README.md -docs/sdks/webhooks/README.md -USAGE.md -.gitattributes \ No newline at end of file diff --git a/platform/jsr.json b/platform/jsr.json deleted file mode 100644 index a06825c1d..000000000 --- a/platform/jsr.json +++ /dev/null @@ -1,27 +0,0 @@ - - -{ - "name": "@codat/platform", - "version": "6.2.1", - "exports": { - ".": "./src/index.ts", - "./sdk/models/errors": "./src/sdk/models/errors/index.ts", - "./sdk/models/shared": "./src/sdk/models/shared/index.ts", - "./sdk/models/operations": "./src/sdk/models/operations/index.ts", - "./lib/config": "./src/lib/config.ts", - "./lib/http": "./src/lib/http.ts", - "./lib/retries": "./src/lib/retries.ts", - "./lib/sdks": "./src/lib/sdks.ts", - "./types": "./src/sdk/types/index.ts" - }, - "publish": { - "include": [ - "LICENSE", - "README.md", - "RUNTIMES.md", - "USAGE.md", - "jsr.json", - "src/**/*.ts" - ] - } -} diff --git a/platform/package.json b/platform/package.json index 57d35bf9d..0c8f4e750 100644 --- a/platform/package.json +++ b/platform/package.json @@ -1,30 +1,56 @@ { "name": "@codat/platform", - "version": "6.2.1", + "version": "6.2.2", "author": "Codat", - "main": "./index.js", - "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/codatio/client-sdk-typescript.git", "directory": "platform" }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "peerDependencies": { - + "build": "tsc && tsc -p tsconfig.esm.json", + "prepare": "npm run build" }, "devDependencies": { - "@eslint/js": "^9.26.0", - "eslint": "^9.26.0", - "globals": "^15.14.0", - "typescript": "~5.8.3", - "typescript-eslint": "^8.26.0" + "typescript": "^4.0 || ^5.0" }, - "dependencies": { - "zod": "^3.25.0 || ^4.0.0" + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./sdk/models/shared": { + "types": "./dist/sdk/models/shared/index.d.ts", + "default": "./dist/sdk/models/shared/index.js" + }, + "./sdk/models/operations": { + "types": "./dist/sdk/models/operations/index.d.ts", + "default": "./dist/sdk/models/operations/index.js" + }, + "./sdk/models/errors": { + "types": "./dist/sdk/models/errors/index.d.ts", + "default": "./dist/sdk/models/errors/index.js" + }, + "./sdk/types": { + "types": "./dist/sdk/types/index.d.ts", + "default": "./dist/sdk/types/index.js" + }, + "./core.js": { + "types": "./dist/core.d.ts", + "default": "./dist/core.js" + }, + "./lib/http": { + "types": "./dist/lib/sdkconfig.d.ts", + "default": "./dist/lib/sdkconfig.js" + }, + "./funcs/*.js": { + "types": "./dist/funcs/*.d.ts", + "default": "./dist/funcs/*.js" + }, + "./package.json": "./package.json" } } diff --git a/platform/src/apis/Companies.ts b/platform/src/apis/Companies.ts new file mode 100644 index 000000000..02522082f --- /dev/null +++ b/platform/src/apis/Companies.ts @@ -0,0 +1,649 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { CompanyAccessToken } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + AccessToken, + Company, + CompanyRequestBody, + CompanySyncSettings, + CompanyUpdateRequest, + ErrorMessage, + RefreshProductDataRequestBody, + SetCompanySyncSettingsRequestBody, +} from '../sdk/models/index'; +import { + AccessTokenFromJSON, + AccessTokenToJSON, + CompaniesFromJSON, + CompaniesToJSON, + CompanyFromJSON, + CompanyToJSON, + CompanyRequestBodyFromJSON, + CompanyRequestBodyToJSON, + CompanySyncSettingsFromJSON, + CompanySyncSettingsToJSON, + CompanyUpdateRequestFromJSON, + CompanyUpdateRequestToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + RefreshProductDataRequestBodyFromJSON, + RefreshProductDataRequestBodyToJSON, + SetCompanySyncSettingsRequestBodyFromJSON, + SetCompanySyncSettingsRequestBodyToJSON, +} from '../sdk/models/index'; + +export interface AddProductRequest { + companyId: string; + productIdentifier: string; +} + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody; +} + +export interface DeleteCompanyRequest { + companyId: string; +} + +export interface GetCompanyRequest { + companyId: string; +} + +export interface GetCompanyAccessTokenRequest { + companyId: string; +} + +export interface GetCompanySyncSettingsRequest { + companyId: string; +} + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; +} + +export interface RefreshProductDataRequest { + companyId: string; + productIdentifier: string; + requestBody?: RefreshProductDataRequestBody; +} + +export interface RemoveProductRequest { + companyId: string; + productIdentifier: string; +} + +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody; +} + +export interface SetCompanySyncSettingsRequest { + companyId: string; + requestBody?: SetCompanySyncSettingsRequestBody; +} + +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest; +} + +/** + * + */ +export class Companies extends runtime.BaseAPI { + + /** + * Use the *Add product* endpoint to enable a product for the company specified by `companyId`. > Note: This feature is currently in alpha and available only to participants in the development program. + * Add product + */ + private async addProductRaw(requestParameters: AddProductRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling addProduct().' + ); + } + + if (requestParameters['productIdentifier'] == null) { + throw new runtime.RequiredError( + 'productIdentifier', + 'Required parameter "productIdentifier" was null or undefined when calling addProduct().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/products/{productIdentifier}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters['productIdentifier']))), + method: 'PUT', + operationId: 'add-product', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Use the *Add product* endpoint to enable a product for the company specified by `companyId`. > Note: This feature is currently in alpha and available only to participants in the development program. + * Add product + */ + async addProduct(requestParameters: AddProductRequest, options?: runtime.RequestOptions): Promise { + await this.addProductRaw(requestParameters, options); + } + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + private async createCompanyRaw(requestParameters: CreateCompanyRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'POST', + operationId: 'create-company', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + async create(companyRequestBody?: CompanyRequestBody, options?: runtime.RequestOptions): Promise { + const response = await this.createCompanyRaw({ companyRequestBody: companyRequestBody }, options); + return await response.value(); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + private async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'DELETE', + operationId: 'delete-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Delete a company + */ + async delete(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise { + await this.deleteCompanyRaw(requestParameters, options); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + private async getCompanyRaw(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Get company + */ + async get(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. The token is required by Codat\'s embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + * Get company access token + */ + private async getCompanyAccessTokenRaw(requestParameters: GetCompanyAccessTokenRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyAccessToken().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/accessToken`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-access-token', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => AccessTokenFromJSON(jsonValue)); + } + + /** + * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. The token is required by Codat\'s embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + * Get company access token + */ + async getAccessToken(requestParameters: GetCompanyAccessTokenRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyAccessTokenRaw(requestParameters, options); + return await response.value(); + } + + /** + * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. + * Get company sync settings + */ + private async getCompanySyncSettingsRaw(requestParameters: GetCompanySyncSettingsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanySyncSettings().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/syncSettings`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-syncSettings', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanySyncSettingsFromJSON(jsonValue)); + } + + /** + * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. + * Get company sync settings + */ + async getCompanySyncSettings(requestParameters: GetCompanySyncSettingsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanySyncSettingsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + private async listCompaniesRaw(requestParameters: ListCompaniesRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'GET', + operationId: 'list-companies', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompaniesFromJSON(jsonValue)); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + async list(requestParameters: ListCompaniesRequest = {}, options?: runtime.RequestOptions): Promise { + const response = await this.listCompaniesRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. ### Tips and traps - This endpoint only supports refreshing data for **custom products** and can\'t be used for Codat\'s standard solutions. Refer to [individual solutions\' documentation](https://docs.codat.io/) instead. - If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. - If a company has multiple custom products enabled, you can refresh data for each product individually. - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product\'s scheduled refresh is triggered as usual. - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. + * Refresh product data + */ + private async refreshProductDataRaw(requestParameters: RefreshProductDataRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshProductData().' + ); + } + + if (requestParameters['productIdentifier'] == null) { + throw new runtime.RequiredError( + 'productIdentifier', + 'Required parameter "productIdentifier" was null or undefined when calling refreshProductData().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/products/{productIdentifier}/refresh`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters['productIdentifier']))), + method: 'POST', + operationId: 'refresh-product-data', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: RefreshProductDataRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. ### Tips and traps - This endpoint only supports refreshing data for **custom products** and can\'t be used for Codat\'s standard solutions. Refer to [individual solutions\' documentation](https://docs.codat.io/) instead. - If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. - If a company has multiple custom products enabled, you can refresh data for each product individually. - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product\'s scheduled refresh is triggered as usual. - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. + * Refresh product data + */ + async refreshProductData(requestParameters: RefreshProductDataRequest, options?: runtime.RequestOptions): Promise { + await this.refreshProductDataRaw(requestParameters, options); + } + + /** + * Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. > Note: This feature is currently in alpha and available only to participants in the development program. + * Remove product + */ + private async removeProductRaw(requestParameters: RemoveProductRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling removeProduct().' + ); + } + + if (requestParameters['productIdentifier'] == null) { + throw new runtime.RequiredError( + 'productIdentifier', + 'Required parameter "productIdentifier" was null or undefined when calling removeProduct().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/products/{productIdentifier}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"productIdentifier"}}`, encodeURIComponent(String(requestParameters['productIdentifier']))), + method: 'DELETE', + operationId: 'remove-product', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. > Note: This feature is currently in alpha and available only to participants in the development program. + * Remove product + */ + async removeProduct(requestParameters: RemoveProductRequest, options?: runtime.RequestOptions): Promise { + await this.removeProductRaw(requestParameters, options); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + private async replaceCompanyRaw(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling replaceCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PUT', + operationId: 'replace-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * Replace company + */ + async replace(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.replaceCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Set the sync settings for a specific company. + * Set company sync settings + */ + private async setCompanySyncSettingsRaw(requestParameters: SetCompanySyncSettingsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling setCompanySyncSettings().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/syncSettings`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'set-company-syncSettings', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SetCompanySyncSettingsRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Set the sync settings for a specific company. + * Set company sync settings + */ + async setCompanySyncSettings(requestParameters: SetCompanySyncSettingsRequest, options?: runtime.RequestOptions): Promise { + await this.setCompanySyncSettingsRaw(requestParameters, options); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + private async updateCompanyRaw(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PATCH', + operationId: 'update-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyUpdateRequestToJSON(requestParameters['companyUpdateRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + async update(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateCompanyRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/ConnectionManagement.ts b/platform/src/apis/ConnectionManagement.ts new file mode 100644 index 000000000..0f2dae82c --- /dev/null +++ b/platform/src/apis/ConnectionManagement.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ConnectionManagementAccessToken, + ErrorMessage, +} from '../sdk/models/index'; +import { + ConnectionManagementAccessTokenFromJSON, + ConnectionManagementAccessTokenToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetConnectionManagementAccessTokenRequest { + companyId: string; +} + +/** + * + */ +export class ConnectionManagement extends runtime.BaseAPI { + + /** + * The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. + * Get access token (old) + * @deprecated + */ + private async getConnectionManagementAccessTokenRaw(requestParameters: GetConnectionManagementAccessTokenRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getConnectionManagementAccessToken().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connectionManagement/accessToken`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-connection-management-access-token', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionManagementAccessTokenFromJSON(jsonValue)); + } + + /** + * The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. + * Get access token (old) + * @deprecated + */ + async get(requestParameters: GetConnectionManagementAccessTokenRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionManagementAccessTokenRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/Connections.ts b/platform/src/apis/Connections.ts new file mode 100644 index 000000000..09337d253 --- /dev/null +++ b/platform/src/apis/Connections.ts @@ -0,0 +1,381 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Connection, + CreateConnectionRequestBody, + ErrorMessage, + UpdateConnectionStatus, +} from '../sdk/models/index'; +import { + ConnectionFromJSON, + ConnectionToJSON, + ConnectionsFromJSON, + ConnectionsToJSON, + CreateConnectionRequestBodyFromJSON, + CreateConnectionRequestBodyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + UpdateConnectionStatusFromJSON, + UpdateConnectionStatusToJSON, +} from '../sdk/models/index'; + +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody; +} + +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface GetConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + updateConnectionStatus?: UpdateConnectionStatus; +} + +export interface UpdateConnectionAuthorizationRequest { + companyId: string; + connectionId: string; + requestBody?: { [key: string]: string; }; +} + +/** + * + */ +export class Connections extends runtime.BaseAPI { + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + private async createConnectionRaw(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateConnectionRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + async create(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * Revoke and remove a connection from a company. This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + * Delete connection + */ + private async deleteConnectionRaw(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'DELETE', + operationId: 'delete-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Revoke and remove a connection from a company. This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + * Delete connection + */ + async delete(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise { + await this.deleteConnectionRaw(requestParameters, options); + } + + /** + * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + * Get connection + */ + private async getConnectionRaw(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + * Get connection + */ + async get(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * List the connections for a company. + * List connections + */ + private async listConnectionsRaw(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listConnections().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-connections', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionsFromJSON(jsonValue)); + } + + /** + * List the connections for a company. + * List connections + */ + async list(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listConnectionsRaw(requestParameters, options); + return await response.value(); + } + + /** + * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + * Unlink connection + */ + private async unlinkConnectionRaw(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling unlinkConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling unlinkConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'PATCH', + operationId: 'unlink-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateConnectionStatusToJSON(requestParameters['updateConnectionStatus']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + * Unlink connection + */ + async unlink(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.unlinkConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * Update data connection\'s authorization. + * Update authorization + */ + private async updateConnectionAuthorizationRaw(requestParameters: UpdateConnectionAuthorizationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateConnectionAuthorization().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateConnectionAuthorization().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/authorization`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'PUT', + operationId: 'update-connection-authorization', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Update data connection\'s authorization. + * Update authorization + */ + async updateAuthorization(requestParameters: UpdateConnectionAuthorizationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateConnectionAuthorizationRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/Cors.ts b/platform/src/apis/Cors.ts new file mode 100644 index 000000000..ae0a1f4bc --- /dev/null +++ b/platform/src/apis/Cors.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ConnectionManagementAllowedOrigins, + ErrorMessage, +} from '../sdk/models/index'; +import { + ConnectionManagementAllowedOriginsFromJSON, + ConnectionManagementAllowedOriginsToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface SetConnectionManagementCorsSettingsRequest { + connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins; +} + +/** + * + */ +export class Cors extends runtime.BaseAPI { + + /** + * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Get CORS settings (old) + * @deprecated + */ + private async getConnectionManagementCorsSettingsRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/connectionManagement/corsSettings`, + method: 'GET', + operationId: 'get-connection-management-cors-settings', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionManagementAllowedOriginsFromJSON(jsonValue)); + } + + /** + * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Get CORS settings (old) + * @deprecated + */ + async get(options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionManagementCorsSettingsRaw(options); + return await response.value(); + } + + /** + * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Set CORS settings (old) + * @deprecated + */ + private async setConnectionManagementCorsSettingsRaw(requestParameters: SetConnectionManagementCorsSettingsRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/connectionManagement/corsSettings`, + method: 'POST', + operationId: 'set-connection-management-cors-settings', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: ConnectionManagementAllowedOriginsToJSON(requestParameters['connectionManagementAllowedOrigins']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionManagementAllowedOriginsFromJSON(jsonValue)); + } + + /** + * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Set CORS settings (old) + * @deprecated + */ + async set(connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins, options?: runtime.RequestOptions): Promise { + const response = await this.setConnectionManagementCorsSettingsRaw({ connectionManagementAllowedOrigins: connectionManagementAllowedOrigins }, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/CustomDataType.ts b/platform/src/apis/CustomDataType.ts new file mode 100644 index 000000000..76e67c005 --- /dev/null +++ b/platform/src/apis/CustomDataType.ts @@ -0,0 +1,287 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CustomDataTypeConfiguration, + CustomDataTypeRecords, + ErrorMessage, + PullOperation, +} from '../sdk/models/index'; +import { + CustomDataTypeConfigurationFromJSON, + CustomDataTypeConfigurationToJSON, + CustomDataTypeRecordsFromJSON, + CustomDataTypeRecordsToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PullOperationFromJSON, + PullOperationToJSON, +} from '../sdk/models/index'; + +export interface ConfigureCustomDataTypeRequest { + platformKey: string; + customDataIdentifier: string; + customDataTypeConfiguration?: CustomDataTypeConfiguration; +} + +export interface GetCustomDataTypeConfigurationRequest { + platformKey: string; + customDataIdentifier: string; +} + +export interface ListCustomDataTypeRecordsRequest { + companyId: string; + connectionId: string; + customDataIdentifier: string; + page?: number; + pageSize?: number; +} + +export interface RefreshCustomDataTypeRequest { + companyId: string; + connectionId: string; + customDataIdentifier: string; +} + +/** + * + */ +export class CustomDataType extends runtime.BaseAPI { + + /** + * The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model. ### Tips and traps - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - You can only indicate a single data source for each customer data type. - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. + * Configure custom data type + */ + private async configureCustomDataTypeRaw(requestParameters: ConfigureCustomDataTypeRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling configureCustomDataType().' + ); + } + + if (requestParameters['customDataIdentifier'] == null) { + throw new runtime.RequiredError( + 'customDataIdentifier', + 'Required parameter "customDataIdentifier" was null or undefined when calling configureCustomDataType().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))).replace(`{${"customDataIdentifier"}}`, encodeURIComponent(String(requestParameters['customDataIdentifier']))), + method: 'PUT', + operationId: 'configure-custom-data-type', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CustomDataTypeConfigurationToJSON(requestParameters['customDataTypeConfiguration']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomDataTypeConfigurationFromJSON(jsonValue)); + } + + /** + * The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model. ### Tips and traps - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - You can only indicate a single data source for each customer data type. - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. + * Configure custom data type + */ + async configure(requestParameters: ConfigureCustomDataTypeRequest, options?: runtime.RequestOptions): Promise { + const response = await this.configureCustomDataTypeRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model. + * Get custom data configuration + */ + private async getCustomDataTypeConfigurationRaw(requestParameters: GetCustomDataTypeConfigurationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling getCustomDataTypeConfiguration().' + ); + } + + if (requestParameters['customDataIdentifier'] == null) { + throw new runtime.RequiredError( + 'customDataIdentifier', + 'Required parameter "customDataIdentifier" was null or undefined when calling getCustomDataTypeConfiguration().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))).replace(`{${"customDataIdentifier"}}`, encodeURIComponent(String(requestParameters['customDataIdentifier']))), + method: 'GET', + operationId: 'get-custom-data-type-configuration', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomDataTypeRecordsFromJSON(jsonValue)); + } + + /** + * The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model. + * Get custom data configuration + */ + async getConfiguration(requestParameters: GetCustomDataTypeConfigurationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCustomDataTypeConfigurationRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) + * List custom data type records + */ + private async listCustomDataTypeRecordsRaw(requestParameters: ListCustomDataTypeRecordsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listCustomDataTypeRecords().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling listCustomDataTypeRecords().' + ); + } + + if (requestParameters['customDataIdentifier'] == null) { + throw new runtime.RequiredError( + 'customDataIdentifier', + 'Required parameter "customDataIdentifier" was null or undefined when calling listCustomDataTypeRecords().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"customDataIdentifier"}}`, encodeURIComponent(String(requestParameters['customDataIdentifier']))), + method: 'GET', + operationId: 'list-custom-data-type-records', + errorStatuses: [400, 401, 402, 403, 404, 429, 451, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomDataTypeRecordsFromJSON(jsonValue)); + } + + /** + * The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat\'s standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) + * List custom data type records + */ + async list(requestParameters: ListCustomDataTypeRecordsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listCustomDataTypeRecordsRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. + * Refresh custom data type + */ + private async refreshCustomDataTypeRaw(requestParameters: RefreshCustomDataTypeRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshCustomDataType().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling refreshCustomDataType().' + ); + } + + if (requestParameters['customDataIdentifier'] == null) { + throw new runtime.RequiredError( + 'customDataIdentifier', + 'Required parameter "customDataIdentifier" was null or undefined when calling refreshCustomDataType().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"customDataIdentifier"}}`, encodeURIComponent(String(requestParameters['customDataIdentifier']))), + method: 'POST', + operationId: 'refresh-custom-data-type', + errorStatuses: [401, 402, 403, 404, 429, 451, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationFromJSON(jsonValue)); + } + + /** + * The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. + * Refresh custom data type + */ + async refresh(requestParameters: RefreshCustomDataTypeRequest, options?: runtime.RequestOptions): Promise { + const response = await this.refreshCustomDataTypeRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/Integrations.ts b/platform/src/apis/Integrations.ts new file mode 100644 index 000000000..455e7bc19 --- /dev/null +++ b/platform/src/apis/Integrations.ts @@ -0,0 +1,192 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Branding, + ErrorMessage, + Integration, +} from '../sdk/models/index'; +import { + BrandingFromJSON, + BrandingToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + IntegrationFromJSON, + IntegrationToJSON, + IntegrationsFromJSON, + IntegrationsToJSON, +} from '../sdk/models/index'; + +export interface GetIntegrationRequest { + platformKey: string; +} + +export interface GetIntegrationsBrandingRequest { + platformKey: string; +} + +export interface ListIntegrationsRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +/** + * + */ +export class Integrations extends runtime.BaseAPI { + + /** + * Get single integration, by platformKey + * Get integration + */ + private async getIntegrationRaw(requestParameters: GetIntegrationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling getIntegration().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))), + method: 'GET', + operationId: 'get-integration', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => IntegrationFromJSON(jsonValue)); + } + + /** + * Get single integration, by platformKey + * Get integration + */ + async get(requestParameters: GetIntegrationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getIntegrationRaw(requestParameters, options); + return await response.value(); + } + + /** + * Get branding for platform. + * Get branding + */ + private async getIntegrationsBrandingRaw(requestParameters: GetIntegrationsBrandingRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling getIntegrationsBranding().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}/branding`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))), + method: 'GET', + operationId: 'get-integrations-branding', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => BrandingFromJSON(jsonValue)); + } + + /** + * Get branding for platform. + * Get branding + */ + async getBranding(requestParameters: GetIntegrationsBrandingRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getIntegrationsBrandingRaw(requestParameters, options); + return await response.value(); + } + + /** + * List your available integrations + * List integrations + */ + private async listIntegrationsRaw(requestParameters: ListIntegrationsRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations`, + method: 'GET', + operationId: 'list-integrations', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => IntegrationsFromJSON(jsonValue)); + } + + /** + * List your available integrations + * List integrations + */ + async list(requestParameters: ListIntegrationsRequest = {}, options?: runtime.RequestOptions): Promise { + const response = await this.listIntegrationsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/PushData.ts b/platform/src/apis/PushData.ts new file mode 100644 index 000000000..a640bb229 --- /dev/null +++ b/platform/src/apis/PushData.ts @@ -0,0 +1,276 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Company } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type { SchemaDataType } from '../sdk/models/index'; +import type { + ErrorMessage, + PushOperation, + PushOperations, + PushOption, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOperationFromJSON, + PushOperationToJSON, + PushOperationsFromJSON, + PushOperationsToJSON, + PushOptionFromJSON, + PushOptionToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyPushHistoryRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface GetCreateUpdateModelOptionsByDataTypeRequest { + companyId: string; + connectionId: string; + dataType: SchemaDataType; +} + +export interface GetPushOperationRequest { + companyId: string; + pushOperationKey: string; +} + +/** + * + */ +export class PushData extends runtime.BaseAPI { + + /** + * The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + * List push operations + */ + private async getCompanyPushHistoryRaw(requestParameters: GetCompanyPushHistoryRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyPushHistory().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-push-history', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationsFromJSON(jsonValue)); + } + + /** + * The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + * List push operations + */ + async listOperations(requestParameters: GetCompanyPushHistoryRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyPushHistoryRaw(requestParameters, options); + return await response.value(); + } + + /** + * This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented \"options\" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. + * Get push options + */ + private async getCreateUpdateModelOptionsByDataTypeRaw(requestParameters: GetCreateUpdateModelOptionsByDataTypeRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateUpdateModelOptionsByDataType().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCreateUpdateModelOptionsByDataType().' + ); + } + + if (requestParameters['dataType'] == null) { + throw new runtime.RequiredError( + 'dataType', + 'Required parameter "dataType" was null or undefined when calling getCreateUpdateModelOptionsByDataType().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/options/{dataType}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"dataType"}}`, encodeURIComponent(String(requestParameters['dataType']))), + method: 'GET', + operationId: 'get-create-update-model-options-by-data-type', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOptionFromJSON(jsonValue)); + } + + /** + * This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented \"options\" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. + * Get push options + */ + async getModelOptions(requestParameters: GetCreateUpdateModelOptionsByDataTypeRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateUpdateModelOptionsByDataTypeRaw(requestParameters, options); + return await response.value(); + } + + /** + * The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + * Get push operation + */ + private async getPushOperationRaw(requestParameters: GetPushOperationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getPushOperation().' + ); + } + + if (requestParameters['pushOperationKey'] == null) { + throw new runtime.RequiredError( + 'pushOperationKey', + 'Required parameter "pushOperationKey" was null or undefined when calling getPushOperation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push/{pushOperationKey}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"pushOperationKey"}}`, encodeURIComponent(String(requestParameters['pushOperationKey']))), + method: 'GET', + operationId: 'get-push-operation', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationFromJSON(jsonValue)); + } + + /** + * The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + * Get push operation + */ + async getOperation(requestParameters: GetPushOperationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getPushOperationRaw(requestParameters, options); + return await response.value(); + } + +} + +/** + * @export + */ +export const GetCreateUpdateModelOptionsByDataTypeDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type GetCreateUpdateModelOptionsByDataTypeDataTypeEnum = typeof GetCreateUpdateModelOptionsByDataTypeDataTypeEnum[keyof typeof GetCreateUpdateModelOptionsByDataTypeDataTypeEnum]; diff --git a/platform/src/apis/ReadData.ts b/platform/src/apis/ReadData.ts new file mode 100644 index 000000000..01a4eec68 --- /dev/null +++ b/platform/src/apis/ReadData.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + ValidationResult, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + ValidationResultFromJSON, + ValidationResultToJSON, +} from '../sdk/models/index'; + +export interface GetReadValidationResultsRequest { + companyId: string; + datasetId: string; +} + +/** + * + */ +export class ReadData extends runtime.BaseAPI { + + /** + * Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - **`warnings`** array lists potential issues with the data type that may require attention but don\'t block usage. - **`errors`** array contains critical issues that must be resolved before the data type can be used. + * Get validation results + */ + private async getReadValidationResultsRaw(requestParameters: GetReadValidationResultsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getReadValidationResults().' + ); + } + + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling getReadValidationResults().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/{datasetId}/validation`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))), + method: 'GET', + operationId: 'get-read-validation-results', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ValidationResultFromJSON(jsonValue)); + } + + /** + * Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - **`warnings`** array lists potential issues with the data type that may require attention but don\'t block usage. - **`errors`** array contains critical issues that must be resolved before the data type can be used. + * Get validation results + */ + async getValidationResults(requestParameters: GetReadValidationResultsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getReadValidationResultsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/platform/src/apis/RefreshData.ts b/platform/src/apis/RefreshData.ts new file mode 100644 index 000000000..e283a4b4e --- /dev/null +++ b/platform/src/apis/RefreshData.ts @@ -0,0 +1,362 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Company } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type { SchemaDataType } from '../sdk/models/index'; +import type { + DataStatuses, + ErrorMessage, + PullOperation, + PullOperations, +} from '../sdk/models/index'; +import { + DataStatusesFromJSON, + DataStatusesToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PullOperationFromJSON, + PullOperationToJSON, + PullOperationsFromJSON, + PullOperationsToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyDataStatusRequest { + companyId: string; +} + +export interface GetPullOperationRequest { + companyId: string; + datasetId: string; +} + +export interface ListPullOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface RefreshCompanyDataRequest { + companyId: string; +} + +export interface RefreshDataTypeRequest { + companyId: string; + dataType: SchemaDataType; + connectionId?: string; +} + +/** + * + */ +export class RefreshData extends runtime.BaseAPI { + + /** + * Get the state of each data type for a company + * Get data status + */ + private async getCompanyDataStatusRaw(requestParameters: GetCompanyDataStatusRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyDataStatus().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/dataStatus`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-data-status', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => DataStatusesFromJSON(jsonValue)); + } + + /** + * Get the state of each data type for a company + * Get data status + */ + async get(requestParameters: GetCompanyDataStatusRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyDataStatusRaw(requestParameters, options); + return await response.value(); + } + + /** + * Retrieve information about a single dataset or pull operation. + * Get pull operation + */ + private async getPullOperationRaw(requestParameters: GetPullOperationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getPullOperation().' + ); + } + + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling getPullOperation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/history/{datasetId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))), + method: 'GET', + operationId: 'get-pull-operation', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationFromJSON(jsonValue)); + } + + /** + * Retrieve information about a single dataset or pull operation. + * Get pull operation + */ + async getPullOperation(requestParameters: GetPullOperationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getPullOperationRaw(requestParameters, options); + return await response.value(); + } + + /** + * Gets the pull operation history (datasets) for a given company. + * List pull operations + */ + private async listPullOperationsRaw(requestParameters: ListPullOperationsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listPullOperations().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/history`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-pull-operations', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationsFromJSON(jsonValue)); + } + + /** + * Gets the pull operation history (datasets) for a given company. + * List pull operations + */ + async listPullOperations(requestParameters: ListPullOperationsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listPullOperationsRaw(requestParameters, options); + return await response.value(); + } + + /** + * Refreshes all data types with `fetch on first link` set to `true` for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + * Refresh all data + */ + private async refreshCompanyDataRaw(requestParameters: RefreshCompanyDataRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshCompanyData().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/all`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'refresh-company-data', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Refreshes all data types with `fetch on first link` set to `true` for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + * Refresh all data + */ + async all(requestParameters: RefreshCompanyDataRequest, options?: runtime.RequestOptions): Promise { + await this.refreshCompanyDataRaw(requestParameters, options); + } + + /** + * Refreshes a given data type for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * Refresh data type + */ + private async refreshDataTypeRaw(requestParameters: RefreshDataTypeRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshDataType().' + ); + } + + if (requestParameters['dataType'] == null) { + throw new runtime.RequiredError( + 'dataType', + 'Required parameter "dataType" was null or undefined when calling refreshDataType().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['connectionId'] != null) { + queryParameters['connectionId'] = requestParameters['connectionId']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/queue/{dataType}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"dataType"}}`, encodeURIComponent(String(requestParameters['dataType']))), + method: 'POST', + operationId: 'refresh-data-type', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationFromJSON(jsonValue)); + } + + /** + * Refreshes a given data type for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * Refresh data type + */ + async byDataType(requestParameters: RefreshDataTypeRequest, options?: runtime.RequestOptions): Promise { + const response = await this.refreshDataTypeRaw(requestParameters, options); + return await response.value(); + } + +} + +/** + * @export + */ +export const RefreshDataTypeDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type RefreshDataTypeDataTypeEnum = typeof RefreshDataTypeDataTypeEnum[keyof typeof RefreshDataTypeDataTypeEnum]; diff --git a/platform/src/apis/Settings.ts b/platform/src/apis/Settings.ts new file mode 100644 index 000000000..0661ea669 --- /dev/null +++ b/platform/src/apis/Settings.ts @@ -0,0 +1,395 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ApiKeyDetails, + ApiKeys, + ConnectionManagementAllowedOrigins, + CreateApiKey, + ErrorMessage, + Profile, + SyncSettings, + UpdateProfileSyncSettingsRequestBody, +} from '../sdk/models/index'; +import { + ApiKeyDetailsFromJSON, + ApiKeyDetailsToJSON, + ApiKeysFromJSON, + ApiKeysToJSON, + ConnectionManagementAllowedOriginsFromJSON, + ConnectionManagementAllowedOriginsToJSON, + CreateApiKeyFromJSON, + CreateApiKeyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + ProfileFromJSON, + ProfileToJSON, + SyncSettingsFromJSON, + SyncSettingsToJSON, + UpdateProfileSyncSettingsRequestBodyFromJSON, + UpdateProfileSyncSettingsRequestBodyToJSON, +} from '../sdk/models/index'; + +export interface CreateApiKeyRequest { + createApiKey?: CreateApiKey; +} + +export interface DeleteApiKeyRequest { + apiKeyId: string; +} + +export interface SetCorsSettingsRequest { + connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins; +} + +export interface UpdateProfileRequest { + profile?: Profile; +} + +export interface UpdateProfileSyncSettingsRequest { + requestBody?: UpdateProfileSyncSettingsRequestBody; +} + +/** + * + */ +export class Settings extends runtime.BaseAPI { + + /** + * Use the *Create API keys* endpoint to generate a new API key for your client. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. ### Tips and pitfalls * Your first API key is created for you. Access this key via [Codat\'s Portal](https://app.codat.io/developers/api-keys). * If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. + * Create API key + */ + private async createApiKeyRaw(requestParameters: CreateApiKeyRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/apiKeys`, + method: 'POST', + operationId: 'create-api-key', + errorStatuses: [400, 401, 402, 403, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateApiKeyToJSON(requestParameters['createApiKey']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ApiKeyDetailsFromJSON(jsonValue)); + } + + /** + * Use the *Create API keys* endpoint to generate a new API key for your client. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. ### Tips and pitfalls * Your first API key is created for you. Access this key via [Codat\'s Portal](https://app.codat.io/developers/api-keys). * If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. + * Create API key + */ + async createApiKey(createApiKey?: CreateApiKey, options?: runtime.RequestOptions): Promise { + const response = await this.createApiKeyRaw({ createApiKey: createApiKey }, options); + return await response.value(); + } + + /** + * Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. ### Tips and pitfalls * It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. * It is possible to delete the API key used to authenticate the *Delete API key* request. + * Delete API key + */ + private async deleteApiKeyRaw(requestParameters: DeleteApiKeyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['apiKeyId'] == null) { + throw new runtime.RequiredError( + 'apiKeyId', + 'Required parameter "apiKeyId" was null or undefined when calling deleteApiKey().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/apiKeys/{apiKeyId}`.replace(`{${"apiKeyId"}}`, encodeURIComponent(String(requestParameters['apiKeyId']))), + method: 'DELETE', + operationId: 'delete-api-key', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ErrorMessageFromJSON(jsonValue)); + } + + /** + * Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. ### Tips and pitfalls * It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. * It is possible to delete the API key used to authenticate the *Delete API key* request. + * Delete API key + */ + async deleteApiKey(requestParameters: DeleteApiKeyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.deleteApiKeyRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Get CORS settings + */ + private async getCorsSettingsRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/corsSettings`, + method: 'GET', + operationId: 'get-cors-settings', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionManagementAllowedOriginsFromJSON(jsonValue)); + } + + /** + * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Get CORS settings + */ + async get(options?: runtime.RequestOptions): Promise { + const response = await this.getCorsSettingsRaw(options); + return await response.value(); + } + + /** + * Fetch your Codat profile. + * Get profile + */ + private async getProfileRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/profile`, + method: 'GET', + operationId: 'get-profile', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProfileFromJSON(jsonValue)); + } + + /** + * Fetch your Codat profile. + * Get profile + */ + async getProfile(options?: runtime.RequestOptions): Promise { + const response = await this.getProfileRaw(options); + return await response.value(); + } + + /** + * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. + * Get sync settings + */ + private async getProfileSyncSettingsRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/profile/syncSettings`, + method: 'GET', + operationId: 'get-profile-syncSettings', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SyncSettingsFromJSON(jsonValue)); + } + + /** + * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. + * Get sync settings + */ + async getSyncSettings(options?: runtime.RequestOptions): Promise { + const response = await this.getProfileSyncSettingsRaw(options); + return await response.value(); + } + + /** + * Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. + * List API keys + */ + private async listApiKeysRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/apiKeys`, + method: 'GET', + operationId: 'list-api-keys', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ApiKeysFromJSON(jsonValue)); + } + + /** + * Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. + * List API keys + */ + async listApiKeys(options?: runtime.RequestOptions): Promise { + const response = await this.listApiKeysRaw(options); + return await response.value(); + } + + /** + * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Set CORS settings + */ + private async setCorsSettingsRaw(requestParameters: SetCorsSettingsRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/corsSettings`, + method: 'POST', + operationId: 'set-cors-settings', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: ConnectionManagementAllowedOriginsToJSON(requestParameters['connectionManagementAllowedOrigins']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionManagementAllowedOriginsFromJSON(jsonValue)); + } + + /** + * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat\'s API endpoints. + * Set CORS settings + */ + async set(connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins, options?: runtime.RequestOptions): Promise { + const response = await this.setCorsSettingsRaw({ connectionManagementAllowedOrigins: connectionManagementAllowedOrigins }, options); + return await response.value(); + } + + /** + * Update your Codat profile + * Update profile + */ + private async updateProfileRaw(requestParameters: UpdateProfileRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/profile`, + method: 'PUT', + operationId: 'update-profile', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: ProfileToJSON(requestParameters['profile']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProfileFromJSON(jsonValue)); + } + + /** + * Update your Codat profile + * Update profile + */ + async updateProfile(profile?: Profile, options?: runtime.RequestOptions): Promise { + const response = await this.updateProfileRaw({ profile: profile }, options); + return await response.value(); + } + + /** + * Update sync settings for all data types. + * Update all sync settings + */ + private async updateProfileSyncSettingsRaw(requestParameters: UpdateProfileSyncSettingsRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/profile/syncSettings`, + method: 'POST', + operationId: 'update-profile-syncSettings', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateProfileSyncSettingsRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update sync settings for all data types. + * Update all sync settings + */ + async updateSyncSettings(requestBody?: UpdateProfileSyncSettingsRequestBody, options?: runtime.RequestOptions): Promise { + await this.updateProfileSyncSettingsRaw({ requestBody: requestBody }, options); + } + +} diff --git a/platform/src/apis/SupplementalData.ts b/platform/src/apis/SupplementalData.ts new file mode 100644 index 000000000..f9dcc532b --- /dev/null +++ b/platform/src/apis/SupplementalData.ts @@ -0,0 +1,199 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Company } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type { DataType, PathParamDataType } from '../sdk/models/index'; +import type { + ErrorMessage, + SupplementalDataConfiguration, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + SupplementalDataConfigurationFromJSON, + SupplementalDataConfigurationToJSON, +} from '../sdk/models/index'; + +export interface ConfigureSupplementalDataRequest { + platformKey: string; + dataType: DataType; + supplementalDataConfiguration?: SupplementalDataConfiguration; +} + +export interface GetSupplementalDataConfigurationRequest { + platformKey: string; + dataType: PathParamDataType; +} + +/** + * + */ +export class SupplementalData extends runtime.BaseAPI { + + /** + * The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat\'s standard data types. **Integration-specific behavior** See the *examples* for integration-specific frequently requested properties. + * Configure + */ + private async configureSupplementalDataRaw(requestParameters: ConfigureSupplementalDataRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling configureSupplementalData().' + ); + } + + if (requestParameters['dataType'] == null) { + throw new runtime.RequiredError( + 'dataType', + 'Required parameter "dataType" was null or undefined when calling configureSupplementalData().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))).replace(`{${"dataType"}}`, encodeURIComponent(String(requestParameters['dataType']))), + method: 'PUT', + operationId: 'configure-supplemental-data', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SupplementalDataConfigurationToJSON(requestParameters['supplementalDataConfiguration']), + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat\'s standard data types. **Integration-specific behavior** See the *examples* for integration-specific frequently requested properties. + * Configure + */ + async configure(requestParameters: ConfigureSupplementalDataRequest, options?: runtime.RequestOptions): Promise { + await this.configureSupplementalDataRaw(requestParameters, options); + } + + /** + * The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat\'s standard data types. + * Get configuration + */ + private async getSupplementalDataConfigurationRaw(requestParameters: GetSupplementalDataConfigurationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['platformKey'] == null) { + throw new runtime.RequiredError( + 'platformKey', + 'Required parameter "platformKey" was null or undefined when calling getSupplementalDataConfiguration().' + ); + } + + if (requestParameters['dataType'] == null) { + throw new runtime.RequiredError( + 'dataType', + 'Required parameter "dataType" was null or undefined when calling getSupplementalDataConfiguration().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig`.replace(`{${"platformKey"}}`, encodeURIComponent(String(requestParameters['platformKey']))).replace(`{${"dataType"}}`, encodeURIComponent(String(requestParameters['dataType']))), + method: 'GET', + operationId: 'get-supplemental-data-configuration', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SupplementalDataConfigurationFromJSON(jsonValue)); + } + + /** + * The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat\'s standard data types. + * Get configuration + */ + async getConfiguration(requestParameters: GetSupplementalDataConfigurationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getSupplementalDataConfigurationRaw(requestParameters, options); + return await response.value(); + } + +} + +/** + * @export + */ +export const ConfigureSupplementalDataDataTypeEnum = { + ChartOfAccounts: 'chartOfAccounts', + Bills: 'bills', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + Invoices: 'invoices', + Items: 'items', + JournalEntries: 'journalEntries', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePayments: 'commerce-payments', + CommercePaymentMethods: 'commerce-paymentMethods', + CommerceProducts: 'commerce-products', + CommerceProductCategories: 'commerce-productCategories', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type ConfigureSupplementalDataDataTypeEnum = typeof ConfigureSupplementalDataDataTypeEnum[keyof typeof ConfigureSupplementalDataDataTypeEnum]; +/** + * @export + */ +export const GetSupplementalDataConfigurationDataTypeEnum = { + ChartOfAccounts: 'chartOfAccounts', + Bills: 'bills', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + Invoices: 'invoices', + Items: 'items', + JournalEntries: 'journalEntries', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePayments: 'commerce-payments', + CommercePaymentMethods: 'commerce-paymentMethods', + CommerceProducts: 'commerce-products', + CommerceProductCategories: 'commerce-productCategories', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type GetSupplementalDataConfigurationDataTypeEnum = typeof GetSupplementalDataConfigurationDataTypeEnum[keyof typeof GetSupplementalDataConfigurationDataTypeEnum]; diff --git a/platform/src/apis/Webhooks.ts b/platform/src/apis/Webhooks.ts new file mode 100644 index 000000000..1727d9fdd --- /dev/null +++ b/platform/src/apis/Webhooks.ts @@ -0,0 +1,195 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + WebhookConsumer, + WebhookConsumerPrototype, + WebhookConsumers, + WebhookZapierKey, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + WebhookConsumerFromJSON, + WebhookConsumerToJSON, + WebhookConsumerPrototypeFromJSON, + WebhookConsumerPrototypeToJSON, + WebhookConsumersFromJSON, + WebhookConsumersToJSON, + WebhookZapierKeyFromJSON, + WebhookZapierKeyToJSON, +} from '../sdk/models/index'; + +export interface CreateWebhookConsumerRequest { + webhookConsumerPrototype?: WebhookConsumerPrototype; +} + +export interface DeleteWebhookConsumerRequest { + webhookId: string; +} + +/** + * + */ +export class Webhooks extends runtime.BaseAPI { + + /** + * Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). ### Tips and traps - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + * Create webhook consumer + */ + private async createWebhookConsumerRaw(requestParameters: CreateWebhookConsumerRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/webhooks`, + method: 'POST', + operationId: 'create-webhook-consumer', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: WebhookConsumerPrototypeToJSON(requestParameters['webhookConsumerPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookConsumerFromJSON(jsonValue)); + } + + /** + * Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). ### Tips and traps - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + * Create webhook consumer + */ + async createConsumer(webhookConsumerPrototype?: WebhookConsumerPrototype, options?: runtime.RequestOptions): Promise { + const response = await this.createWebhookConsumerRaw({ webhookConsumerPrototype: webhookConsumerPrototype }, options); + return await response.value(); + } + + /** + * Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + * Delete webhook consumer + */ + private async deleteWebhookConsumerRaw(requestParameters: DeleteWebhookConsumerRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['webhookId'] == null) { + throw new runtime.RequiredError( + 'webhookId', + 'Required parameter "webhookId" was null or undefined when calling deleteWebhookConsumer().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/webhooks/{webhookId}`.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId']))), + method: 'DELETE', + operationId: 'delete-webhook-consumer', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + * Delete webhook consumer + */ + async deleteConsumer(requestParameters: DeleteWebhookConsumerRequest, options?: runtime.RequestOptions): Promise { + await this.deleteWebhookConsumerRaw(requestParameters, options); + } + + /** + * Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + * List webhook consumers + */ + private async listWebhookConsumersRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/webhooks`, + method: 'GET', + operationId: 'list-webhook-consumers', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookConsumersFromJSON(jsonValue)); + } + + /** + * Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat\'s webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + * List webhook consumers + */ + async listConsumers(options?: runtime.RequestOptions): Promise { + const response = await this.listWebhookConsumersRaw(options); + return await response.value(); + } + + /** + * The *Rotate Zapier key* endpoint returns the Zapier integration key needed to configure Zaps triggered by Codat\'s webhooks. If a key has already been created, calling this will revoke that existing key. The key changes each time this endpoint is called. If you are already using our Zapier integration and called this endpoint again, you need to reauthenticate using the latest integration key returned in the response. Our Zapier integration makes it simple for you to set up and receive user notifications in your preferred ways, such as via email or Slack. See our [Zapier documentation](https://docs.codat.io/using-the-api/webhooks/zapier-integration) for detailed instructions on setting up this integration. + * Rotate Zapier key + */ + private async rotateZapierKeyRaw(options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/webhooks/integrationKeys/zapier`, + method: 'POST', + operationId: 'rotate-zapier-key', + errorStatuses: [401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => WebhookZapierKeyFromJSON(jsonValue)); + } + + /** + * The *Rotate Zapier key* endpoint returns the Zapier integration key needed to configure Zaps triggered by Codat\'s webhooks. If a key has already been created, calling this will revoke that existing key. The key changes each time this endpoint is called. If you are already using our Zapier integration and called this endpoint again, you need to reauthenticate using the latest integration key returned in the response. Our Zapier integration makes it simple for you to set up and receive user notifications in your preferred ways, such as via email or Slack. See our [Zapier documentation](https://docs.codat.io/using-the-api/webhooks/zapier-integration) for detailed instructions on setting up this integration. + * Rotate Zapier key + */ + async rotateZapierKey(options?: runtime.RequestOptions): Promise { + const response = await this.rotateZapierKeyRaw(options); + return await response.value(); + } + +} diff --git a/platform/src/apis/index.ts b/platform/src/apis/index.ts new file mode 100644 index 000000000..e2f681789 --- /dev/null +++ b/platform/src/apis/index.ts @@ -0,0 +1,14 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Companies'; +export * from './ConnectionManagement'; +export * from './Connections'; +export * from './Cors'; +export * from './CustomDataType'; +export * from './Integrations'; +export * from './PushData'; +export * from './ReadData'; +export * from './RefreshData'; +export * from './Settings'; +export * from './SupplementalData'; +export * from './Webhooks'; diff --git a/platform/src/core.ts b/platform/src/core.ts index dee072a47..94c021335 100644 --- a/platform/src/core.ts +++ b/platform/src/core.ts @@ -1,13 +1,4 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { ClientSDK } from "./lib/sdks.js"; - -/** - * A minimal client to use when calling standalone SDK functions. Typically, an - * instance of this class would be instantiated once at the start of an - * application and passed around through some dependency injection mechanism to - * parts of an application that need to make SDK calls. - */ -export class CodatPlatformCore extends ClientSDK {} +export { CodatPlatform, CodatPlatform as CodatPlatformCore } from './sdk'; diff --git a/platform/src/funcs/_adapter.ts b/platform/src/funcs/_adapter.ts new file mode 100644 index 000000000..56e5acd53 --- /dev/null +++ b/platform/src/funcs/_adapter.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ + +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; + +export async function toResult(call: () => Promise): Promise> { + try { + return OK(await call()); + } catch (err) { + return ERR(err instanceof Error ? err : new Error(String(err))); + } +} diff --git a/platform/src/funcs/companiesAddProduct.ts b/platform/src/funcs/companiesAddProduct.ts index 4bb693769..19f46e0ec 100644 --- a/platform/src/funcs/companiesAddProduct.ts +++ b/platform/src/funcs/companiesAddProduct.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Add product - * - * @remarks - * Use the *Add product* endpoint to enable a product for the company specified by `companyId`. - * - * > Note: This feature is currently in alpha and available only to participants in the development program. - */ -export function companiesAddProduct( - client: CodatPlatformCore, - request: operations.AddProductRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.AddProductRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.AddProductRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - productIdentifier: encodeSimple( - "productIdentifier", - payload.productIdentifier, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc( - "/companies/{companyId}/products/{productIdentifier}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "add-product", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["addProduct"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesAddProduct( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.addProduct(request, options))); } diff --git a/platform/src/funcs/companiesCreate.ts b/platform/src/funcs/companiesCreate.ts index 274b8d339..4d14b90ef 100644 --- a/platform/src/funcs/companiesCreate.ts +++ b/platform/src/funcs/companiesCreate.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ -export function companiesCreate( - client: CodatPlatformCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.CompanyRequestBody$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/companies")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-company", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesCreate( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.create(request, options))); } diff --git a/platform/src/funcs/companiesDelete.ts b/platform/src/funcs/companiesDelete.ts index 64e235414..1daf515df 100644 --- a/platform/src/funcs/companiesDelete.ts +++ b/platform/src/funcs/companiesDelete.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesDelete( - client: CodatPlatformCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-company", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesDelete( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.delete(request, options))); } diff --git a/platform/src/funcs/companiesGet.ts b/platform/src/funcs/companiesGet.ts index f764cdc17..d635b4e48 100644 --- a/platform/src/funcs/companiesGet.ts +++ b/platform/src/funcs/companiesGet.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesGet( - client: CodatPlatformCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGet( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.get(request, options))); } diff --git a/platform/src/funcs/companiesGetAccessToken.ts b/platform/src/funcs/companiesGetAccessToken.ts index 3850551a4..bc3e9e1ff 100644 --- a/platform/src/funcs/companiesGetAccessToken.ts +++ b/platform/src/funcs/companiesGetAccessToken.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company access token - * - * @remarks - * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - * - * The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - */ -export function companiesGetAccessToken( - client: CodatPlatformCore, - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyAccessTokenRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/accessToken")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-access-token", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["getAccessToken"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyAccessToken$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGetAccessToken( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.getAccessToken(request, options))); } diff --git a/platform/src/funcs/companiesGetCompanySyncSettings.ts b/platform/src/funcs/companiesGetCompanySyncSettings.ts index dcf62f317..9527086ea 100644 --- a/platform/src/funcs/companiesGetCompanySyncSettings.ts +++ b/platform/src/funcs/companiesGetCompanySyncSettings.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company sync settings - * - * @remarks - * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. - */ -export function companiesGetCompanySyncSettings( - client: CodatPlatformCore, - request: operations.GetCompanySyncSettingsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanySyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCompanySyncSettingsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanySyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanySyncSettingsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/syncSettings")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-syncSettings", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["getCompanySyncSettings"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanySyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanySyncSettings$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGetCompanySyncSettings( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.getCompanySyncSettings(request, options))); } diff --git a/platform/src/funcs/companiesList.ts b/platform/src/funcs/companiesList.ts index d746453e0..9dbe21065 100644 --- a/platform/src/funcs/companiesList.ts +++ b/platform/src/funcs/companiesList.ts @@ -1,211 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ -export function companiesList( - client: CodatPlatformCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Companies, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Companies, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCompaniesRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/companies")(); - - const query = encodeFormQuery({ - "orderBy": payload?.orderBy, - "page": payload?.page, - "pageSize": payload?.pageSize, - "query": payload?.query, - "tags": payload?.tags, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-companies", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Companies, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Companies$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesList( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.list(request, options))); } diff --git a/platform/src/funcs/companiesRefreshProductData.ts b/platform/src/funcs/companiesRefreshProductData.ts index a27cf9149..0b30c4544 100644 --- a/platform/src/funcs/companiesRefreshProductData.ts +++ b/platform/src/funcs/companiesRefreshProductData.ts @@ -1,207 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh product data - * - * @remarks - * Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. - * - * ### Tips and traps - * - * - This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead. - * - If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. - * - If a company has multiple custom products enabled, you can refresh data for each product individually. - * - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual. - * - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. - */ -export function companiesRefreshProductData( - client: CodatPlatformCore, - request: operations.RefreshProductDataRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.RefreshProductDataRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.RefreshProductDataRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - productIdentifier: encodeSimple( - "productIdentifier", - payload.productIdentifier, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc( - "/companies/{companyId}/products/{productIdentifier}/refresh", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-product-data", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["refreshProductData"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(202, z.void()), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesRefreshProductData( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.refreshProductData(request, options))); } diff --git a/platform/src/funcs/companiesRemoveProduct.ts b/platform/src/funcs/companiesRemoveProduct.ts index 41f892c79..151da8380 100644 --- a/platform/src/funcs/companiesRemoveProduct.ts +++ b/platform/src/funcs/companiesRemoveProduct.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Remove product - * - * @remarks - * Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. - * - * > Note: This feature is currently in alpha and available only to participants in the development program. - */ -export function companiesRemoveProduct( - client: CodatPlatformCore, - request: operations.RemoveProductRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.RemoveProductRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.RemoveProductRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - productIdentifier: encodeSimple( - "productIdentifier", - payload.productIdentifier, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc( - "/companies/{companyId}/products/{productIdentifier}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "remove-product", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["removeProduct"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesRemoveProduct( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.removeProduct(request, options))); } diff --git a/platform/src/funcs/companiesReplace.ts b/platform/src/funcs/companiesReplace.ts index dd5f90a3f..f56c34b4f 100644 --- a/platform/src/funcs/companiesReplace.ts +++ b/platform/src/funcs/companiesReplace.ts @@ -1,194 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ -export function companiesReplace( - client: CodatPlatformCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ReplaceCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyRequestBody, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "replace-company", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["replace"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesReplace( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.replace(request, options))); } diff --git a/platform/src/funcs/companiesSetCompanySyncSettings.ts b/platform/src/funcs/companiesSetCompanySyncSettings.ts index 5d72c86a6..b5b2ba6b0 100644 --- a/platform/src/funcs/companiesSetCompanySyncSettings.ts +++ b/platform/src/funcs/companiesSetCompanySyncSettings.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Set company sync settings - * - * @remarks - * Set the sync settings for a specific company. - */ -export function companiesSetCompanySyncSettings( - client: CodatPlatformCore, - request: operations.SetCompanySyncSettingsRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.SetCompanySyncSettingsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.SetCompanySyncSettingsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/syncSettings")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "set-company-syncSettings", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["setCompanySyncSettings"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesSetCompanySyncSettings( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.setCompanySyncSettings(request, options))); } diff --git a/platform/src/funcs/companiesUpdate.ts b/platform/src/funcs/companiesUpdate.ts index d62c51598..0fd8be476 100644 --- a/platform/src/funcs/companiesUpdate.ts +++ b/platform/src/funcs/companiesUpdate.ts @@ -1,195 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - */ -export function companiesUpdate( - client: CodatPlatformCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyUpdateRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-company", - oAuth2Scopes: null, +type Call = CodatPlatform["companies"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesUpdate( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.update(request, options))); } diff --git a/platform/src/funcs/connectionManagementGet.ts b/platform/src/funcs/connectionManagementGet.ts index f027fc777..b7b32e4ab 100644 --- a/platform/src/funcs/connectionManagementGet.ts +++ b/platform/src/funcs/connectionManagementGet.ts @@ -1,198 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get access token (old) - * - * @remarks - * The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. - * - * @deprecated method: The endpoint for generating company-specific connection management access tokens has been deprecated. -Codat now supports a global company access token, providing seamless access across multiple products. -Update your integration to use the global token for improved efficiency and consistency. -. Use getAccessToken instead. - */ -export function connectionManagementGet( - client: CodatPlatformCore, - request: operations.GetConnectionManagementAccessTokenRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.ConnectionManagementAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetConnectionManagementAccessTokenRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ConnectionManagementAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetConnectionManagementAccessTokenRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connectionManagement/accessToken", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection-management-access-token", - oAuth2Scopes: null, +type Call = CodatPlatform["connectionManagement"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ConnectionManagementAccessToken, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ConnectionManagementAccessToken$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionManagementGet( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connectionManagement.get(request, options))); } diff --git a/platform/src/funcs/connectionsCreate.ts b/platform/src/funcs/connectionsCreate.ts index c9b0b221b..3519c1977 100644 --- a/platform/src/funcs/connectionsCreate.ts +++ b/platform/src/funcs/connectionsCreate.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ -export function connectionsCreate( - client: CodatPlatformCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-connection", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsCreate( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.create(request, options))); } diff --git a/platform/src/funcs/connectionsDelete.ts b/platform/src/funcs/connectionsDelete.ts index 299934900..fcc7f76ae 100644 --- a/platform/src/funcs/connectionsDelete.ts +++ b/platform/src/funcs/connectionsDelete.ts @@ -1,195 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete connection - * - * @remarks - * Revoke and remove a connection from a company. - * This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - */ -export function connectionsDelete( - client: CodatPlatformCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-connection", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(200, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsDelete( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.delete(request, options))); } diff --git a/platform/src/funcs/connectionsGet.ts b/platform/src/funcs/connectionsGet.ts index 5a72755ed..b7052f0b4 100644 --- a/platform/src/funcs/connectionsGet.ts +++ b/platform/src/funcs/connectionsGet.ts @@ -1,194 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get connection - * - * @remarks - * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - */ -export function connectionsGet( - client: CodatPlatformCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsGet( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.get(request, options))); } diff --git a/platform/src/funcs/connectionsList.ts b/platform/src/funcs/connectionsList.ts index 4df8cda66..e6b714624 100644 --- a/platform/src/funcs/connectionsList.ts +++ b/platform/src/funcs/connectionsList.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List connections - * - * @remarks - * List the connections for a company. - */ -export function connectionsList( - client: CodatPlatformCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connections, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connections, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListConnectionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-connections", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connections, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connections$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsList( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.list(request, options))); } diff --git a/platform/src/funcs/connectionsUnlink.ts b/platform/src/funcs/connectionsUnlink.ts index 25deda120..e8e1327cc 100644 --- a/platform/src/funcs/connectionsUnlink.ts +++ b/platform/src/funcs/connectionsUnlink.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Unlink connection - * - * @remarks - * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - */ -export function connectionsUnlink( - client: CodatPlatformCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UnlinkConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.UpdateConnectionStatus, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "unlink-connection", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["unlink"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsUnlink( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.unlink(request, options))); } diff --git a/platform/src/funcs/connectionsUpdateAuthorization.ts b/platform/src/funcs/connectionsUpdateAuthorization.ts index 8b80d8ab7..c1aaece06 100644 --- a/platform/src/funcs/connectionsUpdateAuthorization.ts +++ b/platform/src/funcs/connectionsUpdateAuthorization.ts @@ -1,198 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update authorization - * - * @remarks - * Update data connection's authorization. - */ -export function connectionsUpdateAuthorization( - client: CodatPlatformCore, - request: operations.UpdateConnectionAuthorizationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.UpdateConnectionAuthorizationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateConnectionAuthorizationRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/authorization", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-connection-authorization", - oAuth2Scopes: null, +type Call = CodatPlatform["connections"]["updateAuthorization"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsUpdateAuthorization( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.updateAuthorization(request, options))); } diff --git a/platform/src/funcs/corsGet.ts b/platform/src/funcs/corsGet.ts index 68e859302..2ec3bdd0b 100644 --- a/platform/src/funcs/corsGet.ts +++ b/platform/src/funcs/corsGet.ts @@ -1,170 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get CORS settings (old) - * - * @remarks - * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - * - * @deprecated method: The new [Get CORS settings](https://docs.codat.io/platform-api#/operations/get-cors-settings) endpoint replaces this endpoint and includes additional functionality. -Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. -. Use get instead. - */ -export function corsGet( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/connectionManagement/corsSettings")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection-management-cors-settings", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["cors"]["get"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ConnectionManagementAllowedOrigins$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function corsGet( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.cors.get(options))); } diff --git a/platform/src/funcs/corsSet.ts b/platform/src/funcs/corsSet.ts index 5037527df..0fe259658 100644 --- a/platform/src/funcs/corsSet.ts +++ b/platform/src/funcs/corsSet.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Set CORS settings (old) - * - * @remarks - * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - * - * @deprecated method: The new [Set CORS settings](https://docs.codat.io/platform-api#/operations/set-cors-settings) endpoint replaces this endpoint and includes additional functionality. -Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. -. Use set instead. - */ -export function corsSet( - client: CodatPlatformCore, - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - shared.ConnectionManagementAllowedOrigins$outboundSchema.optional().parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/connectionManagement/corsSettings")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "set-connection-management-cors-settings", - oAuth2Scopes: null, +type Call = CodatPlatform["cors"]["set"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ConnectionManagementAllowedOrigins$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function corsSet( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.cors.set(request, options))); } diff --git a/platform/src/funcs/customDataTypeConfigure.ts b/platform/src/funcs/customDataTypeConfigure.ts index b22b80f81..4540c1cff 100644 --- a/platform/src/funcs/customDataTypeConfigure.ts +++ b/platform/src/funcs/customDataTypeConfigure.ts @@ -1,209 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Configure custom data type - * - * @remarks - * The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - * - * ### Tips and traps - * - * - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - * - * - You can only indicate a single data source for each customer data type. - * - * - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. - */ -export function customDataTypeConfigure( - client: CodatPlatformCore, - request: operations.ConfigureCustomDataTypeRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CustomDataTypeConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ConfigureCustomDataTypeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CustomDataTypeConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ConfigureCustomDataTypeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CustomDataTypeConfiguration, { - explode: true, - }); - - const pathParams = { - customDataIdentifier: encodeSimple( - "customDataIdentifier", - payload.customDataIdentifier, - { explode: false, charEncoding: "percent" }, - ), - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "configure-custom-data-type", - oAuth2Scopes: null, +type Call = CodatPlatform["customDataType"]["configure"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CustomDataTypeConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CustomDataTypeConfiguration$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customDataTypeConfigure( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customDataType.configure(request, options))); } diff --git a/platform/src/funcs/customDataTypeGetConfiguration.ts b/platform/src/funcs/customDataTypeGetConfiguration.ts index 8cd5b199b..1792f274c 100644 --- a/platform/src/funcs/customDataTypeGetConfiguration.ts +++ b/platform/src/funcs/customDataTypeGetConfiguration.ts @@ -1,200 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get custom data configuration - * - * @remarks - * The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - */ -export function customDataTypeGetConfiguration( - client: CodatPlatformCore, - request: operations.GetCustomDataTypeConfigurationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCustomDataTypeConfigurationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCustomDataTypeConfigurationRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - customDataIdentifier: encodeSimple( - "customDataIdentifier", - payload.customDataIdentifier, - { explode: false, charEncoding: "percent" }, - ), - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-custom-data-type-configuration", - oAuth2Scopes: null, +type Call = CodatPlatform["customDataType"]["getConfiguration"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CustomDataTypeRecords$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customDataTypeGetConfiguration( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customDataType.getConfiguration(request, options))); } diff --git a/platform/src/funcs/customDataTypeList.ts b/platform/src/funcs/customDataTypeList.ts index 83bc71508..c1e89b946 100644 --- a/platform/src/funcs/customDataTypeList.ts +++ b/platform/src/funcs/customDataTypeList.ts @@ -1,211 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List custom data type records - * - * @remarks - * The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) - */ -export function customDataTypeList( - client: CodatPlatformCore, - request: operations.ListCustomDataTypeRecordsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ListCustomDataTypeRecordsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCustomDataTypeRecordsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - customDataIdentifier: encodeSimple( - "customDataIdentifier", - payload.customDataIdentifier, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}", - )(pathParams); - - const query = encodeFormQuery({ - "page": payload.page, - "pageSize": payload.pageSize, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-custom-data-type-records", - oAuth2Scopes: null, +type Call = CodatPlatform["customDataType"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CustomDataTypeRecords, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CustomDataTypeRecords$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429, 451], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customDataTypeList( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customDataType.list(request, options))); } diff --git a/platform/src/funcs/customDataTypeRefresh.ts b/platform/src/funcs/customDataTypeRefresh.ts index 71b3728a4..08f6990e6 100644 --- a/platform/src/funcs/customDataTypeRefresh.ts +++ b/platform/src/funcs/customDataTypeRefresh.ts @@ -1,203 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh custom data type - * - * @remarks - * The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. - */ -export function customDataTypeRefresh( - client: CodatPlatformCore, - request: operations.RefreshCustomDataTypeRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.RefreshCustomDataTypeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RefreshCustomDataTypeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - customDataIdentifier: encodeSimple( - "customDataIdentifier", - payload.customDataIdentifier, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-custom-data-type", - oAuth2Scopes: null, +type Call = CodatPlatform["customDataType"]["refresh"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperation$inboundSchema), - M.jsonErr( - [401, 402, 403, 404, 429, 451], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customDataTypeRefresh( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customDataType.refresh(request, options))); } diff --git a/platform/src/funcs/integrationsGet.ts b/platform/src/funcs/integrationsGet.ts index af1459141..d2dc53622 100644 --- a/platform/src/funcs/integrationsGet.ts +++ b/platform/src/funcs/integrationsGet.ts @@ -1,188 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get integration - * - * @remarks - * Get single integration, by platformKey - */ -export function integrationsGet( - client: CodatPlatformCore, - request: operations.GetIntegrationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Integration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetIntegrationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Integration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetIntegrationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/integrations/{platformKey}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-integration", - oAuth2Scopes: null, +type Call = CodatPlatform["integrations"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Integration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Integration$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function integrationsGet( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.integrations.get(request, options))); } diff --git a/platform/src/funcs/integrationsGetBranding.ts b/platform/src/funcs/integrationsGetBranding.ts index 6a251d15e..587b1941c 100644 --- a/platform/src/funcs/integrationsGetBranding.ts +++ b/platform/src/funcs/integrationsGetBranding.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get branding - * - * @remarks - * Get branding for platform. - */ -export function integrationsGetBranding( - client: CodatPlatformCore, - request: operations.GetIntegrationsBrandingRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Branding, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetIntegrationsBrandingRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Branding, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetIntegrationsBrandingRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/integrations/{platformKey}/branding")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-integrations-branding", - oAuth2Scopes: null, +type Call = CodatPlatform["integrations"]["getBranding"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Branding, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Branding$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function integrationsGetBranding( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.integrations.getBranding(request, options))); } diff --git a/platform/src/funcs/integrationsList.ts b/platform/src/funcs/integrationsList.ts index acd0e0a45..d376b15cd 100644 --- a/platform/src/funcs/integrationsList.ts +++ b/platform/src/funcs/integrationsList.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List integrations - * - * @remarks - * List your available integrations - */ -export function integrationsList( - client: CodatPlatformCore, - request?: operations.ListIntegrationsRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Integrations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: operations.ListIntegrationsRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Integrations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListIntegrationsRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/integrations")(); - - const query = encodeFormQuery({ - "orderBy": payload?.orderBy, - "page": payload?.page, - "pageSize": payload?.pageSize, - "query": payload?.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-integrations", - oAuth2Scopes: null, +type Call = CodatPlatform["integrations"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Integrations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Integrations$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function integrationsList( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.integrations.list(request, options))); } diff --git a/platform/src/funcs/pushDataGetModelOptions.ts b/platform/src/funcs/pushDataGetModelOptions.ts index 13f18b844..8fb004c68 100644 --- a/platform/src/funcs/pushDataGetModelOptions.ts +++ b/platform/src/funcs/pushDataGetModelOptions.ts @@ -1,204 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get push options - * - * @remarks - * This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. - * - * Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. - * - * Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. - */ -export function pushDataGetModelOptions( - client: CodatPlatformCore, - request: operations.GetCreateUpdateModelOptionsByDataTypeRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCreateUpdateModelOptionsByDataTypeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCreateUpdateModelOptionsByDataTypeRequest$outboundSchema - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - dataType: encodeSimple("dataType", payload.dataType, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/options/{dataType}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-update-model-options-by-data-type", - oAuth2Scopes: null, +type Call = CodatPlatform["pushData"]["getModelOptions"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOption, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOption$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function pushDataGetModelOptions( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.pushData.getModelOptions(request, options))); } diff --git a/platform/src/funcs/pushDataGetOperation.ts b/platform/src/funcs/pushDataGetOperation.ts index 23fa87087..7776ee320 100644 --- a/platform/src/funcs/pushDataGetOperation.ts +++ b/platform/src/funcs/pushDataGetOperation.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get push operation - * - * @remarks - * The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - */ -export function pushDataGetOperation( - client: CodatPlatformCore, - request: operations.GetPushOperationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetPushOperationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetPushOperationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - pushOperationKey: encodeSimple( - "pushOperationKey", - payload.pushOperationKey, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/companies/{companyId}/push/{pushOperationKey}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-push-operation", - oAuth2Scopes: null, +type Call = CodatPlatform["pushData"]["getOperation"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperation$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function pushDataGetOperation( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.pushData.getOperation(request, options))); } diff --git a/platform/src/funcs/pushDataListOperations.ts b/platform/src/funcs/pushDataListOperations.ts index 0d0871181..617dd2705 100644 --- a/platform/src/funcs/pushDataListOperations.ts +++ b/platform/src/funcs/pushDataListOperations.ts @@ -1,202 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List push operations - * - * @remarks - * The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - */ -export function pushDataListOperations( - client: CodatPlatformCore, - request: operations.GetCompanyPushHistoryRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCompanyPushHistoryRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyPushHistoryRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/push")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-push-history", - oAuth2Scopes: null, +type Call = CodatPlatform["pushData"]["listOperations"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperations$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function pushDataListOperations( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.pushData.listOperations(request, options))); } diff --git a/platform/src/funcs/readDataGetValidationResults.ts b/platform/src/funcs/readDataGetValidationResults.ts index b669f6d6c..86174ebbf 100644 --- a/platform/src/funcs/readDataGetValidationResults.ts +++ b/platform/src/funcs/readDataGetValidationResults.ts @@ -1,200 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get validation results - * - * @remarks - * Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. - * - * The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - * - * - **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. - * - **`errors`** array contains critical issues that must be resolved before the data type can be used. - */ -export function readDataGetValidationResults( - client: CodatPlatformCore, - request: operations.GetReadValidationResultsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.ValidationResult, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetReadValidationResultsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ValidationResult, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetReadValidationResultsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - datasetId: encodeSimple("datasetId", payload.datasetId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/sync/{datasetId}/validation")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-read-validation-results", - oAuth2Scopes: null, +type Call = CodatPlatform["readData"]["getValidationResults"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ValidationResult, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ValidationResult$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function readDataGetValidationResults( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.readData.getValidationResults(request, options))); } diff --git a/platform/src/funcs/refreshDataAll.ts b/platform/src/funcs/refreshDataAll.ts index 8199dd6e7..4359d7d9c 100644 --- a/platform/src/funcs/refreshDataAll.ts +++ b/platform/src/funcs/refreshDataAll.ts @@ -1,195 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh all data - * - * @remarks - * Refreshes all data types with `fetch on first link` set to `true` for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - * - * [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - */ -export function refreshDataAll( - client: CodatPlatformCore, - request: operations.RefreshCompanyDataRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.RefreshCompanyDataRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.RefreshCompanyDataRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/all")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-company-data", - oAuth2Scopes: null, +type Call = CodatPlatform["refreshData"]["all"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function refreshDataAll( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.refreshData.all(request, options))); } diff --git a/platform/src/funcs/refreshDataByDataType.ts b/platform/src/funcs/refreshDataByDataType.ts index 891959ef1..6f5ec94f3 100644 --- a/platform/src/funcs/refreshDataByDataType.ts +++ b/platform/src/funcs/refreshDataByDataType.ts @@ -1,204 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh data type - * - * @remarks - * Refreshes a given data type for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - */ -export function refreshDataByDataType( - client: CodatPlatformCore, - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.RefreshDataTypeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - dataType: encodeSimple("dataType", payload.dataType, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/queue/{dataType}")( - pathParams, - ); - - const query = encodeFormQuery({ - "connectionId": payload.connectionId, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-data-type", - oAuth2Scopes: null, +type Call = CodatPlatform["refreshData"]["byDataType"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperation$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function refreshDataByDataType( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.refreshData.byDataType(request, options))); } diff --git a/platform/src/funcs/refreshDataGet.ts b/platform/src/funcs/refreshDataGet.ts index c87e650e4..e6d582305 100644 --- a/platform/src/funcs/refreshDataGet.ts +++ b/platform/src/funcs/refreshDataGet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get data status - * - * @remarks - * Get the state of each data type for a company - */ -export function refreshDataGet( - client: CodatPlatformCore, - request: operations.GetCompanyDataStatusRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.DataStatuses, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetCompanyDataStatusRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.DataStatuses, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyDataStatusRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/dataStatus")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-data-status", - oAuth2Scopes: null, +type Call = CodatPlatform["refreshData"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.DataStatuses, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.DataStatuses$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function refreshDataGet( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.refreshData.get(request, options))); } diff --git a/platform/src/funcs/refreshDataGetPullOperation.ts b/platform/src/funcs/refreshDataGetPullOperation.ts index ee36f9d08..8ddc6b1ea 100644 --- a/platform/src/funcs/refreshDataGetPullOperation.ts +++ b/platform/src/funcs/refreshDataGetPullOperation.ts @@ -1,194 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get pull operation - * - * @remarks - * Retrieve information about a single dataset or pull operation. - */ -export function refreshDataGetPullOperation( - client: CodatPlatformCore, - request: operations.GetPullOperationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetPullOperationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetPullOperationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - datasetId: encodeSimple("datasetId", payload.datasetId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/history/{datasetId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-pull-operation", - oAuth2Scopes: null, +type Call = CodatPlatform["refreshData"]["getPullOperation"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperation, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperation$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function refreshDataGetPullOperation( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.refreshData.getPullOperation(request, options))); } diff --git a/platform/src/funcs/refreshDataListPullOperations.ts b/platform/src/funcs/refreshDataListPullOperations.ts index b4cf03ed1..b23616488 100644 --- a/platform/src/funcs/refreshDataListPullOperations.ts +++ b/platform/src/funcs/refreshDataListPullOperations.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List pull operations - * - * @remarks - * Gets the pull operation history (datasets) for a given company. - */ -export function refreshDataListPullOperations( - client: CodatPlatformCore, - request: operations.ListPullOperationsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ListPullOperationsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListPullOperationsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/history")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-pull-operations", - oAuth2Scopes: null, +type Call = CodatPlatform["refreshData"]["listPullOperations"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperations, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperations$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function refreshDataListPullOperations( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.refreshData.listPullOperations(request, options))); } diff --git a/platform/src/funcs/settingsCreateApiKey.ts b/platform/src/funcs/settingsCreateApiKey.ts index 8adc1a069..dbbe63040 100644 --- a/platform/src/funcs/settingsCreateApiKey.ts +++ b/platform/src/funcs/settingsCreateApiKey.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create API key - * - * @remarks - * Use the *Create API keys* endpoint to generate a new API key for your client. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - * - * ### Tips and pitfalls - * - * * Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). - * * If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. - * * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. - */ -export function settingsCreateApiKey( - client: CodatPlatformCore, - request?: shared.CreateApiKey | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.ApiKeyDetails, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.CreateApiKey | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ApiKeyDetails, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.CreateApiKey$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/apiKeys")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-api-key", - oAuth2Scopes: null, +type Call = CodatPlatform["settings"]["createApiKey"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ApiKeyDetails, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.ApiKeyDetails$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsCreateApiKey( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.settings.createApiKey(request, options))); } diff --git a/platform/src/funcs/settingsDeleteApiKey.ts b/platform/src/funcs/settingsDeleteApiKey.ts index 4a93b6291..b3e500813 100644 --- a/platform/src/funcs/settingsDeleteApiKey.ts +++ b/platform/src/funcs/settingsDeleteApiKey.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete API key - * - * @remarks - * Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - * - * ### Tips and pitfalls - * - * * It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. - * * It is possible to delete the API key used to authenticate the *Delete API key* request. - */ -export function settingsDeleteApiKey( - client: CodatPlatformCore, - request: operations.DeleteApiKeyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.ErrorMessage, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.DeleteApiKeyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ErrorMessage, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteApiKeyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiKeyId: encodeSimple("apiKeyId", payload.apiKeyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/apiKeys/{apiKeyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-api-key", - oAuth2Scopes: null, +type Call = CodatPlatform["settings"]["deleteApiKey"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ErrorMessage, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(204, shared.ErrorMessage$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsDeleteApiKey( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.settings.deleteApiKey(request, options))); } diff --git a/platform/src/funcs/settingsGet.ts b/platform/src/funcs/settingsGet.ts index a30519f0e..051ffd984 100644 --- a/platform/src/funcs/settingsGet.ts +++ b/platform/src/funcs/settingsGet.ts @@ -1,166 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get CORS settings - * - * @remarks - * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - */ -export function settingsGet( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/corsSettings")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-cors-settings", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["settings"]["get"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ConnectionManagementAllowedOrigins$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsGet( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.settings.get(options))); } diff --git a/platform/src/funcs/settingsGetProfile.ts b/platform/src/funcs/settingsGetProfile.ts index 0ac5dd61b..ecf38402c 100644 --- a/platform/src/funcs/settingsGetProfile.ts +++ b/platform/src/funcs/settingsGetProfile.ts @@ -1,164 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get profile - * - * @remarks - * Fetch your Codat profile. - */ -export function settingsGetProfile( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/profile")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-profile", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["settings"]["getProfile"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Profile$inboundSchema), - M.jsonErr([401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsGetProfile( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.settings.getProfile(options))); } diff --git a/platform/src/funcs/settingsGetSyncSettings.ts b/platform/src/funcs/settingsGetSyncSettings.ts index fc49221e1..940718958 100644 --- a/platform/src/funcs/settingsGetSyncSettings.ts +++ b/platform/src/funcs/settingsGetSyncSettings.ts @@ -1,164 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get sync settings - * - * @remarks - * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. - */ -export function settingsGetSyncSettings( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.SyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.SyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/profile/syncSettings")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-profile-syncSettings", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["settings"]["getSyncSettings"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.SyncSettings, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.SyncSettings$inboundSchema), - M.jsonErr([401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsGetSyncSettings( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.settings.getSyncSettings(options))); } diff --git a/platform/src/funcs/settingsListApiKeys.ts b/platform/src/funcs/settingsListApiKeys.ts index d33d507c9..be063c705 100644 --- a/platform/src/funcs/settingsListApiKeys.ts +++ b/platform/src/funcs/settingsListApiKeys.ts @@ -1,168 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List API keys - * - * @remarks - * Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - */ -export function settingsListApiKeys( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.ApiKeys, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ApiKeys, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/apiKeys")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-api-keys", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["settings"]["listApiKeys"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ApiKeys, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ApiKeys$inboundSchema), - M.jsonErr([401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsListApiKeys( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.settings.listApiKeys(options))); } diff --git a/platform/src/funcs/settingsSet.ts b/platform/src/funcs/settingsSet.ts index 2f036b3cf..f22388aee 100644 --- a/platform/src/funcs/settingsSet.ts +++ b/platform/src/funcs/settingsSet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Set CORS settings - * - * @remarks - * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - */ -export function settingsSet( - client: CodatPlatformCore, - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - shared.ConnectionManagementAllowedOrigins$outboundSchema.optional().parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/corsSettings")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "set-cors-settings", - oAuth2Scopes: null, +type Call = CodatPlatform["settings"]["set"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.ConnectionManagementAllowedOrigins, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.ConnectionManagementAllowedOrigins$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsSet( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.settings.set(request, options))); } diff --git a/platform/src/funcs/settingsUpdateProfile.ts b/platform/src/funcs/settingsUpdateProfile.ts index 26a841a1a..62d636c96 100644 --- a/platform/src/funcs/settingsUpdateProfile.ts +++ b/platform/src/funcs/settingsUpdateProfile.ts @@ -1,184 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update profile - * - * @remarks - * Update your Codat profile - */ -export function settingsUpdateProfile( - client: CodatPlatformCore, - request?: shared.Profile | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.Profile | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.Profile$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/profile")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-profile", - oAuth2Scopes: null, +type Call = CodatPlatform["settings"]["updateProfile"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Profile, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Profile$inboundSchema), - M.jsonErr([401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsUpdateProfile( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.settings.updateProfile(request, options))); } diff --git a/platform/src/funcs/settingsUpdateSyncSettings.ts b/platform/src/funcs/settingsUpdateSyncSettings.ts index 764ed9e52..d5db9cec2 100644 --- a/platform/src/funcs/settingsUpdateSyncSettings.ts +++ b/platform/src/funcs/settingsUpdateSyncSettings.ts @@ -1,187 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update all sync settings - * - * @remarks - * Update sync settings for all data types. - */ -export function settingsUpdateSyncSettings( - client: CodatPlatformCore, - request?: operations.UpdateProfileSyncSettingsRequestBody | undefined, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: operations.UpdateProfileSyncSettingsRequestBody | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateProfileSyncSettingsRequestBody$outboundSchema.optional() - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/profile/syncSettings")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-profile-syncSettings", - oAuth2Scopes: null, +type Call = CodatPlatform["settings"]["updateSyncSettings"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function settingsUpdateSyncSettings( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.settings.updateSyncSettings(request, options))); } diff --git a/platform/src/funcs/supplementalDataConfigure.ts b/platform/src/funcs/supplementalDataConfigure.ts index 7bdc561de..2a8414169 100644 --- a/platform/src/funcs/supplementalDataConfigure.ts +++ b/platform/src/funcs/supplementalDataConfigure.ts @@ -1,203 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Configure - * - * @remarks - * The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. - * - * [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - * - * **Integration-specific behavior** - * See the *examples* for integration-specific frequently requested properties. - */ -export function supplementalDataConfigure( - client: CodatPlatformCore, - request: operations.ConfigureSupplementalDataRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.ConfigureSupplementalDataRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ConfigureSupplementalDataRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.SupplementalDataConfiguration, { - explode: true, - }); - - const pathParams = { - dataType: encodeSimple("dataType", payload.dataType, { - explode: false, - charEncoding: "percent", - }), - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "configure-supplemental-data", - oAuth2Scopes: null, +type Call = CodatPlatform["supplementalData"]["configure"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(200, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function supplementalDataConfigure( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.supplementalData.configure(request, options))); } diff --git a/platform/src/funcs/supplementalDataGetConfiguration.ts b/platform/src/funcs/supplementalDataGetConfiguration.ts index 9e464a0a7..b24103cfb 100644 --- a/platform/src/funcs/supplementalDataGetConfiguration.ts +++ b/platform/src/funcs/supplementalDataGetConfiguration.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get configuration - * - * @remarks - * The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. - * - * [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - */ -export function supplementalDataGetConfiguration( - client: CodatPlatformCore, - request: operations.GetSupplementalDataConfigurationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.SupplementalDataConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.GetSupplementalDataConfigurationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.SupplementalDataConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetSupplementalDataConfigurationRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - dataType: encodeSimple("dataType", payload.dataType, { - explode: false, - charEncoding: "percent", - }), - platformKey: encodeSimple("platformKey", payload.platformKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-supplemental-data-configuration", - oAuth2Scopes: null, +type Call = CodatPlatform["supplementalData"]["getConfiguration"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.SupplementalDataConfiguration, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.SupplementalDataConfiguration$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function supplementalDataGetConfiguration( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.supplementalData.getConfiguration(request, options))); } diff --git a/platform/src/funcs/validateWebhook.ts b/platform/src/funcs/validateWebhook.ts index 02c1297b4..a14c4b131 100644 --- a/platform/src/funcs/validateWebhook.ts +++ b/platform/src/funcs/validateWebhook.ts @@ -1,78 +1,76 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -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"; +import type { CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror"; +import type * as shared from "../sdk/models/index"; -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, - ]; +type ValidateWebhookResult = shared.CompanyWebhook | shared.CompanyProductWebhook | shared.ConnectionWebhook | shared.ReadCompletedWebhook | shared.DataTypeWriteWebhook | shared.ClientRateLimitWebhook | undefined; - const jsonString = await request.text(); +type WebhookMatchSpec = + | "string" + | "number" + | "boolean" + | "any" + | { kind: "nullable"; inner: WebhookMatchSpec } + | { kind: "array"; items: WebhookMatchSpec } + | { kind: "object"; required: string[]; props: Record }; - for (const schema of knownSchemas) { - const ret = schema(jsonString); - if (ret.ok) { - return ret; +function conformsToWebhookSpec(value: unknown, spec: WebhookMatchSpec): boolean { + if (spec === "any") { return true; } + if (spec === "string") { return typeof value === "string"; } + if (spec === "number") { return typeof value === "number"; } + if (spec === "boolean") { return typeof value === "boolean"; } + if (spec.kind === "nullable") { return value === null || conformsToWebhookSpec(value, spec.inner); } + if (spec.kind === "array") { return Array.isArray(value) && value.every((item) => conformsToWebhookSpec(item, spec.items)); } + if (value === null || typeof value !== "object" || Array.isArray(value)) { return false; } + const object = value as Record; + for (const key of spec.required) { + if (object[key] === undefined) { return false; } } - } - - return ERR( - new SDKValidationError( - "No matching schema found for the given webhook payload", - jsonString, - jsonString, - ), - ); + for (const key of Object.keys(spec.props)) { + if (object[key] === undefined) { continue; } + if (!conformsToWebhookSpec(object[key], spec.props[key])) { return false; } + } + return true; } -function normalizeRequest( - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request, +function normalizeWebhookRequest( + request: { body: string; method: string; url: string; headers: Record | Headers } | Request, ): Request { - if (request instanceof Request) { - return request; - } - return new Request(request.url, request); + if (typeof Request !== "undefined" && request instanceof Request) { return request; } + return new Request(request.url, request); +} + +const WEBHOOK_NO_MATCH_MESSAGE = "No matching schema found for the given webhook payload"; + +const WEBHOOK_MATCH_ORDER: { name: string; spec: WebhookMatchSpec }[] = [ + { name: "CompanyWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": ["id", "name", "redirect"], "props": {"id": "any", "name": "string", "description": "string", "redirect": "string", "lastSync": "string", "created": "string", "createdByUserName": {"kind": "nullable", "inner": "string"}, "products": {"kind": "array", "items": "string"}, "tags": {"kind": "object", "required": [], "props": {}}, "referenceParentCompany": {"kind": "object", "required": [], "props": {"id": "any", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "referenceSubsidiaryCompanies": {"kind": "array", "items": {"kind": "object", "required": [], "props": {"id": "any", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}}}}}} }, + { name: "ConnectionWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"referenceCompany": {"kind": "object", "required": [], "props": {"id": "any", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "connection": {"kind": "object", "required": ["id", "integrationId", "sourceId", "platformName", "linkUrl", "status", "created", "sourceType"], "props": {"id": "string", "integrationId": "string", "integrationKey": "string", "sourceId": "string", "sourceType": "string", "platformName": "string", "linkUrl": "string", "status": "string", "lastSync": "string", "created": "string", "dataConnectionErrors": {"kind": "nullable", "inner": {"kind": "array", "items": {"kind": "object", "required": [], "props": {"statusCode": "string", "statusText": "string", "errorMessage": "string", "erroredOnUtc": "any", "status": {"kind": "nullable", "inner": "string"}, "resolvedOnUtc": "any"}}}}, "connectionInfo": {"kind": "nullable", "inner": {"kind": "object", "required": [], "props": {}}}}}}}}} }, + { name: "ReadCompletedWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"referenceCompany": {"kind": "object", "required": [], "props": {"id": "any", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "modifiedFromDate": "string", "dataTypes": {"kind": "array", "items": {"kind": "object", "required": [], "props": {"connectionId": "string", "dataType": "string", "recordsModified": "boolean", "status": "string", "issues": {"kind": "nullable", "inner": {"kind": "array", "items": {"kind": "object", "required": [], "props": {"type": "string", "message": "string", "links": {"kind": "object", "required": [], "props": {"logs": "string", "portal": "string", "readMore": "string"}}}}}}}}}}}}} }, + { name: "DataTypeWriteWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"id": "string", "type": "string", "referenceCompany": {"kind": "object", "required": [], "props": {"id": "any", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "connectionId": "string", "requestedOnDate": "string", "completedOnDate": "string", "status": "string", "record": {"kind": "object", "required": [], "props": {"id": "string"}}, "attachmentId": {"kind": "nullable", "inner": "string"}}}}} }, + { name: "ClientRateLimitWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"dailyQuota": "number", "quotaRemaining": "number", "expiryDate": "string"}}}} } +]; + +export function validateWebhook(_client: CodatPlatformCore, { request }: { request: { body: string; method: string; url: string; headers: Record | Headers } | Request }): APIPromise> { + void _client; + return new APIPromise((async (): Promise> => { + const normalized = normalizeWebhookRequest(request); + const jsonString = await normalized.text(); + let parsed: unknown; + try { + parsed = JSON.parse(jsonString); + } catch { + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + } + for (const member of WEBHOOK_MATCH_ORDER) { + if (conformsToWebhookSpec(parsed, member.spec)) { + return OK(parsed as ValidateWebhookResult); + } + } + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + })()); } diff --git a/platform/src/funcs/webhooksCreateConsumer.ts b/platform/src/funcs/webhooksCreateConsumer.ts index 184ebe2ae..ff4d82883 100644 --- a/platform/src/funcs/webhooksCreateConsumer.ts +++ b/platform/src/funcs/webhooksCreateConsumer.ts @@ -1,190 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create webhook consumer - * - * @remarks - * Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - * - * ### Tips and traps - * - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. - */ -export function webhooksCreateConsumer( - client: CodatPlatformCore, - request?: shared.WebhookConsumerPrototype | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.WebhookConsumer, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request?: shared.WebhookConsumerPrototype | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.WebhookConsumer, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - shared.WebhookConsumerPrototype$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/webhooks")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-webhook-consumer", - oAuth2Scopes: null, +type Call = CodatPlatform["webhooks"]["createConsumer"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.WebhookConsumer, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(201, shared.WebhookConsumer$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function webhooksCreateConsumer( + client: CodatPlatformCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.webhooks.createConsumer(request, options))); } diff --git a/platform/src/funcs/webhooksDeleteConsumer.ts b/platform/src/funcs/webhooksDeleteConsumer.ts index 7923eeba4..780335eb1 100644 --- a/platform/src/funcs/webhooksDeleteConsumer.ts +++ b/platform/src/funcs/webhooksDeleteConsumer.ts @@ -1,191 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete webhook consumer - * - * @remarks - * Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - */ -export function webhooksDeleteConsumer( - client: CodatPlatformCore, - request: operations.DeleteWebhookConsumerRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - request: operations.DeleteWebhookConsumerRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DeleteWebhookConsumerRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - webhookId: encodeSimple("webhookId", payload.webhookId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/webhooks/{webhookId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-webhook-consumer", - oAuth2Scopes: null, +type Call = CodatPlatform["webhooks"]["deleteConsumer"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function webhooksDeleteConsumer( + client: CodatPlatformCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.webhooks.deleteConsumer(request, options))); } diff --git a/platform/src/funcs/webhooksListConsumers.ts b/platform/src/funcs/webhooksListConsumers.ts index acad565e2..c74bd4944 100644 --- a/platform/src/funcs/webhooksListConsumers.ts +++ b/platform/src/funcs/webhooksListConsumers.ts @@ -1,166 +1,18 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformCore } from "../core.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatPlatformError } from "../sdk/models/errors/codatplatformerror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List webhook consumers - * - * @remarks - * Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - */ -export function webhooksListConsumers( - client: CodatPlatformCore, - options?: RequestOptions, -): APIPromise< - Result< - shared.WebhookConsumers, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: CodatPlatformCore, - options?: RequestOptions, -): Promise< - [ - Result< - shared.WebhookConsumers, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/webhooks")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-webhook-consumers", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, +type Call = CodatPlatform["webhooks"]["listConsumers"]; - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.WebhookConsumers, - | errors.ErrorMessage - | CodatPlatformError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.WebhookConsumers$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function webhooksListConsumers( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.webhooks.listConsumers(options))); } diff --git a/platform/src/funcs/webhooksRotateZapierKey.ts b/platform/src/funcs/webhooksRotateZapierKey.ts new file mode 100644 index 000000000..bfb4bd289 --- /dev/null +++ b/platform/src/funcs/webhooksRotateZapierKey.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type { CodatPlatform, CodatPlatformCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; + +type Call = CodatPlatform["webhooks"]["rotateZapierKey"]; + +export function webhooksRotateZapierKey( + client: CodatPlatformCore, + request?: Record, + options?: Parameters[0], +): APIPromise>, Error>> { + void request; + return new APIPromise(toResult(() => client.webhooks.rotateZapierKey(options))); +} diff --git a/platform/src/hooks/hooks.ts b/platform/src/hooks/hooks.ts index d34c88497..b628a2bf8 100644 --- a/platform/src/hooks/hooks.ts +++ b/platform/src/hooks/hooks.ts @@ -1,132 +1,75 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { RequestInput } from "../lib/http.js"; import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, - SDKInitOptions, -} from "./types.js"; - -import { initHooks } from "./registration.js"; + AfterErrorContext, AfterErrorHook, AfterSuccessContext, AfterSuccessHook, + BeforeCreateRequestContext, BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, +} from "./types"; +import { RequestInput } from "../lib/sdkconfig"; +import { initHooks } from "./registration"; export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + const presetHooks: Array = []; + for (const hook of presetHooks) { + if ("sdkInit" in hook) { this.registerSDKInitHook(hook); } + if ("beforeCreateRequest" in hook) { this.registerBeforeCreateRequestHook(hook); } + if ("beforeRequest" in hook) { this.registerBeforeRequestHook(hook); } + if ("afterSuccess" in hook) { this.registerAfterSuccessHook(hook); } + if ("afterError" in hook) { this.registerAfterErrorHook(hook); } + } + initHooks(this); } - initHooks(this); - } - - registerSDKInitHook(hook: SDKInitHook) { - this.sdkInitHooks.push(hook); - } - - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { - this.beforeCreateRequestHooks.push(hook); - } - - registerBeforeRequestHook(hook: BeforeRequestHook) { - this.beforeRequestHooks.push(hook); - } - - registerAfterSuccessHook(hook: AfterSuccessHook) { - this.afterSuccessHooks.push(hook); - } - - registerAfterErrorHook(hook: AfterErrorHook) { - this.afterErrorHooks.push(hook); - } - sdkInit(opts: SDKInitOptions): SDKInitOptions { - return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); - } + registerSDKInitHook(hook: SDKInitHook) { this.sdkInitHooks.push(hook); } + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { this.beforeCreateRequestHooks.push(hook); } + registerBeforeRequestHook(hook: BeforeRequestHook) { this.beforeRequestHooks.push(hook); } + registerAfterSuccessHook(hook: AfterSuccessHook) { this.afterSuccessHooks.push(hook); } + registerAfterErrorHook(hook: AfterErrorHook) { this.afterErrorHooks.push(hook); } - beforeCreateRequest( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - let inp = input; - - for (const hook of this.beforeCreateRequestHooks) { - inp = hook.beforeCreateRequest(hookCtx, inp); + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((o, hook) => hook.sdkInit(o), opts); } - return inp; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - let req = request; - - for (const hook of this.beforeRequestHooks) { - req = await hook.beforeRequest(hookCtx, req); + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + return inp; } - return req; - } - - async afterSuccess( - hookCtx: AfterSuccessContext, - response: Response, - ): Promise { - let res = response; - - for (const hook of this.afterSuccessHooks) { - res = await hook.afterSuccess(hookCtx, res); + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + return req; } - return res; - } - - async afterError( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ): Promise<{ response: Response | null; error: unknown }> { - let res = response; - let err = error; - - for (const hook of this.afterErrorHooks) { - const result = await hook.afterError(hookCtx, res, err); - res = result.response; - err = result.error; + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + return res; } - return { response: res, error: err }; - } + async afterError(hookCtx: AfterErrorContext, response: Response | null, error: unknown): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + return { response: res, error: err }; + } } diff --git a/platform/src/hooks/index.ts b/platform/src/hooks/index.ts index f60ec7acd..ae868065a 100644 --- a/platform/src/hooks/index.ts +++ b/platform/src/hooks/index.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./hooks.js"; -export * from "./types.js"; +export * from "./hooks"; +export * from "./types"; diff --git a/platform/src/hooks/types.ts b/platform/src/hooks/types.ts index 494395f66..3818216a1 100644 --- a/platform/src/hooks/types.ts +++ b/platform/src/hooks/types.ts @@ -1,29 +1,23 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -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"; +import { SDKOptions, RetryConfig, HTTPClient, RequestInput, SecurityState } from "../lib/sdkconfig"; + +export type Awaitable = T | Promise; export type HookContext = { - baseURL: string | URL; - operationID: string; - oAuth2Scopes: string[] | null; - webhookRecipient?: WebhookRecipient; - securitySource?: any | (() => Promise); - retryConfig: RetryConfig; - resolvedSecurity: SecurityState | null; - options: SDKOptions; + baseURL: string | URL; + operationID: string; + oAuth2Scopes: string[] | null; + securitySource?: unknown | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; + options: SDKOptions; }; -export type Awaitable = T | Promise; - export type SDKInitOptions = { - baseURL: URL | null; - client: HTTPClient; + baseURL: URL | null; + client: HTTPClient; }; export type BeforeCreateRequestContext = HookContext & {}; @@ -31,84 +25,37 @@ export type BeforeRequestContext = HookContext & {}; export type AfterSuccessContext = HookContext & {}; export type AfterErrorContext = HookContext & {}; -/** - * SDKInitHook is called when the SDK is initializing. The - * hook can return a new baseURL and HTTP client to be used by the SDK. - */ export interface SDKInitHook { - sdkInit: (opts: SDKInitOptions) => SDKInitOptions; + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; } export interface BeforeCreateRequestHook { - /** - * A hook that is called before the SDK creates a `Request` object. The hook - * can modify how a request is constructed since certain modifications, like - * changing the request URL, cannot be done on a request object directly. - */ - beforeCreateRequest: ( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ) => RequestInput; + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; } export interface BeforeRequestHook { - /** - * A hook that is called before the SDK sends a request. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * replace the request before it is sent or throw an error to stop the - * request from being sent. - */ - beforeRequest: ( - hookCtx: BeforeRequestContext, - request: Request, - ) => Awaitable; + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; } export interface AfterSuccessHook { - /** - * A hook that is called after the SDK receives a response. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * modify the response before it is handled or throw an error to stop the - * response from being handled. - */ - afterSuccess: ( - hookCtx: AfterSuccessContext, - response: Response, - ) => Awaitable; + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; } export interface AfterErrorHook { - /** - * A hook that is called after the SDK encounters an error, or a - * non-successful response. The hook can introduce instrumentation code such - * as logging, tracing and metrics or modify the response or error values. - */ - afterError: ( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ) => Awaitable<{ - response: Response | null; - error: unknown; - }>; + afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable<{ response: Response | null; error: unknown }>; } export interface Hooks { - /** Registers a hook to be used by the SDK for initialization event. */ - registerSDKInitHook(hook: SDKInitHook): void; - /** Registers a hook to be used by the SDK for to modify `Request` construction. */ - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; - /** Registers a hook to be used by the SDK for the before request event. */ - registerBeforeRequestHook(hook: BeforeRequestHook): void; - /** Registers a hook to be used by the SDK for the after success event. */ - registerAfterSuccessHook(hook: AfterSuccessHook): void; - /** Registers a hook to be used by the SDK for the after error event. */ - registerAfterErrorHook(hook: AfterErrorHook): void; + registerSDKInitHook(hook: SDKInitHook): void; + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + registerBeforeRequestHook(hook: BeforeRequestHook): void; + registerAfterSuccessHook(hook: AfterSuccessHook): void; + registerAfterErrorHook(hook: AfterErrorHook): void; } export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/platform/src/index.ts b/platform/src/index.ts index dbcba164a..52b74ba06 100644 --- a/platform/src/index.ts +++ b/platform/src/index.ts @@ -1,9 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './sdk/models/index'; +export * from './sdk/types/rfcdate'; +export * from './sdk'; +export * from './lib/sdkconfig'; diff --git a/platform/src/lib/base64.ts b/platform/src/lib/base64.ts deleted file mode 100644 index 0aebd8b0a..000000000 --- a/platform/src/lib/base64.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function bytesToBase64(u8arr: Uint8Array): string { - return btoa(String.fromCodePoint(...u8arr)); -} - -export function bytesFromBase64(encoded: string): Uint8Array { - return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); -} - -export function stringToBytes(str: string): Uint8Array { - return new TextEncoder().encode(str); -} - -export function stringFromBytes(u8arr: Uint8Array): string { - return new TextDecoder().decode(u8arr); -} - -export function stringToBase64(str: string): string { - return bytesToBase64(stringToBytes(str)); -} - -export function stringFromBase64(b64str: string): string { - return stringFromBytes(bytesFromBase64(b64str)); -} - -export const zodOutbound = z - .instanceof(Uint8Array) - .or(z.string().transform(stringToBytes)); - -export const zodInbound = z - .instanceof(Uint8Array) - .or(z.string().transform(bytesFromBase64)); diff --git a/platform/src/lib/config.ts b/platform/src/lib/config.ts index abccc40d2..416844419 100644 --- a/platform/src/lib/config.ts +++ b/platform/src/lib/config.ts @@ -1,67 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.js"; -import { RetryConfig } from "./retries.js"; -import { Params, pathToFunc } from "./url.js"; - -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = [ - /** - * Production - */ - "https://api.codat.io", -] as const; - -export type SDKOptions = { - authHeader?: string | (() => Promise) | undefined; - - httpClient?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - userAgent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: RetryConfig; - timeoutMs?: number; - debugLogger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.serverURL; - - const params: Params = {}; - - if (!serverURL) { - const serverIdx = options.serverIdx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); +export function serverURLFromOptions(options: unknown): string { + void options; + return ""; } - -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", -} 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 deleted file mode 100644 index 2791d25bc..000000000 --- a/platform/src/lib/encodings.ts +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export class EncodingError extends Error { - constructor(message: string) { - super(message); - this.name = "EncodingError"; - } -} - -export function encodeMatrix( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - const keyPrefix = encodeString(pk); - tmp = `${keyPrefix}=${encValue}`; - // trim trailing '=' if value was empty - if (tmp === `${keyPrefix}=`) { - tmp = tmp.slice(0, -1); - } - - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `;${tmp}`; - }); - - return out; -} - -export function encodeLabel( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) - ? `${encodeString(pk)}=` - : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -function formEncoder(sep: string): FormEncoder { - return ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, - ) => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - const encodedSep = encodeString(sep); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep); - } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; - })?.join(encodedSep); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); - }; -} - -export const encodeForm = formEncoder(","); -export const encodeSpaceDelimited = formEncoder(" "); -export const encodePipeDelimited = formEncoder("|"); - -export function encodeBodyForm( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else if (isPlainObject(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else { - encValue = `${encodeValue(pv)}`; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); -} - -export function encodeDeepObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - let out = ""; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - if (!isPlainObject(value)) { - throw new EncodingError(`Expected parameter '${key}' to be an object.`); - } - - Object.entries(value).forEach(([ck, cv]) => { - if (cv == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - if (typeof value === "undefined") { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encVal = encodeString(JSON.stringify(value, jsonReplacer)); - - return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; -} - -export const encodeSimple = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${tmp}` : ""; - }); - - return out.slice(1); -}; - -function explode(key: string, value: unknown): [string, unknown][] { - if (Array.isArray(value)) { - return value.map((v) => [key, v]); - } else if (isPlainObject(value)) { - const o = value ?? {}; - return Object.entries(o).map(([k, v]) => [k, v]); - } else { - return [[key, value]]; - } -} - -function serializeValue(value: unknown): string { - if (value == null) { - return ""; - } else if (value instanceof Date) { - return value.toISOString(); - } else if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else if (typeof value === "object") { - return JSON.stringify(value, jsonReplacer); - } - - return `${value}`; -} - -function jsonReplacer(_: string, value: unknown): unknown { - if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else { - return value; - } -} - -function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; - allowEmptyValue?: string[]; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -type BulkQueryEncoder = ( - values: Record, - options?: QueryEncoderOptions, -) => string; - -export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { - const bulkEncode = function( - values: Record, - options?: QueryEncoderOptions, - ): string { - const opts: QueryEncoderOptions = { - ...options, - explode: options?.explode ?? true, - charEncoding: options?.charEncoding ?? "percent", - }; - - const allowEmptySet = new Set(options?.allowEmptyValue ?? []); - - const encoded = Object.entries(values).map(([key, value]) => { - if (allowEmptySet.has(key)) { - if ( - value === undefined - || value === null - || value === "" - || (Array.isArray(value) && value.length === 0) - ) { - return `${encodeURIComponent(key)}=`; - } - } - return f(key, value, opts); - }); - return queryJoin(...encoded); - }; - - return bulkEncode; -} - -export const encodeJSONQuery = queryEncoder(encodeJSON); -export const encodeFormQuery = queryEncoder(encodeForm); -export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); -export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); -export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); - -function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const tag = val[Symbol.toStringTag]; - if (tag !== "Blob" && tag !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (isBlobLike(value)) { - if (fileName) { - fd.append(key, value as Blob, fileName); - } else { - fd.append(key, value as Blob); - } - } else { - fd.append(key, String(value)); - } -} - -export async function normalizeBlob( - value: Pick, -): Promise { - if (value instanceof Blob) { - return value; - } - return new Blob([await value.arrayBuffer()], { type: value.type }); -} diff --git a/platform/src/lib/files.ts b/platform/src/lib/files.ts index 6ca6b37d3..1427b8cf6 100644 --- a/platform/src/lib/files.ts +++ b/platform/src/lib/files.ts @@ -1,104 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; +export function bytesToBlob(content: unknown, contentType: string): Blob { + void content; + return new Blob([], { type: contentType }); } -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; +export function getContentTypeFromFileName(fileName: string): string { + void fileName; + return "application/octet-stream"; } -/** - * Creates a Blob from file content with the given MIME type. - * - * Node.js Buffers are Uint8Array subclasses that may share a pooled - * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing - * such a Buffer directly to `new Blob([buf])` can include the entire - * underlying pool on some runtimes, producing a Blob with extra bytes - * that corrupts multipart uploads. - * - * Copying into a standalone Uint8Array ensures the Blob receives only the - * intended bytes regardless of runtime behaviour. - */ -export function bytesToBlob( - content: Uint8Array | ArrayBuffer | Blob | string, - contentType: string, -): Blob { - if (content instanceof Uint8Array) { - return new Blob([new Uint8Array(content)], { type: contentType }); - } - return new Blob([content as BlobPart], { type: contentType }); +export async function readableStreamToArrayBuffer(readable: unknown): Promise { + void readable; + return new ArrayBuffer(0); } diff --git a/platform/src/lib/http.ts b/platform/src/lib/http.ts deleted file mode 100644 index 13cf1fd78..000000000 --- a/platform/src/lib/http.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Fetcher = ( - input: RequestInfo | URL, - init?: RequestInit, -) => Promise; - -export type Awaitable = T | Promise; - -const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } -}; - -export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; -}; - -export interface HTTPClientOptions { - fetcher?: Fetcher; -} - -export type BeforeRequestHook = (req: Request) => Awaitable; -export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; -export type ResponseHook = (res: Response, req: Request) => Awaitable; - -export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; - } - - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } - - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; - } - - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; - } - - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); - - return child; - } -} - -export type StatusCodePredicate = number | string | (number | string)[]; - -// A semicolon surrounded by optional whitespace characters is used to separate -// segments in a media type string. -const mediaParamSeparator = /\s*;\s*/g; - -export function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; - } - - let contentType = - response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); - - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; - - if (wantType.split("/").length !== 2) { - return false; - } - - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; - - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; - } - - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; - } - - if (gotParams.length < wantParams.length) { - return false; - } - - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } - } - - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode( - response: Response, - codes: StatusCodePredicate, -): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string, -): boolean { - return ( - matchStatusCode(response, code) && - matchContentType(response, contentTypePattern) - ); -} - -/** - * Uses various heurisitics to determine if an error is a connection error. - */ -export function isConnectionError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -/** - * Uses various heurisitics to determine if an error is a timeout error. - */ -export function isTimeoutError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - const isLegacyNative = "code" in err && err.code === 23; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} - -/** - * Uses various heurisitics to determine if an error is a abort error. - */ -export function isAbortError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "AbortError"; - const isLegacyNative = "code" in err && err.code === 20; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} 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/logger.ts b/platform/src/lib/logger.ts deleted file mode 100644 index d181f2937..000000000 --- a/platform/src/lib/logger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/platform/src/lib/matchers.ts b/platform/src/lib/matchers.ts deleted file mode 100644 index b096d6f20..000000000 --- a/platform/src/lib/matchers.ts +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -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"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - json: "application/json", - text: "text/plain", - bytes: "application/octet-stream", - stream: "application/octet-stream", - sse: "text/event-stream", - nil: "*", - fail: "*", -}; - -type Schema = { parse(raw: unknown): T }; - -type MatchOptions = { - ctype?: string; - hdrs?: boolean; - key?: string; - sseSentinel?: string; -}; - -export type ValueMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; -}; - -export type ErrorMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; - err: true; -}; - -export type FailMatcher = { - enc: "fail"; - codes: StatusCodePredicate; -}; - -export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; - -export function jsonErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "json", codes, schema }; -} -export function json( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "json", codes, schema }; -} - -export function jsonl( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes, schema }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", codes, schema }; -} -export function textErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "text", codes, schema }; -} -export function text( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "text", codes, schema }; -} - -export function bytesErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "bytes", codes, schema }; -} -export function bytes( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "bytes", codes, schema }; -} - -export function streamErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "stream", codes, schema }; -} -export function stream( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "stream", codes, schema }; -} - -export function sseErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "sse", codes, schema }; -} -export function sse( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "sse", codes, schema }; -} - -export function nilErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "nil", codes, schema }; -} -export function nil( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "nil", codes, schema }; -} - -export function fail(codes: StatusCodePredicate): FailMatcher { - return { enc: "fail", codes }; -} - -export type MatchedValue = Matchers extends Matcher[] - ? T - : never; -export type MatchedError = Matchers extends Matcher[] - ? E - : never; -export type MatchFunc = ( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, - ): Promise< - [result: Result, raw: unknown] - > { - let raw: unknown; - let matcher: Matcher | undefined; - for (const match of matchers) { - const { codes } = match; - const ctpattern = "ctype" in match - ? match.ctype - : DEFAULT_CONTENT_TYPES[match.enc]; - if (ctpattern && matchResponse(response, codes, ctpattern)) { - matcher = match; - break; - } else if (!ctpattern && matchStatusCode(response, codes)) { - matcher = match; - break; - } - } - - if (!matcher) { - return [{ - ok: false, - error: new SDKError("Unexpected Status or Content-Type", { - response, - request, - body: await response.text().catch(() => ""), - }), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - raw = response.body; - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = body; - break; - default: - throw new Error( - `Unsupported response type: ${encoding satisfies never}`, - ); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new SDKError("API error occurred", { request, response, body }), - }, raw]; - } - - const resultKey = matcher.key || options?.resultKey; - let data: unknown; - - if ("err" in matcher) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - request$: request, - response$: response, - body$: body, - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else if (matcher.hdrs) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - if ("err" in matcher) { - const result = safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ); - return [result.ok ? { ok: false, error: result.value } : result, raw]; - } else { - return [ - safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ), - raw, - ]; - } - }; -} - -const headerValRE = /, */; -/** - * Iterates over a Headers object and returns an object with all the header - * entries. Values are represented as an array to account for repeated headers. - */ -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; -} - -function safeParseResponse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, - httpMeta: { response: Response; request: Request; body: string }, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR( - new ResponseValidationError(errorMessage, { - cause: err, - rawValue, - rawMessage: errorMessage, - ...httpMeta, - }), - ); - } -} diff --git a/platform/src/lib/primitives.ts b/platform/src/lib/primitives.ts deleted file mode 100644 index d21f1dc49..000000000 --- a/platform/src/lib/primitives.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -export type Remap = { - [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ - ? Mapping[k] - : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ - ? never - : k /* otherwise keep the key as-is */]: Inp[k]; -}; - -/** - * Converts or omits an object's keys according to a mapping. - * - * @param inp An object whose keys will be remapped - * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. - * @returns A new object with keys remapped or omitted according to the mappings - */ -export function remap< - Inp extends Record, - const Mapping extends { [k in keyof Inp]?: string | null }, ->(inp: Inp, mappings: Mapping): Remap { - let out: any = {}; - - if (!Object.keys(mappings).length) { - out = inp; - return out; - } - - for (const [k, v] of Object.entries(inp)) { - const j = mappings[k]; - if (j === null) { - continue; - } - out[j ?? k] = v; - } - - return out; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} diff --git a/platform/src/lib/retries.ts b/platform/src/lib/retries.ts deleted file mode 100644 index e3ce9aba7..000000000 --- a/platform/src/lib/retries.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { isConnectionError, isTimeoutError } from "./http.js"; - -export type BackoffStrategy = { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; -}; - -const defaultBackoff: BackoffStrategy = { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, -}; - -export type RetryConfig = - | { strategy: "none" } - | { - strategy: "backoff"; - backoff?: BackoffStrategy; - retryConnectionErrors?: boolean; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function retry( - fetchFn: () => Promise, - options: { - config: RetryConfig; - statusCodes: string[]; - }, -): Promise { - switch (options.config.strategy) { - case "backoff": - return retryBackoff( - wrapFetcher(fetchFn, { - statusCodes: options.statusCodes, - retryConnectionErrors: !!options.config.retryConnectionErrors, - }), - options.config.backoff ?? defaultBackoff, - ); - default: - return await fetchFn(); - } -} - -function wrapFetcher( - fn: () => Promise, - options: { - statusCodes: string[]; - retryConnectionErrors: boolean; - }, -): () => Promise { - return async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: err }); - } - }; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -function isRetryableResponse(res: Response, statusCodes: string[]): boolean { - const actual = `${res.status}`; - - return statusCodes.some((code) => { - if (!codeRangeRE.test(code)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -async function retryBackoff( - fn: () => Promise, - strategy: BackoffStrategy, -): Promise { - const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; - - const start = Date.now(); - let x = 0; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/platform/src/lib/schemas.ts b/platform/src/lib/schemas.ts deleted file mode 100644 index dc2510e33..000000000 --- a/platform/src/lib/schemas.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - output, - ZodEffects, - ZodError, - ZodObject, - ZodRawShape, - ZodTypeAny, -} from "zod/v3"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; - -/** - * Utility function that executes some code which may throw a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function parse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Out { - try { - return fn(rawValue); - } catch (err) { - if (err instanceof ZodError) { - throw new SDKValidationError(errorMessage, err, rawValue); - } - throw err; - } -} - -/** - * Utility function that executes some code which may result in a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function safeParse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR(new SDKValidationError(errorMessage, err, rawValue)); - } -} - -export function collectExtraKeys< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - K extends string, ->( - obj: ZodObject, - extrasKey: K, - optional: boolean, -): ZodEffects< - typeof obj, - & output> - & { - [k in K]: Record>; - } -> { - return obj.transform((val) => { - const extras: Record> = {}; - const { shape } = obj; - for (const [key] of Object.entries(val)) { - if (key in shape) { - continue; - } - - const v = val[key]; - if (typeof v === "undefined") { - continue; - } - - extras[key] = v; - delete val[key]; - } - - if (optional && Object.keys(extras).length === 0) { - return val; - } - - return { ...val, [extrasKey]: extras }; - }); -} diff --git a/platform/src/lib/sdkconfig.ts b/platform/src/lib/sdkconfig.ts new file mode 100644 index 000000000..1459ce65f --- /dev/null +++ b/platform/src/lib/sdkconfig.ts @@ -0,0 +1,473 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type { SDKHooks } from "../hooks/hooks"; +import type { HookContext } from "../hooks/types"; + +export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; + +export type RequestInput = { + url: URL; + options?: RequestInit | undefined; +}; + +export type Awaitable = T | Promise; + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +const DEFAULT_FETCHER: Fetcher = (input, init) => (init == null ? fetch(input) : fetch(input, init)); + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const next = await hook(req); + if (next) { + req = next; + } + } + try { + const res = await this.fetcher(req); + for (const hook of this.responseHooks) { + await hook(res, req); + } + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + throw err; + } + } + + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + addHook(hook: "requestError", fn: RequestErrorHook): this; + addHook(hook: "response", fn: ResponseHook): this; + addHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + if (hook === "beforeRequest") { + this.requestHooks.push(fn as BeforeRequestHook); + } else if (hook === "requestError") { + this.requestErrorHooks.push(fn as RequestErrorHook); + } else if (hook === "response") { + this.responseHooks.push(fn as ResponseHook); + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + return this; + } + + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + removeHook(hook: "requestError", fn: RequestErrorHook): this; + removeHook(hook: "response", fn: ResponseHook): this; + removeHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + let target: unknown[]; + if (hook === "beforeRequest") { + target = this.requestHooks; + } else if (hook === "requestError") { + target = this.requestErrorHooks; + } else if (hook === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + const index = target.findIndex((v) => v === fn); + if (index >= 0) { + target.splice(index, 1); + } + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + return child; + } +} + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(...args: unknown[]): void; +} + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +export interface SDKOptions { + authHeader?: string | (() => Promise) | undefined; + debugLogger?: Logger; + httpClient?: HTTPClient; + retryConfig?: RetryConfig; + serverIdx?: number | undefined; + serverURL?: string | undefined; + timeoutMs?: number; + userAgent?: string | undefined; +} + +export type Security = { + authHeader: string; +}; + +export const ServerList = ["https://api.codat.io"] as const; + +export const SDK_METADATA = { + language: "typescript", + genVersion: "codat-sdk-codegen-poc-0.1.0", + sdkVersion: "3.0.0", + openapiDocVersion: "3.0.0", + userAgent: "codat-sdk/typescript 3.0.0 codat-sdk-codegen-poc-0.1.0 3.0.0 @codat/platform", +} as const; + +export function resolveServerURL(options: SDKOptions = {}): string { + const fromList = ServerList[options.serverIdx ?? 0] ?? ServerList[0]; + return (options.serverURL ?? fromList).replace(/\/+$/, ""); +} + +export function resolveAuthHeader( + authHeader: SDKOptions["authHeader"], +): string | ((name: string) => Promise) | undefined { + if (authHeader == null) { + return undefined; + } + if (typeof authHeader === "function") { + return () => authHeader(); + } + return authHeader; +} + +const DEFAULT_RETRY_CODES = ["408", "429", "5XX"]; + +const DEFAULT_RETRY_CONFIG: RetryConfig = { + strategy: "backoff", + backoff: { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + retryConnectionErrors: true, +}; + +class PermanentError extends Error { + readonly cause: unknown; + constructor(message: string, options?: { cause?: unknown }) { + super(message); + this.name = "PermanentError"; + this.cause = options?.cause; + } +} + +class TemporaryError extends Error { + readonly response: Response; + constructor(message: string, response: Response) { + super(message); + this.name = "TemporaryError"; + this.response = response; + } +} + +function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const msg = err instanceof TypeError ? err.message.toLowerCase() : ""; + const isFetchErr = msg.startsWith("failed to fetch") || msg.startsWith("fetch failed"); + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return isFetchErr || code === "econnreset"; +} + +function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const name = "name" in err ? (err as { name?: unknown }).name : ""; + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return name === "TimeoutError" || code === "econnaborted"; +} + +const codeRangeRE = /^[0-9]xx$/i; + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + return actual.charAt(0) === code.charAt(0); + }); +} + +function retryIntervalFromResponse(res: Response): number { + const retryVal = res.headers.get("retry-after") || ""; + if (!retryVal) { + return 0; + } + const asNumber = Number(retryVal); + if (Number.isInteger(asNumber)) { + return asNumber * 1000; + } + const asDate = Date.parse(retryVal); + if (Number.isInteger(asDate)) { + const deltaMs = asDate - Date.now(); + return deltaMs > 0 ? Math.ceil(deltaMs) : 0; + } + return 0; +} + +function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function wrapFetcher( + fn: () => Promise, + statusCodes: string[], + retryConnectionErrors: boolean, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, statusCodes)) { + throw new TemporaryError("Response failed with retryable status code", res); + } + return res; + } catch (err: unknown) { + if (err instanceof TemporaryError) { + throw err; + } + if (retryConnectionErrors && (isTimeoutError(err) || isConnectionError(err))) { + throw err; + } + throw new PermanentError("Permanent error", { cause: err }); + } + }; +} + +async function retryBackoff(fn: () => Promise, strategy: BackoffStrategy): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + const start = Date.now(); + let x = 0; + for (;;) { + try { + return await fn(); + } catch (err: unknown) { + if (err instanceof PermanentError) { + throw err.cause; + } + if (Date.now() - start > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.response; + } + throw err; + } + let retryInterval = err instanceof TemporaryError ? retryIntervalFromResponse(err.response) : 0; + if (retryInterval <= 0) { + retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + await delay(Math.min(retryInterval, maxInterval)); + x++; + } + } +} + +function retryRequest(fn: () => Promise, config: RetryConfig, statusCodes: string[]): Promise { + if (config.strategy === "backoff") { + return retryBackoff( + wrapFetcher(fn, statusCodes, !!config.retryConnectionErrors), + config.backoff ?? { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + ); + } + return fn(); +} + +export function resolveUserAgent(userAgent: string | undefined): Record { + const agent = userAgent ?? SDK_METADATA.userAgent; + if (!agent) { + return {}; + } + const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + return isBrowser ? {} : { "user-agent": agent }; +} + +function parseURL(input: RequestInfo | URL): URL | null { + try { + return new URL(String(input)); + } catch { + return null; + } +} + +export type SecurityState = { + basic: { username?: string; password?: string }; + headers: Record; + queryParams: Record; + cookies: Record; + oauth2: { type: "none" }; +}; + +function headerValue(headers: HeadersInit | undefined, name: string): string | undefined { + if (!headers) { + return undefined; + } + const lower = name.toLowerCase(); + if (typeof Headers !== "undefined" && headers instanceof Headers) { + return headers.get(name) ?? undefined; + } + if (Array.isArray(headers)) { + const found = headers.find(([k]) => k.toLowerCase() === lower); + return found ? found[1] : undefined; + } + for (const k of Object.keys(headers)) { + if (k.toLowerCase() === lower) { + return (headers as Record)[k]; + } + } + return undefined; +} + +function resolveSecurityState(authValue: string | undefined): SecurityState | null { + if (authValue == null) { + return null; + } + return { + basic: {}, + headers: { Authorization: authValue }, + queryParams: {}, + cookies: {}, + oauth2: { type: "none" }, + }; +} + +export function makeFetch(options: SDKOptions = {}, hooks?: SDKHooks): Fetcher { + const client = options.httpClient; + const logger = options.debugLogger; + return (input, init) => { + const reqInit: RequestInit = init ?? {}; + const stamped = reqInit as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + const operationId = stamped.__codatOperationId; + const config = stamped.__codatRetries ?? options.retryConfig ?? DEFAULT_RETRY_CONFIG; + const retryCodes = stamped.__codatRetryCodes ?? DEFAULT_RETRY_CODES; + for (const key of ["__codatOperationId", "__codatRetries", "__codatRetryCodes"] as const) { + if (key in stamped) { + delete stamped[key]; + } + } + const parsed = parseURL(input); + const ctx: HookContext = { + baseURL: resolveServerURL(options), + operationID: operationId ?? `${(reqInit.method ?? "GET").toUpperCase()} ${parsed ? parsed.pathname : String(input)}`, + oAuth2Scopes: null, + securitySource: options.authHeader, + retryConfig: config, + resolvedSecurity: resolveSecurityState(headerValue(reqInit.headers, "Authorization")), + options, + }; + + let url: RequestInfo | URL = input; + let finalInit: RequestInit = reqInit; + if (hooks && parsed) { + const created = hooks.beforeCreateRequest(ctx, { url: parsed, options: reqInit }); + url = created.url; + finalInit = created.options ?? reqInit; + } + if (!finalInit.signal && options.timeoutMs && options.timeoutMs > 0) { + finalInit = { ...finalInit, signal: AbortSignal.timeout(options.timeoutMs) }; + } + + const dispatch = async (): Promise => { + let request = new Request(url, finalInit); + if (hooks) { + request = await hooks.beforeRequest(ctx, request.clone()); + } + if (logger) { + logger.log(`request: ${request.method} ${request.url}`); + } + let res: Response; + try { + res = client ? await client.request(request) : await fetch(request); + } catch (err) { + if (hooks) { + const handled = await hooks.afterError(ctx, null, err); + if (handled.error) { + throw handled.error; + } + if (handled.response) { + return handled.response; + } + } + throw err; + } + if (logger) { + logger.log(`response: ${res.status}`); + } + if (hooks) { + if (res.status >= 400) { + const handled = await hooks.afterError(ctx, res, null); + if (handled.error) { + throw handled.error; + } + res = handled.response ?? res; + } else { + res = await hooks.afterSuccess(ctx, res); + } + } + return res; + }; + return retryRequest(dispatch, config, retryCodes); + }; +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +export function matchStatusCode(response: Response, codes: StatusCodePredicate): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + return expectedCodes.some((ec) => { + const code = `${ec}`; + if (code === "default") { + return true; + } + if (!codeRangeRE.test(code)) { + return code === actual; + } + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + return actualFamily === expectFamily; + }); +} diff --git a/platform/src/lib/sdks.ts b/platform/src/lib/sdks.ts deleted file mode 100644 index cef4177db..000000000 --- a/platform/src/lib/sdks.ts +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.js"; - -export type RequestOptions = { - /** - * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If - * `fetchOptions.signal` is set then it will take precedence over this option. - */ - timeoutMs?: number; - /** - * Set or override a retry policy on HTTP calls. - */ - retries?: RetryConfig; - /** - * Specifies the status codes which should be retried using the given retry policy. - */ - retryCodes?: string[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - serverURL?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * Sets various request options on the `fetch` call made by an SDK method. - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} - */ - fetchOptions?: Omit; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - timeoutMs?: number; -}; - -const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; -const webWorkerLike = typeof gt === "object" - && gt != null - && "importScripts" in gt - && typeof gt["importScripts"] === "function"; -const isBrowserLike = webWorkerLike - || (typeof navigator !== "undefined" && "serviceWorker" in navigator) - || (typeof window === "object" && typeof window.document !== "undefined"); - -export class ClientSDK { - readonly #httpClient: HTTPClient; - readonly #hooks: SDKHooks; - readonly #logger?: Logger | undefined; - public readonly _baseURL: URL | null; - public readonly _options: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - if ( - typeof opt === "object" - && opt != null - && "hooks" in opt - && opt.hooks instanceof SDKHooks - ) { - this.#hooks = opt.hooks; - } else { - this.#hooks = new SDKHooks(); - } - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - - const { baseURL, client } = this.#hooks.sdkInit({ - baseURL: url, - client: options.httpClient || new HTTPClient(), - }); - this._baseURL = baseURL; - this.#httpClient = client; - - this._options = { ...options, hooks: this.#hooks }; - - this.#logger = this._options.debugLogger; - } - - public _createRequest( - context: HookContext, - conf: RequestConfig, - options?: RequestOptions, - ): Result { - const { method, path, query, headers: opHeaders, security } = conf; - - const base = conf.baseURL ?? this._baseURL; - if (!base) { - return ERR(new InvalidRequestError("No base URL provided for operation")); - } - const baseURL = new URL(base); - let reqURL: URL; - if (path) { - baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; - reqURL = new URL(path, baseURL); - } 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); - } - } - if (secQuery.length) { - finalQuery += `&${secQuery.join("&")}`; - } - - if (finalQuery) { - const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; - reqURL.search = `?${q}`; - } - - const headers = new Headers(opHeaders); - - const username = security?.basic.username; - const password = security?.basic.password; - if (username != null || password != null) { - const encoded = stringToBase64( - [username || "", password || ""].join(":"), - ); - headers.set("Authorization", `Basic ${encoded}`); - } - - const securityHeaders = new Headers(security?.headers || {}); - for (const [k, v] of securityHeaders) { - headers.set(k, v); - } - - let cookie = headers.get("cookie") || ""; - for (const [k, v] of Object.entries(security?.cookies || {})) { - cookie += `; ${k}=${v}`; - } - cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; - headers.set("cookie", cookie); - - const userHeaders = new Headers( - options?.headers ?? options?.fetchOptions?.headers, - ); - for (const [k, v] of userHeaders) { - headers.set(k, v); - } - - // Only set user agent header in non-browser-like environments since CORS - // policy disallows setting it in browsers e.g. Chrome throws an error. - if (!isBrowserLike) { - headers.set( - conf.uaHeader ?? "user-agent", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - const fetchOptions: Omit = { - ...options?.fetchOptions, - ...options, - }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - let input; - try { - input = this.#hooks.beforeCreateRequest(context, { - url: reqURL, - options: { - ...fetchOptions, - body: conf.body ?? null, - headers, - method, - }, - }); - } catch (err: unknown) { - return ERR( - new UnexpectedClientError("Create request hook failed to execute", { - cause: err, - }), - ); - } - - return OK(new Request(input.url, input.options)); - } - - public async _do( - request: Request, - options: { - context: HookContext; - isErrorStatusCode: (statusCode: number) => boolean; - retryConfig: RetryConfig; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, isErrorStatusCode } = options; - - return retry( - async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); - await logRequest(this.#logger, req).catch((e) => - this.#logger?.log("Failed to log request:", e) - ); - - let response = await this.#httpClient.request(req); - - try { - if (isErrorStatusCode(response.status)) { - const result = await this.#hooks.afterError( - context, - response, - null, - ); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this.#hooks.afterSuccess(context, response); - } - } finally { - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.retryCodes }, - ).then( - (r) => OK(r), - (err) => { - switch (true) { - case isAbortError(err): - return ERR( - new RequestAbortedError("Request aborted by client", { - cause: err, - }), - ); - case isTimeoutError(err): - return ERR( - new RequestTimeoutError("Request timed out", { cause: err }), - ); - case isConnectionError(err): - return ERR( - new ConnectionError("Unable to make request", { cause: err }), - ); - default: - return ERR( - new UnexpectedClientError("Unexpected HTTP client error", { - cause: err, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; -const jsonlLikeContentTypeRE = - /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/platform/src/lib/security.ts b/platform/src/lib/security.ts deleted file mode 100644 index 3da8e733b..000000000 --- a/platform/src/lib/security.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as shared from "../sdk/models/shared/index.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - clientID?: string | undefined; - clientSecret?: string | undefined; - tokenURL: string; -}; - -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} - -export class SecurityError extends Error { - constructor( - public code: SecurityErrorCode, - message: string, - ) { - super(message); - this.name = "SecurityError"; - } - - static incomplete(): SecurityError { - return new SecurityError( - SecurityErrorCode.Incomplete, - "Security requirements not met in order to perform the operation", - ); - } - static unrecognizedType(type: string): SecurityError { - return new SecurityError( - SecurityErrorCode.UnrecognisedSecurityType, - `Unrecognised security type: ${type}`, - ); - } -} - -export type SecurityState = { - basic: { username?: string | undefined; password?: string | undefined }; - headers: Record; - queryParams: Record; - cookies: Record; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -type SecurityInputBasic = { - type: "http:basic"; - value: - | { username?: string | undefined; password?: string | undefined } - | null - | undefined; -}; - -type SecurityInputBearer = { - type: "http:bearer"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputAPIKey = { - type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOIDC = { - type: "openIdConnect"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2 = { - type: "oauth2"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2ClientCredentials = { - type: "oauth2:client_credentials"; - value: - | { - clientID?: string | undefined; - clientSecret?: string | undefined; - } - | null - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - const option = options.find((opts) => { - return opts.every((o) => { - if (o.value == null) { - return false; - } else if (o.type === "http:basic") { - return o.value.username != null || o.value.password != null; - } else if (o.type === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - return o.value.clientID != null || o.value.clientSecret != null; - } else if (typeof o.value === "string") { - return !!o.value; - } else { - throw new Error( - `Unrecognized security type: ${o.type} (value type: ${typeof o - .value})`, - ); - } - }); - }); - if (option == null) { - return null; - } - - option.forEach((spec) => { - if (spec.value == null) { - return; - } - - const { type } = spec; - - switch (type) { - case "apiKey:header": - state.headers[spec.fieldName] = spec.value; - break; - case "apiKey:query": - state.queryParams[spec.fieldName] = spec.value; - break; - case "apiKey:cookie": - state.cookies[spec.fieldName] = spec.value; - break; - case "http:basic": - applyBasic(state, spec); - break; - case "http:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - applyBearer(state, spec); - break; - case "oauth2:client_credentials": - break; - case "openIdConnect": - applyBearer(state, spec); - break; - default: - throw SecurityError.unrecognizedType((spec satisfies never, type)); - } - }); - - return state; -} - -function applyBasic( - state: SecurityState, - spec: SecurityInputBasic, -) { - if (spec.value == null) { - return; - } - - state.basic = spec.value; -} - -function applyBearer( - state: SecurityState, - spec: - | SecurityInputBearer - | SecurityInputOAuth2 - | SecurityInputOIDC - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, - allowedFields?: number[], -): SecurityState | null { - let inputs: SecurityInput[][] = [ - [ - { - fieldName: "Authorization", - type: "apiKey:header", - value: security?.authHeader, - }, - ], - ]; - - if (allowedFields) { - inputs = allowedFields.map((i) => { - if (i < 0 || i >= inputs.length) { - throw new RangeError(`invalid allowedFields index ${i}`); - } - return inputs[i]!; - }); - } - - return resolveSecurity(...inputs); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/platform/src/lib/url.ts b/platform/src/lib/url.ts deleted file mode 100644 index 79e7ce660..000000000 --- a/platform/src/lib/url.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const hasOwn = Object.prototype.hasOwnProperty; - -export type Params = Partial>; - -export function pathToFunc( - pathPattern: string, - options?: { charEncoding?: "percent" | "none" }, -): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; - - return function buildURLPath(params: Record = {}): string { - return pathPattern - .replace(paramRE, function (_, placeholder) { - if (!hasOwn.call(params, placeholder)) { - throw new Error(`Parameter '${placeholder}' is required`); - } - - const value = params[placeholder]; - if (typeof value !== "string" && typeof value !== "number") { - throw new Error( - `Parameter '${placeholder}' must be a string or number`, - ); - } - - return options?.charEncoding === "percent" - ? encodeURIComponent(`${value}`) - : `${value}`; - }) - .replace(/^\/+/, ""); - }; -} diff --git a/platform/src/runtime.ts b/platform/src/runtime.ts new file mode 100644 index 000000000..867a66a5e --- /dev/null +++ b/platform/src/runtime.ts @@ -0,0 +1,502 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { SDKError } from './sdk/models/errors/sdkerror'; +import { ErrorMessage } from './sdk/models/errors/errormessage'; +import type { RetryConfig } from './lib/sdkconfig'; + +export const BASE_PATH = "https://api.codat.io".replace(/\/+$/, ""); + +export type RequestOptions = { + timeoutMs?: number; + retries?: RetryConfig; + retryCodes?: string[]; + serverURL?: string | URL; + fetchOptions?: Omit; +} & Omit; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, options?: RequestOptions): Promise { + const { url, init } = await this.createFetchParams(context, options); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw await buildSpeakeasyError(url, init, response, context.errorStatuses); + } + + private async createFetchParams(context: RequestOpts, options?: RequestOptions) { + const opts: RequestOptions = options ?? {}; + const { + timeoutMs, + retries, + retryCodes, + serverURL, + fetchOptions, + headers: perCallHeaders, + ...restInit + } = opts; + + const base = (typeof serverURL === "string" || serverURL instanceof URL) + ? String(serverURL).replace(/\/+$/, "") + : this.configuration.basePath; + let url = base + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers, + toHeaderRecord(fetchOptions?.headers), + toHeaderRecord(perCallHeaders), + ); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + let body: any; + if (isFormData(context.body) + || (context.body instanceof URLSearchParams) + || isBlob(context.body)) { + body = context.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(context.body); + } else { + body = context.body; + } + + const init: RequestInit = { + ...fetchOptions, + ...restInit, + method: context.method, + headers, + body, + }; + if (init.credentials === undefined && this.configuration.credentials !== undefined) { + init.credentials = this.configuration.credentials; + } + if (!init.signal && timeoutMs && timeoutMs > 0) { + init.signal = AbortSignal.timeout(timeoutMs); + } + + const stamped = init as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + if (context.operationId !== undefined) { + stamped.__codatOperationId = context.operationId; + } + if (retries !== undefined) { + stamped.__codatRetries = retries; + } + if (retryCodes !== undefined) { + stamped.__codatRetryCodes = retryCodes; + } + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +function toHeaderRecord(headers: HeadersInit | undefined): HTTPHeaders { + if (!headers) { + return {}; + } + if (typeof Headers !== "undefined" && headers instanceof Headers) { + const out: HTTPHeaders = {}; + headers.forEach((value, key) => { out[key] = value; }); + return out; + } + if (Array.isArray(headers)) { + const out: HTTPHeaders = {}; + for (const [key, value] of headers) { + out[key] = value; + } + return out; + } + return { ...(headers as Record) }; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +async function buildSpeakeasyError(url: string, init: RequestInit, response: Response, errorStatuses?: number[]): Promise { + const httpResponse = response ?? new Response(null, { status: 500 }); + const body = response ? await response.clone().text() : ""; + const httpMeta = { response: httpResponse, request: new Request(url, { method: init.method }), body }; + let data: any; + try { + data = body ? JSON.parse(body) : undefined; + } catch { + data = undefined; + } + const documentsThisStatus = Array.isArray(errorStatuses) && errorStatuses.indexOf(httpResponse.status) !== -1; + if (documentsThisStatus && data && typeof data === "object" && !Array.isArray(data)) { + return new ErrorMessage(data, httpMeta); + } + return new SDKError("Response returned an error code", httpMeta); +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + operationId?: string; + errorStatuses?: number[]; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/platform/src/sdk.ts b/platform/src/sdk.ts new file mode 100644 index 000000000..46687655e --- /dev/null +++ b/platform/src/sdk.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Configuration, ConfigurationParameters } from './runtime'; +import type * as shared from './sdk/models/index'; +import { SDKOptions, resolveServerURL, resolveAuthHeader, resolveUserAgent, makeFetch, HTTPClient } from './lib/sdkconfig'; +import { SDKHooks } from './hooks/hooks'; +import { validateWebhook as runValidateWebhook } from './funcs/validateWebhook'; +import { + Companies, + ConnectionManagement, + Connections, + Cors, + CustomDataType, + Integrations, + PushData, + ReadData, + RefreshData, + Settings, + SupplementalData, + Webhooks, +} from './apis/index'; + +export class CodatPlatform { + private readonly _config: Configuration; + + constructor(options: SDKOptions | ConfigurationParameters | Configuration = {}) { + if (options instanceof Configuration) { + this._config = options; + return; + } + const opts = options as SDKOptions & ConfigurationParameters; + const hooks = new SDKHooks(); + const baseURL = opts.basePath ?? resolveServerURL(opts); + let parsedBaseURL: URL | null = null; + try { parsedBaseURL = new URL(baseURL); } catch { parsedBaseURL = null; } + const init = hooks.sdkInit({ baseURL: parsedBaseURL, client: opts.httpClient ?? new HTTPClient() }); + const resolvedBaseURL = init.baseURL ? init.baseURL.toString().replace(/\/+$/, '') : baseURL; + this._config = new Configuration({ + ...opts, + basePath: resolvedBaseURL, + apiKey: opts.apiKey ?? resolveAuthHeader(opts.authHeader), + fetchApi: opts.fetchApi ?? makeFetch({ ...opts, httpClient: init.client }, hooks), + headers: { ...(opts.headers ?? {}), ...resolveUserAgent(opts.userAgent) }, + }); + } + + private _cors?: Cors; + get cors(): Cors { + if (!this._cors) { this._cors = new Cors(this._config); } + return this._cors; + } + + private _companies?: Companies; + get companies(): Companies { + if (!this._companies) { this._companies = new Companies(this._config); } + return this._companies; + } + + private _connectionManagement?: ConnectionManagement; + get connectionManagement(): ConnectionManagement { + if (!this._connectionManagement) { this._connectionManagement = new ConnectionManagement(this._config); } + return this._connectionManagement; + } + + private _connections?: Connections; + get connections(): Connections { + if (!this._connections) { this._connections = new Connections(this._config); } + return this._connections; + } + + private _customDataType?: CustomDataType; + get customDataType(): CustomDataType { + if (!this._customDataType) { this._customDataType = new CustomDataType(this._config); } + return this._customDataType; + } + + private _integrations?: Integrations; + get integrations(): Integrations { + if (!this._integrations) { this._integrations = new Integrations(this._config); } + return this._integrations; + } + + private _pushData?: PushData; + get pushData(): PushData { + if (!this._pushData) { this._pushData = new PushData(this._config); } + return this._pushData; + } + + private _readData?: ReadData; + get readData(): ReadData { + if (!this._readData) { this._readData = new ReadData(this._config); } + return this._readData; + } + + private _refreshData?: RefreshData; + get refreshData(): RefreshData { + if (!this._refreshData) { this._refreshData = new RefreshData(this._config); } + return this._refreshData; + } + + private _settings?: Settings; + get settings(): Settings { + if (!this._settings) { this._settings = new Settings(this._config); } + return this._settings; + } + + private _supplementalData?: SupplementalData; + get supplementalData(): SupplementalData { + if (!this._supplementalData) { this._supplementalData = new SupplementalData(this._config); } + return this._supplementalData; + } + + private _webhooks?: Webhooks; + get webhooks(): Webhooks { + if (!this._webhooks) { this._webhooks = new Webhooks(this._config); } + return this._webhooks; + } + + async validateWebhook(args: { request: { body: string; headers: Record | Headers; url: string; method: string; } | Request; }): Promise { + const outcome = await runValidateWebhook(this as never, { request: args.request }); + if (!outcome.ok) { throw outcome.error; } + return outcome.value; + } +} diff --git a/platform/src/sdk/companies.ts b/platform/src/sdk/companies.ts index e42a57991..4b89b1e24 100644 --- a/platform/src/sdk/companies.ts +++ b/platform/src/sdk/companies.ts @@ -1,274 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companiesAddProduct } from "../funcs/companiesAddProduct.js"; -import { companiesCreate } from "../funcs/companiesCreate.js"; -import { companiesDelete } from "../funcs/companiesDelete.js"; -import { companiesGet } from "../funcs/companiesGet.js"; -import { companiesGetAccessToken } from "../funcs/companiesGetAccessToken.js"; -import { companiesGetCompanySyncSettings } from "../funcs/companiesGetCompanySyncSettings.js"; -import { companiesList } from "../funcs/companiesList.js"; -import { companiesRefreshProductData } from "../funcs/companiesRefreshProductData.js"; -import { companiesRemoveProduct } from "../funcs/companiesRemoveProduct.js"; -import { companiesReplace } from "../funcs/companiesReplace.js"; -import { companiesSetCompanySyncSettings } from "../funcs/companiesSetCompanySyncSettings.js"; -import { companiesUpdate } from "../funcs/companiesUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Companies extends ClientSDK { - /** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ - async list( - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesList( - this, - request, - options, - )); - } - - /** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ - async create( - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesCreate( - this, - request, - options, - )); - } - - /** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async get( - request: operations.GetCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGet( - this, - request, - options, - )); - } - - /** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async delete( - request: operations.DeleteCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesDelete( - this, - request, - options, - )); - } - - /** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - */ - async replace( - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesReplace( - this, - request, - options, - )); - } - - /** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. - */ - async update( - request: operations.UpdateCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesUpdate( - this, - request, - options, - )); - } - - /** - * Add product - * - * @remarks - * Use the *Add product* endpoint to enable a product for the company specified by `companyId`. - * - * > Note: This feature is currently in alpha and available only to participants in the development program. - */ - async addProduct( - request: operations.AddProductRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesAddProduct( - this, - request, - options, - )); - } - - /** - * Remove product - * - * @remarks - * Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. - * - * > Note: This feature is currently in alpha and available only to participants in the development program. - */ - async removeProduct( - request: operations.RemoveProductRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesRemoveProduct( - this, - request, - options, - )); - } - - /** - * Refresh product data - * - * @remarks - * Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. - * - * ### Tips and traps - * - * - This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead. - * - If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. - * - If a company has multiple custom products enabled, you can refresh data for each product individually. - * - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual. - * - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options. - */ - async refreshProductData( - request: operations.RefreshProductDataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesRefreshProductData( - this, - request, - options, - )); - } - - /** - * Get company access token - * - * @remarks - * Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. - * - * The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. - */ - async getAccessToken( - request: operations.GetCompanyAccessTokenRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGetAccessToken( - this, - request, - options, - )); - } - - /** - * Get company sync settings - * - * @remarks - * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for a specific company. This includes how often data types should be queued to be updated, and how much history should be fetched. - */ - async getCompanySyncSettings( - request: operations.GetCompanySyncSettingsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGetCompanySyncSettings( - this, - request, - options, - )); - } - - /** - * Set company sync settings - * - * @remarks - * Set the sync settings for a specific company. - */ - async setCompanySyncSettings( - request: operations.SetCompanySyncSettingsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesSetCompanySyncSettings( - this, - request, - options, - )); - } -} +export { Companies } from "../apis/Companies"; diff --git a/platform/src/sdk/connectionmanagement.ts b/platform/src/sdk/connectionmanagement.ts index c1537290b..f7ec79bce 100644 --- a/platform/src/sdk/connectionmanagement.ts +++ b/platform/src/sdk/connectionmanagement.ts @@ -1,33 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { connectionManagementGet } from "../funcs/connectionManagementGet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class ConnectionManagement extends ClientSDK { - /** - * Get access token (old) - * - * @remarks - * The new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. - * - * @deprecated method: The endpoint for generating company-specific connection management access tokens has been deprecated. - Codat now supports a global company access token, providing seamless access across multiple products. - Update your integration to use the global token for improved efficiency and consistency. - . Use getAccessToken instead. - */ - async get( - request: operations.GetConnectionManagementAccessTokenRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionManagementGet( - this, - request, - options, - )); - } -} +export { ConnectionManagement } from "../apis/ConnectionManagement"; diff --git a/platform/src/sdk/connections.ts b/platform/src/sdk/connections.ts index 75de8c36f..9abd92e59 100644 --- a/platform/src/sdk/connections.ts +++ b/platform/src/sdk/connections.ts @@ -1,121 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { connectionsCreate } from "../funcs/connectionsCreate.js"; -import { connectionsDelete } from "../funcs/connectionsDelete.js"; -import { connectionsGet } from "../funcs/connectionsGet.js"; -import { connectionsList } from "../funcs/connectionsList.js"; -import { connectionsUnlink } from "../funcs/connectionsUnlink.js"; -import { connectionsUpdateAuthorization } from "../funcs/connectionsUpdateAuthorization.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Connections extends ClientSDK { - /** - * List connections - * - * @remarks - * List the connections for a company. - */ - async list( - request: operations.ListConnectionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsList( - this, - request, - options, - )); - } - - /** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ - async create( - request: operations.CreateConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsCreate( - this, - request, - options, - )); - } - - /** - * Get connection - * - * @remarks - * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - */ - async get( - request: operations.GetConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsGet( - this, - request, - options, - )); - } - - /** - * Delete connection - * - * @remarks - * Revoke and remove a connection from a company. - * This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - */ - async delete( - request: operations.DeleteConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsDelete( - this, - request, - options, - )); - } - - /** - * Unlink connection - * - * @remarks - * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - */ - async unlink( - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsUnlink( - this, - request, - options, - )); - } - - /** - * Update authorization - * - * @remarks - * Update data connection's authorization. - */ - async updateAuthorization( - request: operations.UpdateConnectionAuthorizationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsUpdateAuthorization( - this, - request, - options, - )); - } -} +export { Connections } from "../apis/Connections"; diff --git a/platform/src/sdk/cors.ts b/platform/src/sdk/cors.ts index c8b6f4735..bcba1ec1f 100644 --- a/platform/src/sdk/cors.ts +++ b/platform/src/sdk/cors.ts @@ -1,55 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { corsGet } from "../funcs/corsGet.js"; -import { corsSet } from "../funcs/corsSet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Cors extends ClientSDK { - /** - * Get CORS settings (old) - * - * @remarks - * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - * - * @deprecated method: The new [Get CORS settings](https://docs.codat.io/platform-api#/operations/get-cors-settings) endpoint replaces this endpoint and includes additional functionality. - Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. - . Use get instead. - */ - async get( - options?: RequestOptions, - ): Promise { - return unwrapAsync(corsGet( - this, - options, - )); - } - - /** - * Set CORS settings (old) - * - * @remarks - * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - * - * @deprecated method: The new [Set CORS settings](https://docs.codat.io/platform-api#/operations/set-cors-settings) endpoint replaces this endpoint and includes additional functionality. - Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. - . Use set instead. - */ - async set( - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(corsSet( - this, - request, - options, - )); - } -} +export { Cors } from "../apis/Cors"; diff --git a/platform/src/sdk/customdatatype.ts b/platform/src/sdk/customdatatype.ts index da886b984..a668862af 100644 --- a/platform/src/sdk/customdatatype.ts +++ b/platform/src/sdk/customdatatype.ts @@ -1,96 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { customDataTypeConfigure } from "../funcs/customDataTypeConfigure.js"; -import { customDataTypeGetConfiguration } from "../funcs/customDataTypeGetConfiguration.js"; -import { customDataTypeList } from "../funcs/customDataTypeList.js"; -import { customDataTypeRefresh } from "../funcs/customDataTypeRefresh.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CustomDataType extends ClientSDK { - /** - * Configure custom data type - * - * @remarks - * The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - * - * ### Tips and traps - * - * - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - * - * - You can only indicate a single data source for each customer data type. - * - * - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. - */ - async configure( - request: operations.ConfigureCustomDataTypeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customDataTypeConfigure( - this, - request, - options, - )); - } - - /** - * Get custom data configuration - * - * @remarks - * The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. - */ - async getConfiguration( - request: operations.GetCustomDataTypeConfigurationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customDataTypeGetConfiguration( - this, - request, - options, - )); - } - - /** - * Refresh custom data type - * - * @remarks - * The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. - */ - async refresh( - request: operations.RefreshCustomDataTypeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customDataTypeRefresh( - this, - request, - options, - )); - } - - /** - * List custom data type records - * - * @remarks - * The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. - * - * A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) - */ - async list( - request: operations.ListCustomDataTypeRecordsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customDataTypeList( - this, - request, - options, - )); - } -} +export { CustomDataType } from "../apis/CustomDataType"; diff --git a/platform/src/sdk/index.ts b/platform/src/sdk/index.ts index ecac22648..d28eeda9d 100644 --- a/platform/src/sdk/index.ts +++ b/platform/src/sdk/index.ts @@ -1,5 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; +export * from "./sdk"; diff --git a/platform/src/sdk/integrations.ts b/platform/src/sdk/integrations.ts index ebfab9c5a..8422984a5 100644 --- a/platform/src/sdk/integrations.ts +++ b/platform/src/sdk/integrations.ts @@ -1,64 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { integrationsGet } from "../funcs/integrationsGet.js"; -import { integrationsGetBranding } from "../funcs/integrationsGetBranding.js"; -import { integrationsList } from "../funcs/integrationsList.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Integrations extends ClientSDK { - /** - * List integrations - * - * @remarks - * List your available integrations - */ - async list( - request?: operations.ListIntegrationsRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(integrationsList( - this, - request, - options, - )); - } - - /** - * Get integration - * - * @remarks - * Get single integration, by platformKey - */ - async get( - request: operations.GetIntegrationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(integrationsGet( - this, - request, - options, - )); - } - - /** - * Get branding - * - * @remarks - * Get branding for platform. - */ - async getBranding( - request: operations.GetIntegrationsBrandingRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(integrationsGetBranding( - this, - request, - options, - )); - } -} +export { Integrations } from "../apis/Integrations"; diff --git a/platform/src/sdk/models/AccessToken.ts b/platform/src/sdk/models/AccessToken.ts new file mode 100644 index 000000000..167fa15c5 --- /dev/null +++ b/platform/src/sdk/models/AccessToken.ts @@ -0,0 +1,210 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface AccessToken + */ +export interface AccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +/** + * Check if a given object implements the AccessToken interface. + */ +export function instanceOfAccessToken(value: object): value is AccessToken { + if (!('expiresIn' in value) || value['expiresIn'] === undefined) return false; + if (!('accessToken' in value) || value['accessToken'] === undefined) return false; + if (!('tokenType' in value) || value['tokenType'] === undefined) return false; + return true; +} + +export function AccessTokenFromJSON(json: any): AccessToken { + return AccessTokenFromJSONTyped(json, false); +} + +export function AccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccessToken { + if (json == null) { + return json; + } + return { + + 'expiresIn': json['expiresIn'], + 'accessToken': json['accessToken'], + 'tokenType': json['tokenType'], + }; +} + +export function AccessTokenToJSON(json: any): AccessToken { + return AccessTokenToJSONTyped(json, false); +} + +export function AccessTokenToJSONTyped(value?: AccessToken | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'expiresIn': value['expiresIn'], + 'accessToken': value['accessToken'], + 'tokenType': value['tokenType'], + }; +} + + +export interface CompanyAccessTokenAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface CompanyAccessTokenGetResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface ConnectionManagementAccessTokenAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface ConnectionManagementAccessTokenGetResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface GetCompanyAccessTokenResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} + +export interface GetConnectionManagementAccessTokenResponseAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof AccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof AccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof AccessToken + */ + tokenType: string; +} diff --git a/platform/src/sdk/models/CompanyProductWebhook.ts b/platform/src/sdk/models/CompanyProductWebhook.ts new file mode 100644 index 000000000..ffcf470fd --- /dev/null +++ b/platform/src/sdk/models/CompanyProductWebhook.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { CompanyProductWebhookPayload } from './CompanyProductWebhookPayload'; +import { + CompanyProductWebhookPayloadFromJSON, + CompanyProductWebhookPayloadFromJSONTyped, + CompanyProductWebhookPayloadToJSON, + CompanyProductWebhookPayloadToJSONTyped, +} from './CompanyProductWebhookPayload'; + +/** + * + * @export + * @interface CompanyProductWebhook + */ +export interface CompanyProductWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof CompanyProductWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof CompanyProductWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyProductWebhook + */ + generatedDate?: string; + /** + * + * @type {CompanyProductWebhookPayload} + * @memberof CompanyProductWebhook + */ + payload?: CompanyProductWebhookPayload; +} + +/** + * Check if a given object implements the CompanyProductWebhook interface. + */ +export function instanceOfCompanyProductWebhook(value: object): value is CompanyProductWebhook { + return true; +} + +export function CompanyProductWebhookFromJSON(json: any): CompanyProductWebhook { + return CompanyProductWebhookFromJSONTyped(json, false); +} + +export function CompanyProductWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyProductWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : CompanyProductWebhookPayloadFromJSON(json['payload']), + }; +} + +export function CompanyProductWebhookToJSON(json: any): CompanyProductWebhook { + return CompanyProductWebhookToJSONTyped(json, false); +} + +export function CompanyProductWebhookToJSONTyped(value?: CompanyProductWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': CompanyProductWebhookPayloadToJSON(value['payload']), + }; +} + diff --git a/platform/src/sdk/models/CompanyProductWebhookPayload.ts b/platform/src/sdk/models/CompanyProductWebhookPayload.ts new file mode 100644 index 000000000..8c6ea5b11 --- /dev/null +++ b/platform/src/sdk/models/CompanyProductWebhookPayload.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface CompanyProductWebhookPayload + */ +export interface CompanyProductWebhookPayload { + /** + * Unique identifier of the company the product change applies to. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + id?: string; + /** + * Name of the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + description?: string; + /** + * Unique identifier of the product that was added to or removed from the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + productId?: string; + /** + * Name of the product that was added to or removed from the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + productName?: string; + /** + * The full list of products currently enabled for the company. + * @type {Array} + * @memberof CompanyProductWebhookPayload + */ + products?: Array; +} + +/** + * Check if a given object implements the CompanyProductWebhookPayload interface. + */ +export function instanceOfCompanyProductWebhookPayload(value: object): value is CompanyProductWebhookPayload { + return true; +} + +export function CompanyProductWebhookPayloadFromJSON(json: any): CompanyProductWebhookPayload { + return CompanyProductWebhookPayloadFromJSONTyped(json, false); +} + +export function CompanyProductWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyProductWebhookPayload { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'productId': json['productId'] == null ? undefined : json['productId'], + 'productName': json['productName'] == null ? undefined : json['productName'], + 'products': json['products'] == null ? undefined : json['products'], + }; +} + +export function CompanyProductWebhookPayloadToJSON(json: any): CompanyProductWebhookPayload { + return CompanyProductWebhookPayloadToJSONTyped(json, false); +} + +export function CompanyProductWebhookPayloadToJSONTyped(value?: CompanyProductWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'productId': value['productId'], + 'productName': value['productName'], + 'products': value['products'], + }; +} + + +export interface CompanyProductWebhookCompanyProductWebhookPayload { + /** + * Unique identifier of the company the product change applies to. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + id?: string; + /** + * Name of the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + description?: string; + /** + * Unique identifier of the product that was added to or removed from the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + productId?: string; + /** + * Name of the product that was added to or removed from the company. + * @type {string} + * @memberof CompanyProductWebhookPayload + */ + productName?: string; + /** + * The full list of products currently enabled for the company. + * @type {Array} + * @memberof CompanyProductWebhookPayload + */ + products?: Array; +} diff --git a/platform/src/sdk/models/CreateApiKeyRequest.ts b/platform/src/sdk/models/CreateApiKeyRequest.ts new file mode 100644 index 000000000..603fdb4f0 --- /dev/null +++ b/platform/src/sdk/models/CreateApiKeyRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { CreateApiKey } from './shared/createapikey'; +/* eslint-disable */ + +export interface CreateApiKeyRequest { + createApiKey?: CreateApiKey | undefined; +} diff --git a/platform/src/sdk/models/CreateCompanyRequest.ts b/platform/src/sdk/models/CreateCompanyRequest.ts new file mode 100644 index 000000000..ec06f2e2e --- /dev/null +++ b/platform/src/sdk/models/CreateCompanyRequest.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ + +import type { CompanyRequestBody } from './shared/companyrequestbody'; +/* eslint-disable */ + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} + +export interface CompanyRequestBodyCreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} diff --git a/platform/src/sdk/models/CreateWebhookConsumerRequest.ts b/platform/src/sdk/models/CreateWebhookConsumerRequest.ts new file mode 100644 index 000000000..32a3e7ba6 --- /dev/null +++ b/platform/src/sdk/models/CreateWebhookConsumerRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { WebhookConsumerPrototype } from './shared/webhookconsumerprototype'; +/* eslint-disable */ + +export interface CreateWebhookConsumerRequest { + webhookConsumerPrototype?: WebhookConsumerPrototype | undefined; +} diff --git a/platform/src/sdk/models/DataType.ts b/platform/src/sdk/models/DataType.ts new file mode 100644 index 000000000..dfc083219 --- /dev/null +++ b/platform/src/sdk/models/DataType.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ + +import type { Company } from './shared/company'; +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Available data types + * @export + */ +export const DataType = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type DataType = typeof DataType[keyof typeof DataType]; + + +export function instanceOfDataType(value: any): boolean { + for (const key in DataType) { + if (Object.prototype.hasOwnProperty.call(DataType, key)) { + if (DataType[key as keyof typeof DataType] === value) { + return true; + } + } + } + return false; +} + +export function DataTypeFromJSON(json: any): DataType { + return DataTypeFromJSONTyped(json, false); +} + +export function DataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataType { + return json as DataType; +} + +export function DataTypeToJSON(value?: DataType | null): any { + return value as any; +} + +export function DataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DataType { + return value as DataType; +} + diff --git a/platform/src/sdk/models/ErrorMessage.ts b/platform/src/sdk/models/ErrorMessage.ts new file mode 100644 index 000000000..2f7a8e321 --- /dev/null +++ b/platform/src/sdk/models/ErrorMessage.ts @@ -0,0 +1,346 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { ErrorValidation } from './shared/errorvalidation'; +import { + ErrorValidationFromJSON, + ErrorValidationFromJSONTyped, + ErrorValidationToJSON, + ErrorValidationToJSONTyped, +} from './shared/errorvalidation'; + +/** + * + * @export + * @interface ErrorMessage + */ +export interface ErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +/** + * Check if a given object implements the ErrorMessage interface. + */ +export function instanceOfErrorMessage(value: object): value is ErrorMessage { + return true; +} + +export function ErrorMessageFromJSON(json: any): ErrorMessage { + return ErrorMessageFromJSONTyped(json, false); +} + +export function ErrorMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorMessage { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'service': json['service'] == null ? undefined : json['service'], + 'error': json['error'] == null ? undefined : json['error'], + 'correlationId': json['correlationId'] == null ? undefined : json['correlationId'], + 'validation': json['validation'] == null ? undefined : ErrorValidationFromJSON(json['validation']), + 'canBeRetried': json['canBeRetried'] == null ? undefined : json['canBeRetried'], + 'detailedErrorCode': json['detailedErrorCode'] == null ? undefined : json['detailedErrorCode'], + }; +} + +export function ErrorMessageToJSON(json: any): ErrorMessage { + return ErrorMessageToJSONTyped(json, false); +} + +export function ErrorMessageToJSONTyped(value?: ErrorMessage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'service': value['service'], + 'error': value['error'], + 'correlationId': value['correlationId'], + 'validation': ErrorValidationToJSON(value['validation']), + 'canBeRetried': value['canBeRetried'], + 'detailedErrorCode': value['detailedErrorCode'], + }; +} + + +export interface ApiKeyCreateResponseErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +export interface CreateApiKeyResponseErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +export interface ErrorMessageData { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +export interface ProductDataRefreshResponseErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +export interface RefreshProductDataResponseErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} diff --git a/platform/src/sdk/models/PagingInfo.ts b/platform/src/sdk/models/PagingInfo.ts new file mode 100644 index 000000000..34556f4ab --- /dev/null +++ b/platform/src/sdk/models/PagingInfo.ts @@ -0,0 +1,965 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface PagingInfo + */ +export interface PagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +/** + * Check if a given object implements the PagingInfo interface. + */ +export function instanceOfPagingInfo(value: object): value is PagingInfo { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PagingInfoFromJSON(json: any): PagingInfo { + return PagingInfoFromJSONTyped(json, false); +} + +export function PagingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PagingInfo { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + }; +} + +export function PagingInfoToJSON(json: any): PagingInfo { + return PagingInfoToJSONTyped(json, false); +} + +export function PagingInfoToJSONTyped(value?: PagingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + }; +} + + +export interface CompaniesListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompanyPushHistoryGetResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompanyPushHistoryGetResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface GetCompanyPushHistoryResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface GetCompanyPushHistoryResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface IntegrationsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface IntegrationsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface IntegrationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface IntegrationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListIntegrationsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListIntegrationsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPullOperationsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPullOperationsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PagingInfoPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} diff --git a/platform/src/sdk/models/SetConnectionManagementCorsSettingsRequest.ts b/platform/src/sdk/models/SetConnectionManagementCorsSettingsRequest.ts new file mode 100644 index 000000000..fb8c2fe4e --- /dev/null +++ b/platform/src/sdk/models/SetConnectionManagementCorsSettingsRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { ConnectionManagementAllowedOrigins } from './shared/connectionmanagementallowedorigins'; +/* eslint-disable */ + +export interface SetConnectionManagementCorsSettingsRequest { + connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins | undefined; +} diff --git a/platform/src/sdk/models/SetCorsSettingsRequest.ts b/platform/src/sdk/models/SetCorsSettingsRequest.ts new file mode 100644 index 000000000..0512d4c94 --- /dev/null +++ b/platform/src/sdk/models/SetCorsSettingsRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { ConnectionManagementAllowedOrigins } from './shared/connectionmanagementallowedorigins'; +/* eslint-disable */ + +export interface SetCorsSettingsRequest { + connectionManagementAllowedOrigins?: ConnectionManagementAllowedOrigins | undefined; +} diff --git a/platform/src/sdk/models/UpdateProfileRequest.ts b/platform/src/sdk/models/UpdateProfileRequest.ts new file mode 100644 index 000000000..5a179be45 --- /dev/null +++ b/platform/src/sdk/models/UpdateProfileRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { Profile } from './shared/profile'; +/* eslint-disable */ + +export interface UpdateProfileRequest { + profile?: Profile | undefined; +} diff --git a/platform/src/sdk/models/UpdateProfileSyncSettingsRequest.ts b/platform/src/sdk/models/UpdateProfileSyncSettingsRequest.ts new file mode 100644 index 000000000..5d927a6f5 --- /dev/null +++ b/platform/src/sdk/models/UpdateProfileSyncSettingsRequest.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ + +import type { UpdateProfileSyncSettingsRequestBody } from './operations/updateprofilesyncsettings'; +/* eslint-disable */ + +export interface UpdateProfileSyncSettingsRequest { + requestBody?: UpdateProfileSyncSettingsRequestBody | undefined; +} diff --git a/platform/src/sdk/models/WebhookZapierKey.ts b/platform/src/sdk/models/WebhookZapierKey.ts new file mode 100644 index 000000000..8909d6179 --- /dev/null +++ b/platform/src/sdk/models/WebhookZapierKey.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface WebhookZapierKey + */ +export interface WebhookZapierKey { + /** + * Integration key used to authorize Zapier's HTTP requests with Codat. + * @type {string} + * @memberof WebhookZapierKey + */ + key?: string; +} + +/** + * Check if a given object implements the WebhookZapierKey interface. + */ +export function instanceOfWebhookZapierKey(value: object): value is WebhookZapierKey { + return true; +} + +export function WebhookZapierKeyFromJSON(json: any): WebhookZapierKey { + return WebhookZapierKeyFromJSONTyped(json, false); +} + +export function WebhookZapierKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookZapierKey { + if (json == null) { + return json; + } + return { + + 'key': json['key'] == null ? undefined : json['key'], + }; +} + +export function WebhookZapierKeyToJSON(json: any): WebhookZapierKey { + return WebhookZapierKeyToJSONTyped(json, false); +} + +export function WebhookZapierKeyToJSONTyped(value?: WebhookZapierKey | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'key': value['key'], + }; +} + + +export interface RotateZapierKeyResponseWebhookZapierKey { + /** + * Integration key used to authorize Zapier's HTTP requests with Codat. + * @type {string} + * @memberof WebhookZapierKey + */ + key?: string; +} + +export interface RotateZapierKeyResponseZapierIntegrationKey { + /** + * Integration key used to authorize Zapier's HTTP requests with Codat. + * @type {string} + * @memberof WebhookZapierKey + */ + key?: string; +} + +export interface WebhookZapierKeyZapierIntegrationKey { + /** + * Integration key used to authorize Zapier's HTTP requests with Codat. + * @type {string} + * @memberof WebhookZapierKey + */ + key?: string; +} + +export interface ZapierIntegrationKey { + /** + * Integration key used to authorize Zapier's HTTP requests with Codat. + * @type {string} + * @memberof WebhookZapierKey + */ + key?: string; +} diff --git a/platform/src/sdk/models/_speakeasy_enums.ts b/platform/src/sdk/models/_speakeasy_enums.ts new file mode 100644 index 000000000..5780145d7 --- /dev/null +++ b/platform/src/sdk/models/_speakeasy_enums.ts @@ -0,0 +1,5300 @@ +/* tslint:disable */ +/* eslint-disable */ + +export const CompaniesDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionStatus = (typeof CompaniesDataConnectionStatus)[keyof typeof CompaniesDataConnectionStatus]; +export const CompaniesDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionsDataConnectionStatus = (typeof CompaniesDataConnectionsDataConnectionStatus)[keyof typeof CompaniesDataConnectionsDataConnectionStatus]; +export const CompaniesDataConnectionsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionsSourceType = (typeof CompaniesDataConnectionsSourceType)[keyof typeof CompaniesDataConnectionsSourceType]; +export const CompaniesErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesErrorStatus = (typeof CompaniesErrorStatus)[keyof typeof CompaniesErrorStatus]; +export const CompaniesSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesSourceType = (typeof CompaniesSourceType)[keyof typeof CompaniesSourceType]; +export const CompaniesStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesStatusDataConnectionStatus = (typeof CompaniesStatusDataConnectionStatus)[keyof typeof CompaniesStatusDataConnectionStatus]; +export const CompaniesStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesStatusErrorStatus = (typeof CompaniesStatusErrorStatus)[keyof typeof CompaniesStatusErrorStatus]; +export const CompanyDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionStatus = (typeof CompanyDataConnectionStatus)[keyof typeof CompanyDataConnectionStatus]; +export const CompanyDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionsDataConnectionStatus = (typeof CompanyDataConnectionsDataConnectionStatus)[keyof typeof CompanyDataConnectionsDataConnectionStatus]; +export const CompanyDataConnectionsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionsSourceType = (typeof CompanyDataConnectionsSourceType)[keyof typeof CompanyDataConnectionsSourceType]; +export const CompanyErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyErrorStatus = (typeof CompanyErrorStatus)[keyof typeof CompanyErrorStatus]; +export const CompanySourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanySourceType = (typeof CompanySourceType)[keyof typeof CompanySourceType]; +export const CompanyStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyStatusDataConnectionStatus = (typeof CompanyStatusDataConnectionStatus)[keyof typeof CompanyStatusDataConnectionStatus]; +export const CompanyStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyStatusErrorStatus = (typeof CompanyStatusErrorStatus)[keyof typeof CompanyStatusErrorStatus]; +export const CompanySyncSettingsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CompanySyncSettingsDataTypeDataTypes = (typeof CompanySyncSettingsDataTypeDataTypes)[keyof typeof CompanySyncSettingsDataTypeDataTypes]; +export const CompanySyncSettingsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CompanySyncSettingsDataTypes = (typeof CompanySyncSettingsDataTypes)[keyof typeof CompanySyncSettingsDataTypes]; +export const ConfigureSupplementalDataPathParamDataType = { + Bills: "bills", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + Invoices: "invoices", + Items: "items", + JournalEntries: "journalEntries", + Suppliers: "suppliers", + TaxRates: "taxRates", +} as const; +export type ConfigureSupplementalDataPathParamDataType = (typeof ConfigureSupplementalDataPathParamDataType)[keyof typeof ConfigureSupplementalDataPathParamDataType]; +export const ConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionDataConnectionStatus = (typeof ConnectionDataConnectionStatus)[keyof typeof ConnectionDataConnectionStatus]; +export const ConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionErrorStatus = (typeof ConnectionErrorStatus)[keyof typeof ConnectionErrorStatus]; +export const ConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceType = (typeof ConnectionSourceType)[keyof typeof ConnectionSourceType]; +export const ConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionStatusDataConnectionStatus = (typeof ConnectionStatusDataConnectionStatus)[keyof typeof ConnectionStatusDataConnectionStatus]; +export const ConnectionStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionStatusErrorStatus = (typeof ConnectionStatusErrorStatus)[keyof typeof ConnectionStatusErrorStatus]; +export const ConnectionWebhookConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookConnectionDataConnectionStatus = (typeof ConnectionWebhookConnectionDataConnectionStatus)[keyof typeof ConnectionWebhookConnectionDataConnectionStatus]; +export const ConnectionWebhookConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionWebhookConnectionSourceType = (typeof ConnectionWebhookConnectionSourceType)[keyof typeof ConnectionWebhookConnectionSourceType]; +export const ConnectionWebhookDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookDataConnectionStatus = (typeof ConnectionWebhookDataConnectionStatus)[keyof typeof ConnectionWebhookDataConnectionStatus]; +export const ConnectionWebhookErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionWebhookErrorStatus = (typeof ConnectionWebhookErrorStatus)[keyof typeof ConnectionWebhookErrorStatus]; +export const ConnectionWebhookPayloadConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookPayloadConnectionDataConnectionStatus = (typeof ConnectionWebhookPayloadConnectionDataConnectionStatus)[keyof typeof ConnectionWebhookPayloadConnectionDataConnectionStatus]; +export const ConnectionWebhookPayloadConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionWebhookPayloadConnectionSourceType = (typeof ConnectionWebhookPayloadConnectionSourceType)[keyof typeof ConnectionWebhookPayloadConnectionSourceType]; +export const ConnectionWebhookPayloadDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookPayloadDataConnectionStatus = (typeof ConnectionWebhookPayloadDataConnectionStatus)[keyof typeof ConnectionWebhookPayloadDataConnectionStatus]; +export const ConnectionWebhookPayloadErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionWebhookPayloadErrorStatus = (typeof ConnectionWebhookPayloadErrorStatus)[keyof typeof ConnectionWebhookPayloadErrorStatus]; +export const ConnectionWebhookPayloadSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionWebhookPayloadSourceType = (typeof ConnectionWebhookPayloadSourceType)[keyof typeof ConnectionWebhookPayloadSourceType]; +export const ConnectionWebhookPayloadStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookPayloadStatusDataConnectionStatus = (typeof ConnectionWebhookPayloadStatusDataConnectionStatus)[keyof typeof ConnectionWebhookPayloadStatusDataConnectionStatus]; +export const ConnectionWebhookPayloadStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionWebhookPayloadStatusErrorStatus = (typeof ConnectionWebhookPayloadStatusErrorStatus)[keyof typeof ConnectionWebhookPayloadStatusErrorStatus]; +export const ConnectionWebhookSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionWebhookSourceType = (typeof ConnectionWebhookSourceType)[keyof typeof ConnectionWebhookSourceType]; +export const ConnectionWebhookStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionWebhookStatusDataConnectionStatus = (typeof ConnectionWebhookStatusDataConnectionStatus)[keyof typeof ConnectionWebhookStatusDataConnectionStatus]; +export const ConnectionWebhookStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionWebhookStatusErrorStatus = (typeof ConnectionWebhookStatusErrorStatus)[keyof typeof ConnectionWebhookStatusErrorStatus]; +export const ConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsDataConnectionStatus = (typeof ConnectionsDataConnectionStatus)[keyof typeof ConnectionsDataConnectionStatus]; +export const ConnectionsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsErrorStatus = (typeof ConnectionsErrorStatus)[keyof typeof ConnectionsErrorStatus]; +export const ConnectionsResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsResultsDataConnectionStatus = (typeof ConnectionsResultsDataConnectionStatus)[keyof typeof ConnectionsResultsDataConnectionStatus]; +export const ConnectionsResultsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsResultsSourceType = (typeof ConnectionsResultsSourceType)[keyof typeof ConnectionsResultsSourceType]; +export const ConnectionsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsSourceType = (typeof ConnectionsSourceType)[keyof typeof ConnectionsSourceType]; +export const ConnectionsStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsStatusDataConnectionStatus = (typeof ConnectionsStatusDataConnectionStatus)[keyof typeof ConnectionsStatusDataConnectionStatus]; +export const ConnectionsStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsStatusErrorStatus = (typeof ConnectionsStatusErrorStatus)[keyof typeof ConnectionsStatusErrorStatus]; +export const CurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatus = (typeof CurrentStatus)[keyof typeof CurrentStatus]; +export const CurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatusDatasetStatus = (typeof CurrentStatusDatasetStatus)[keyof typeof CurrentStatusDatasetStatus]; +export const CustomProductReadCompleteWebhookDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CustomProductReadCompleteWebhookDataTypeDataTypes = (typeof CustomProductReadCompleteWebhookDataTypeDataTypes)[keyof typeof CustomProductReadCompleteWebhookDataTypeDataTypes]; +export const CustomProductReadCompleteWebhookDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CustomProductReadCompleteWebhookDataTypes = (typeof CustomProductReadCompleteWebhookDataTypes)[keyof typeof CustomProductReadCompleteWebhookDataTypes]; +export const CustomProductReadCompleteWebhookDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CustomProductReadCompleteWebhookDatasetStatus = (typeof CustomProductReadCompleteWebhookDatasetStatus)[keyof typeof CustomProductReadCompleteWebhookDatasetStatus]; +export const CustomProductReadCompleteWebhookPayloadDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CustomProductReadCompleteWebhookPayloadDataTypeDataTypes = (typeof CustomProductReadCompleteWebhookPayloadDataTypeDataTypes)[keyof typeof CustomProductReadCompleteWebhookPayloadDataTypeDataTypes]; +export const CustomProductReadCompleteWebhookPayloadDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CustomProductReadCompleteWebhookPayloadDataTypes = (typeof CustomProductReadCompleteWebhookPayloadDataTypes)[keyof typeof CustomProductReadCompleteWebhookPayloadDataTypes]; +export const CustomProductReadCompleteWebhookPayloadDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CustomProductReadCompleteWebhookPayloadDatasetStatus = (typeof CustomProductReadCompleteWebhookPayloadDatasetStatus)[keyof typeof CustomProductReadCompleteWebhookPayloadDatasetStatus]; +export const CustomProductReadCompleteWebhookPayloadStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CustomProductReadCompleteWebhookPayloadStatusDatasetStatus = (typeof CustomProductReadCompleteWebhookPayloadStatusDatasetStatus)[keyof typeof CustomProductReadCompleteWebhookPayloadStatusDatasetStatus]; +export const CustomProductReadCompleteWebhookStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CustomProductReadCompleteWebhookStatusDatasetStatus = (typeof CustomProductReadCompleteWebhookStatusDatasetStatus)[keyof typeof CustomProductReadCompleteWebhookStatusDatasetStatus]; +export const DataConnectionErrorErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorErrorStatus = (typeof DataConnectionErrorErrorStatus)[keyof typeof DataConnectionErrorErrorStatus]; +export const DataConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatus = (typeof DataConnectionErrorStatus)[keyof typeof DataConnectionErrorStatus]; +export const DataConnectionErrorStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatusErrorStatus = (typeof DataConnectionErrorStatusErrorStatus)[keyof typeof DataConnectionErrorStatusErrorStatus]; +export const DataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionSourceType = (typeof DataConnectionSourceType)[keyof typeof DataConnectionSourceType]; +export const DataConnectionSourceTypeSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionSourceTypeSourceType = (typeof DataConnectionSourceTypeSourceType)[keyof typeof DataConnectionSourceTypeSourceType]; +export const DataConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionStatusDataConnectionStatus = (typeof DataConnectionStatusDataConnectionStatus)[keyof typeof DataConnectionStatusDataConnectionStatus]; +export const DataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionsDataConnectionStatus = (typeof DataConnectionsDataConnectionStatus)[keyof typeof DataConnectionsDataConnectionStatus]; +export const DataConnectionsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionsSourceType = (typeof DataConnectionsSourceType)[keyof typeof DataConnectionsSourceType]; +export const DataStatusCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatus = (typeof DataStatusCurrentStatus)[keyof typeof DataStatusCurrentStatus]; +export const DataStatusCurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatusDatasetStatus = (typeof DataStatusCurrentStatusDatasetStatus)[keyof typeof DataStatusCurrentStatusDatasetStatus]; +export const DataStatusDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataType = (typeof DataStatusDataType)[keyof typeof DataStatusDataType]; +export const DataStatusDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypeDataTypes = (typeof DataStatusDataTypeDataTypes)[keyof typeof DataStatusDataTypeDataTypes]; +export const DataStatusDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypes = (typeof DataStatusDataTypes)[keyof typeof DataStatusDataTypes]; +export const DataStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusDatasetStatus = (typeof DataStatusDatasetStatus)[keyof typeof DataStatusDatasetStatus]; +export const DataStatusesCurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusesCurrentStatusDatasetStatus = (typeof DataStatusesCurrentStatusDatasetStatus)[keyof typeof DataStatusesCurrentStatusDatasetStatus]; +export const DataStatusesDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusesDataTypeDataTypes = (typeof DataStatusesDataTypeDataTypes)[keyof typeof DataStatusesDataTypeDataTypes]; +export const DataStatusesDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusesDataTypes = (typeof DataStatusesDataTypes)[keyof typeof DataStatusesDataTypes]; +export const DataStatusesDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusesDatasetStatus = (typeof DataStatusesDatasetStatus)[keyof typeof DataStatusesDatasetStatus]; +export const DataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType1 = (typeof DataType1)[keyof typeof DataType1]; +export const DataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType2 = (typeof DataType2)[keyof typeof DataType2]; +export const DataTypeDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataType = (typeof DataTypeDataType)[keyof typeof DataTypeDataType]; +export const DataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataTypes = (typeof DataTypeDataTypes)[keyof typeof DataTypeDataTypes]; +export const DataTypeFeatureDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeFeatureDataType = (typeof DataTypeFeatureDataType)[keyof typeof DataTypeFeatureDataType]; +export const DataTypeFeatureDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeFeatureDataTypeDataTypes = (typeof DataTypeFeatureDataTypeDataTypes)[keyof typeof DataTypeFeatureDataTypeDataTypes]; +export const DataTypeFeatureDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeFeatureDataTypes = (typeof DataTypeFeatureDataTypes)[keyof typeof DataTypeFeatureDataTypes]; +export const DataTypeFeatureFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type DataTypeFeatureFeatureState = (typeof DataTypeFeatureFeatureState)[keyof typeof DataTypeFeatureFeatureState]; +export const DataTypeFeatureFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeFeatureFeatureType = (typeof DataTypeFeatureFeatureType)[keyof typeof DataTypeFeatureFeatureType]; +export const DataTypeFeatureSupportedFeaturesFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type DataTypeFeatureSupportedFeaturesFeatureState = (typeof DataTypeFeatureSupportedFeaturesFeatureState)[keyof typeof DataTypeFeatureSupportedFeaturesFeatureState]; +export const DataTypeFeatureSupportedFeaturesFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeFeatureSupportedFeaturesFeatureType = (typeof DataTypeFeatureSupportedFeaturesFeatureType)[keyof typeof DataTypeFeatureSupportedFeaturesFeatureType]; +export const DataTypeReadSummaryDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeReadSummaryDataType = (typeof DataTypeReadSummaryDataType)[keyof typeof DataTypeReadSummaryDataType]; +export const DataTypeReadSummaryDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeReadSummaryDataTypeDataTypes = (typeof DataTypeReadSummaryDataTypeDataTypes)[keyof typeof DataTypeReadSummaryDataTypeDataTypes]; +export const DataTypeReadSummaryDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeReadSummaryDataTypes = (typeof DataTypeReadSummaryDataTypes)[keyof typeof DataTypeReadSummaryDataTypes]; +export const DataTypeReadSummaryDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataTypeReadSummaryDatasetStatus = (typeof DataTypeReadSummaryDatasetStatus)[keyof typeof DataTypeReadSummaryDatasetStatus]; +export const DataTypeReadSummaryStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataTypeReadSummaryStatus = (typeof DataTypeReadSummaryStatus)[keyof typeof DataTypeReadSummaryStatus]; +export const DataTypeReadSummaryStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataTypeReadSummaryStatusDatasetStatus = (typeof DataTypeReadSummaryStatusDatasetStatus)[keyof typeof DataTypeReadSummaryStatusDatasetStatus]; +export const DataTypeWriteWebhookPayloadPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type DataTypeWriteWebhookPayloadPushOperationStatus = (typeof DataTypeWriteWebhookPayloadPushOperationStatus)[keyof typeof DataTypeWriteWebhookPayloadPushOperationStatus]; +export const DataTypeWriteWebhookPayloadStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type DataTypeWriteWebhookPayloadStatusPushOperationStatus = (typeof DataTypeWriteWebhookPayloadStatusPushOperationStatus)[keyof typeof DataTypeWriteWebhookPayloadStatusPushOperationStatus]; +export const DataTypeWriteWebhookPayloadTypeWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeWriteWebhookPayloadTypeWriteType = (typeof DataTypeWriteWebhookPayloadTypeWriteType)[keyof typeof DataTypeWriteWebhookPayloadTypeWriteType]; +export const DataTypeWriteWebhookPayloadWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeWriteWebhookPayloadWriteType = (typeof DataTypeWriteWebhookPayloadWriteType)[keyof typeof DataTypeWriteWebhookPayloadWriteType]; +export const DataTypeWriteWebhookPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type DataTypeWriteWebhookPushOperationStatus = (typeof DataTypeWriteWebhookPushOperationStatus)[keyof typeof DataTypeWriteWebhookPushOperationStatus]; +export const DataTypeWriteWebhookStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type DataTypeWriteWebhookStatusPushOperationStatus = (typeof DataTypeWriteWebhookStatusPushOperationStatus)[keyof typeof DataTypeWriteWebhookStatusPushOperationStatus]; +export const DataTypeWriteWebhookTypeWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeWriteWebhookTypeWriteType = (typeof DataTypeWriteWebhookTypeWriteType)[keyof typeof DataTypeWriteWebhookTypeWriteType]; +export const DataTypeWriteWebhookWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type DataTypeWriteWebhookWriteType = (typeof DataTypeWriteWebhookWriteType)[keyof typeof DataTypeWriteWebhookWriteType]; +export const DataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypes = (typeof DataTypes)[keyof typeof DataTypes]; +export const DatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DatasetStatus = (typeof DatasetStatus)[keyof typeof DatasetStatus]; +export const ErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ErrorStatus = (typeof ErrorStatus)[keyof typeof ErrorStatus]; +export const FeatureStateFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type FeatureStateFeatureState = (typeof FeatureStateFeatureState)[keyof typeof FeatureStateFeatureState]; +export const FeatureTypeFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type FeatureTypeFeatureType = (typeof FeatureTypeFeatureType)[keyof typeof FeatureTypeFeatureType]; +export const GetSupplementalDataConfigurationPathParamDataType = { + Bills: "bills", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + Invoices: "invoices", + Items: "items", + JournalEntries: "journalEntries", + Suppliers: "suppliers", + TaxRates: "taxRates", +} as const; +export type GetSupplementalDataConfigurationPathParamDataType = (typeof GetSupplementalDataConfigurationPathParamDataType)[keyof typeof GetSupplementalDataConfigurationPathParamDataType]; +export const IntegrationDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type IntegrationDataTypeDataTypes = (typeof IntegrationDataTypeDataTypes)[keyof typeof IntegrationDataTypeDataTypes]; +export const IntegrationDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type IntegrationDataTypes = (typeof IntegrationDataTypes)[keyof typeof IntegrationDataTypes]; +export const IntegrationFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type IntegrationFeatureState = (typeof IntegrationFeatureState)[keyof typeof IntegrationFeatureState]; +export const IntegrationFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type IntegrationFeatureType = (typeof IntegrationFeatureType)[keyof typeof IntegrationFeatureType]; +export const IntegrationSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type IntegrationSourceType = (typeof IntegrationSourceType)[keyof typeof IntegrationSourceType]; +export const IntegrationSupportedFeaturesFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type IntegrationSupportedFeaturesFeatureState = (typeof IntegrationSupportedFeaturesFeatureState)[keyof typeof IntegrationSupportedFeaturesFeatureState]; +export const IntegrationSupportedFeaturesFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type IntegrationSupportedFeaturesFeatureType = (typeof IntegrationSupportedFeaturesFeatureType)[keyof typeof IntegrationSupportedFeaturesFeatureType]; +export const IntegrationsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type IntegrationsDataTypeDataTypes = (typeof IntegrationsDataTypeDataTypes)[keyof typeof IntegrationsDataTypeDataTypes]; +export const IntegrationsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type IntegrationsDataTypes = (typeof IntegrationsDataTypes)[keyof typeof IntegrationsDataTypes]; +export const IntegrationsFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type IntegrationsFeatureState = (typeof IntegrationsFeatureState)[keyof typeof IntegrationsFeatureState]; +export const IntegrationsFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type IntegrationsFeatureType = (typeof IntegrationsFeatureType)[keyof typeof IntegrationsFeatureType]; +export const IntegrationsResultsFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type IntegrationsResultsFeatureState = (typeof IntegrationsResultsFeatureState)[keyof typeof IntegrationsResultsFeatureState]; +export const IntegrationsResultsFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type IntegrationsResultsFeatureType = (typeof IntegrationsResultsFeatureType)[keyof typeof IntegrationsResultsFeatureType]; +export const IntegrationsResultsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type IntegrationsResultsSourceType = (typeof IntegrationsResultsSourceType)[keyof typeof IntegrationsResultsSourceType]; +export const IntegrationsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type IntegrationsSourceType = (typeof IntegrationsSourceType)[keyof typeof IntegrationsSourceType]; +export const IntegrationsSupportedFeaturesFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type IntegrationsSupportedFeaturesFeatureState = (typeof IntegrationsSupportedFeaturesFeatureState)[keyof typeof IntegrationsSupportedFeaturesFeatureState]; +export const IntegrationsSupportedFeaturesFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type IntegrationsSupportedFeaturesFeatureType = (typeof IntegrationsSupportedFeaturesFeatureType)[keyof typeof IntegrationsSupportedFeaturesFeatureType]; +export const ItemsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ItemsDataConnectionStatus = (typeof ItemsDataConnectionStatus)[keyof typeof ItemsDataConnectionStatus]; +export const ItemsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ItemsDataTypes = (typeof ItemsDataTypes)[keyof typeof ItemsDataTypes]; +export const ItemsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ItemsDatasetStatus = (typeof ItemsDatasetStatus)[keyof typeof ItemsDatasetStatus]; +export const ItemsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ItemsErrorStatus = (typeof ItemsErrorStatus)[keyof typeof ItemsErrorStatus]; +export const ItemsFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type ItemsFeatureState = (typeof ItemsFeatureState)[keyof typeof ItemsFeatureState]; +export const ItemsFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type ItemsFeatureType = (typeof ItemsFeatureType)[keyof typeof ItemsFeatureType]; +export const ItemsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ItemsPushChangeType = (typeof ItemsPushChangeType)[keyof typeof ItemsPushChangeType]; +export const ItemsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ItemsPushOperationStatus = (typeof ItemsPushOperationStatus)[keyof typeof ItemsPushOperationStatus]; +export const ItemsPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type ItemsPushOptionType = (typeof ItemsPushOptionType)[keyof typeof ItemsPushOptionType]; +export const ItemsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ItemsSourceType = (typeof ItemsSourceType)[keyof typeof ItemsSourceType]; +export const OneDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type OneDataConnectionStatus = (typeof OneDataConnectionStatus)[keyof typeof OneDataConnectionStatus]; +export const OneErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type OneErrorStatus = (typeof OneErrorStatus)[keyof typeof OneErrorStatus]; +export const OneSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type OneSourceType = (typeof OneSourceType)[keyof typeof OneSourceType]; +export const OptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionType = (typeof OptionType)[keyof typeof OptionType]; +export const OptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionTypePushOptionType = (typeof OptionTypePushOptionType)[keyof typeof OptionTypePushOptionType]; +export const PathParamDataType = { + Bills: "bills", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + Invoices: "invoices", + Items: "items", + JournalEntries: "journalEntries", + Suppliers: "suppliers", + TaxRates: "taxRates", +} as const; +export type PathParamDataType = (typeof PathParamDataType)[keyof typeof PathParamDataType]; +export const PayloadPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PayloadPushOperationStatus = (typeof PayloadPushOperationStatus)[keyof typeof PayloadPushOperationStatus]; +export const PayloadStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PayloadStatusPushOperationStatus = (typeof PayloadStatusPushOperationStatus)[keyof typeof PayloadStatusPushOperationStatus]; +export const PayloadTypeWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type PayloadTypeWriteType = (typeof PayloadTypeWriteType)[keyof typeof PayloadTypeWriteType]; +export const PayloadWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type PayloadWriteType = (typeof PayloadWriteType)[keyof typeof PayloadWriteType]; +export const PropertieCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieCurrentStatus = (typeof PropertieCurrentStatus)[keyof typeof PropertieCurrentStatus]; +export const PropertieDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type PropertieDataConnectionStatus = (typeof PropertieDataConnectionStatus)[keyof typeof PropertieDataConnectionStatus]; +export const PropertieDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType = (typeof PropertieDataType)[keyof typeof PropertieDataType]; +export const PropertieDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataTypes = (typeof PropertieDataTypes)[keyof typeof PropertieDataTypes]; +export const PropertieDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieDatasetStatus = (typeof PropertieDatasetStatus)[keyof typeof PropertieDatasetStatus]; +export const PropertieErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type PropertieErrorStatus = (typeof PropertieErrorStatus)[keyof typeof PropertieErrorStatus]; +export const PropertieFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type PropertieFeatureState = (typeof PropertieFeatureState)[keyof typeof PropertieFeatureState]; +export const PropertieOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertieOptionType = (typeof PropertieOptionType)[keyof typeof PropertieOptionType]; +export const PropertiePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PropertiePushChangeType = (typeof PropertiePushChangeType)[keyof typeof PropertiePushChangeType]; +export const PropertiePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PropertiePushOperationStatus = (typeof PropertiePushOperationStatus)[keyof typeof PropertiePushOperationStatus]; +export const PropertiePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertiePushOptionType = (typeof PropertiePushOptionType)[keyof typeof PropertiePushOptionType]; +export const PropertieSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieSourceType = (typeof PropertieSourceType)[keyof typeof PropertieSourceType]; +export const PropertieStatus = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus = (typeof PropertieStatus)[keyof typeof PropertieStatus]; +export const PropertieStatus1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus1 = (typeof PropertieStatus1)[keyof typeof PropertieStatus1]; +export const PropertieStatus2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus2 = (typeof PropertieStatus2)[keyof typeof PropertieStatus2]; +export const PropertieWriteRequestStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PropertieWriteRequestStatus = (typeof PropertieWriteRequestStatus)[keyof typeof PropertieWriteRequestStatus]; +export const PropertieWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type PropertieWriteType = (typeof PropertieWriteType)[keyof typeof PropertieWriteType]; +export const PullOperationDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationDatasetStatus = (typeof PullOperationDatasetStatus)[keyof typeof PullOperationDatasetStatus]; +export const PullOperationStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatus = (typeof PullOperationStatus)[keyof typeof PullOperationStatus]; +export const PullOperationStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatusDatasetStatus = (typeof PullOperationStatusDatasetStatus)[keyof typeof PullOperationStatusDatasetStatus]; +export const PullOperationsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsDatasetStatus = (typeof PullOperationsDatasetStatus)[keyof typeof PullOperationsDatasetStatus]; +export const PullOperationsStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsStatusDatasetStatus = (typeof PullOperationsStatusDatasetStatus)[keyof typeof PullOperationsStatusDatasetStatus]; +export const PushChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushChangeTypePushChangeType = (typeof PushChangeTypePushChangeType)[keyof typeof PushChangeTypePushChangeType]; +export const PushOperationChangeDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypeDataTypes = (typeof PushOperationChangeDataTypeDataTypes)[keyof typeof PushOperationChangeDataTypeDataTypes]; +export const PushOperationChangeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypes = (typeof PushOperationChangeDataTypes)[keyof typeof PushOperationChangeDataTypes]; +export const PushOperationChangePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangePushChangeType = (typeof PushOperationChangePushChangeType)[keyof typeof PushOperationChangePushChangeType]; +export const PushOperationChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangeTypePushChangeType = (typeof PushOperationChangeTypePushChangeType)[keyof typeof PushOperationChangeTypePushChangeType]; +export const PushOperationDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataType = (typeof PushOperationDataType)[keyof typeof PushOperationDataType]; +export const PushOperationDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypeDataTypes = (typeof PushOperationDataTypeDataTypes)[keyof typeof PushOperationDataTypeDataTypes]; +export const PushOperationDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypes = (typeof PushOperationDataTypes)[keyof typeof PushOperationDataTypes]; +export const PushOperationPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationPushChangeType = (typeof PushOperationPushChangeType)[keyof typeof PushOperationPushChangeType]; +export const PushOperationPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationPushOperationStatus = (typeof PushOperationPushOperationStatus)[keyof typeof PushOperationPushOperationStatus]; +export const PushOperationRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataType = (typeof PushOperationRefDataType)[keyof typeof PushOperationRefDataType]; +export const PushOperationRefDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypeDataTypes = (typeof PushOperationRefDataTypeDataTypes)[keyof typeof PushOperationRefDataTypeDataTypes]; +export const PushOperationRefDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypes = (typeof PushOperationRefDataTypes)[keyof typeof PushOperationRefDataTypes]; +export const PushOperationReferenceDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypeDataTypes = (typeof PushOperationReferenceDataTypeDataTypes)[keyof typeof PushOperationReferenceDataTypeDataTypes]; +export const PushOperationReferenceDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypes = (typeof PushOperationReferenceDataTypes)[keyof typeof PushOperationReferenceDataTypes]; +export const PushOperationStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationStatusPushOperationStatus = (typeof PushOperationStatusPushOperationStatus)[keyof typeof PushOperationStatusPushOperationStatus]; +export const PushOperationTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationTypePushChangeType = (typeof PushOperationTypePushChangeType)[keyof typeof PushOperationTypePushChangeType]; +export const PushOperationsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypeDataTypes = (typeof PushOperationsDataTypeDataTypes)[keyof typeof PushOperationsDataTypeDataTypes]; +export const PushOperationsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypes = (typeof PushOperationsDataTypes)[keyof typeof PushOperationsDataTypes]; +export const PushOperationsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsPushChangeType = (typeof PushOperationsPushChangeType)[keyof typeof PushOperationsPushChangeType]; +export const PushOperationsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsPushOperationStatus = (typeof PushOperationsPushOperationStatus)[keyof typeof PushOperationsPushOperationStatus]; +export const PushOperationsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsResultsPushChangeType = (typeof PushOperationsResultsPushChangeType)[keyof typeof PushOperationsResultsPushChangeType]; +export const PushOperationsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsResultsPushOperationStatus = (typeof PushOperationsResultsPushOperationStatus)[keyof typeof PushOperationsResultsPushOperationStatus]; +export const PushOperationsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsStatusPushOperationStatus = (typeof PushOperationsStatusPushOperationStatus)[keyof typeof PushOperationsStatusPushOperationStatus]; +export const PushOperationsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsTypePushChangeType = (typeof PushOperationsTypePushChangeType)[keyof typeof PushOperationsTypePushChangeType]; +export const PushOptionChoicePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoicePushOptionType = (typeof PushOptionChoicePushOptionType)[keyof typeof PushOptionChoicePushOptionType]; +export const PushOptionChoiceTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoiceTypePushOptionType = (typeof PushOptionChoiceTypePushOptionType)[keyof typeof PushOptionChoiceTypePushOptionType]; +export const PushOptionPropertyPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyPushOptionType = (typeof PushOptionPropertyPushOptionType)[keyof typeof PushOptionPropertyPushOptionType]; +export const PushOptionPropertyTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyTypePushOptionType = (typeof PushOptionPropertyTypePushOptionType)[keyof typeof PushOptionPropertyTypePushOptionType]; +export const PushOptionPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPushOptionType = (typeof PushOptionPushOptionType)[keyof typeof PushOptionPushOptionType]; +export const PushOptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionTypePushOptionType = (typeof PushOptionTypePushOptionType)[keyof typeof PushOptionTypePushOptionType]; +export const ReadCompletedWebhookDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadCompletedWebhookDataTypeDataTypes = (typeof ReadCompletedWebhookDataTypeDataTypes)[keyof typeof ReadCompletedWebhookDataTypeDataTypes]; +export const ReadCompletedWebhookDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadCompletedWebhookDataTypes = (typeof ReadCompletedWebhookDataTypes)[keyof typeof ReadCompletedWebhookDataTypes]; +export const ReadCompletedWebhookDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadCompletedWebhookDatasetStatus = (typeof ReadCompletedWebhookDatasetStatus)[keyof typeof ReadCompletedWebhookDatasetStatus]; +export const ReadCompletedWebhookPayloadDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadCompletedWebhookPayloadDataTypeDataTypes = (typeof ReadCompletedWebhookPayloadDataTypeDataTypes)[keyof typeof ReadCompletedWebhookPayloadDataTypeDataTypes]; +export const ReadCompletedWebhookPayloadDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadCompletedWebhookPayloadDataTypes = (typeof ReadCompletedWebhookPayloadDataTypes)[keyof typeof ReadCompletedWebhookPayloadDataTypes]; +export const ReadCompletedWebhookPayloadDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadCompletedWebhookPayloadDatasetStatus = (typeof ReadCompletedWebhookPayloadDatasetStatus)[keyof typeof ReadCompletedWebhookPayloadDatasetStatus]; +export const ReadCompletedWebhookPayloadStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadCompletedWebhookPayloadStatusDatasetStatus = (typeof ReadCompletedWebhookPayloadStatusDatasetStatus)[keyof typeof ReadCompletedWebhookPayloadStatusDatasetStatus]; +export const ReadCompletedWebhookStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadCompletedWebhookStatusDatasetStatus = (typeof ReadCompletedWebhookStatusDatasetStatus)[keyof typeof ReadCompletedWebhookStatusDatasetStatus]; +export const ReadResultWebhookPayloadDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadResultWebhookPayloadDataTypeDataTypes = (typeof ReadResultWebhookPayloadDataTypeDataTypes)[keyof typeof ReadResultWebhookPayloadDataTypeDataTypes]; +export const ReadResultWebhookPayloadDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ReadResultWebhookPayloadDataTypes = (typeof ReadResultWebhookPayloadDataTypes)[keyof typeof ReadResultWebhookPayloadDataTypes]; +export const ReadResultWebhookPayloadDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadResultWebhookPayloadDatasetStatus = (typeof ReadResultWebhookPayloadDatasetStatus)[keyof typeof ReadResultWebhookPayloadDatasetStatus]; +export const ReadResultWebhookPayloadStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ReadResultWebhookPayloadStatusDatasetStatus = (typeof ReadResultWebhookPayloadStatusDatasetStatus)[keyof typeof ReadResultWebhookPayloadStatusDatasetStatus]; +export const ResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ResultsDataConnectionStatus = (typeof ResultsDataConnectionStatus)[keyof typeof ResultsDataConnectionStatus]; +export const ResultsFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type ResultsFeatureState = (typeof ResultsFeatureState)[keyof typeof ResultsFeatureState]; +export const ResultsFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type ResultsFeatureType = (typeof ResultsFeatureType)[keyof typeof ResultsFeatureType]; +export const ResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ResultsPushChangeType = (typeof ResultsPushChangeType)[keyof typeof ResultsPushChangeType]; +export const ResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ResultsPushOperationStatus = (typeof ResultsPushOperationStatus)[keyof typeof ResultsPushOperationStatus]; +export const ResultsSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ResultsSourceType = (typeof ResultsSourceType)[keyof typeof ResultsSourceType]; +export const SchemaCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaCurrentStatus = (typeof SchemaCurrentStatus)[keyof typeof SchemaCurrentStatus]; +export const SchemaDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type SchemaDataConnectionStatus = (typeof SchemaDataConnectionStatus)[keyof typeof SchemaDataConnectionStatus]; +export const SchemaDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType = (typeof SchemaDataType)[keyof typeof SchemaDataType]; +export const SchemaDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataTypes = (typeof SchemaDataTypes)[keyof typeof SchemaDataTypes]; +export const SchemaDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaDatasetStatus = (typeof SchemaDatasetStatus)[keyof typeof SchemaDatasetStatus]; +export const SchemaErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type SchemaErrorStatus = (typeof SchemaErrorStatus)[keyof typeof SchemaErrorStatus]; +export const SchemaFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type SchemaFeatureState = (typeof SchemaFeatureState)[keyof typeof SchemaFeatureState]; +export const SchemaOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaOptionType = (typeof SchemaOptionType)[keyof typeof SchemaOptionType]; +export const SchemaPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type SchemaPushChangeType = (typeof SchemaPushChangeType)[keyof typeof SchemaPushChangeType]; +export const SchemaPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type SchemaPushOperationStatus = (typeof SchemaPushOperationStatus)[keyof typeof SchemaPushOperationStatus]; +export const SchemaPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaPushOptionType = (typeof SchemaPushOptionType)[keyof typeof SchemaPushOptionType]; +export const SchemaSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaSourceType = (typeof SchemaSourceType)[keyof typeof SchemaSourceType]; +export const SchemaStatus = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus = (typeof SchemaStatus)[keyof typeof SchemaStatus]; +export const SchemaStatus1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus1 = (typeof SchemaStatus1)[keyof typeof SchemaStatus1]; +export const SchemaStatus2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus2 = (typeof SchemaStatus2)[keyof typeof SchemaStatus2]; +export const SchemaWriteRequestStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type SchemaWriteRequestStatus = (typeof SchemaWriteRequestStatus)[keyof typeof SchemaWriteRequestStatus]; +export const SchemaWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type SchemaWriteType = (typeof SchemaWriteType)[keyof typeof SchemaWriteType]; +export const SetCompanySyncSettingsRequestBodyDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SetCompanySyncSettingsRequestBodyDataTypeDataTypes = (typeof SetCompanySyncSettingsRequestBodyDataTypeDataTypes)[keyof typeof SetCompanySyncSettingsRequestBodyDataTypeDataTypes]; +export const SetCompanySyncSettingsRequestBodyDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SetCompanySyncSettingsRequestBodyDataTypes = (typeof SetCompanySyncSettingsRequestBodyDataTypes)[keyof typeof SetCompanySyncSettingsRequestBodyDataTypes]; +export const SourceTypeSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceTypeSourceType = (typeof SourceTypeSourceType)[keyof typeof SourceTypeSourceType]; +export const Status1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status1 = (typeof Status1)[keyof typeof Status1]; +export const Status2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status2 = (typeof Status2)[keyof typeof Status2]; +export const StatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type StatusDataConnectionStatus = (typeof StatusDataConnectionStatus)[keyof typeof StatusDataConnectionStatus]; +export const StatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusDatasetStatus = (typeof StatusDatasetStatus)[keyof typeof StatusDatasetStatus]; +export const StatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type StatusErrorStatus = (typeof StatusErrorStatus)[keyof typeof StatusErrorStatus]; +export const StatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type StatusPushOperationStatus = (typeof StatusPushOperationStatus)[keyof typeof StatusPushOperationStatus]; +export const StatusStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusStatus = (typeof StatusStatus)[keyof typeof StatusStatus]; +export const SummaryOfDataTypeReadsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SummaryOfDataTypeReadsDataTypeDataTypes = (typeof SummaryOfDataTypeReadsDataTypeDataTypes)[keyof typeof SummaryOfDataTypeReadsDataTypeDataTypes]; +export const SummaryOfDataTypeReadsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SummaryOfDataTypeReadsDataTypes = (typeof SummaryOfDataTypeReadsDataTypes)[keyof typeof SummaryOfDataTypeReadsDataTypes]; +export const SummaryOfDataTypeReadsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SummaryOfDataTypeReadsDatasetStatus = (typeof SummaryOfDataTypeReadsDatasetStatus)[keyof typeof SummaryOfDataTypeReadsDatasetStatus]; +export const SummaryOfDataTypeReadsStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SummaryOfDataTypeReadsStatusDatasetStatus = (typeof SummaryOfDataTypeReadsStatusDatasetStatus)[keyof typeof SummaryOfDataTypeReadsStatusDatasetStatus]; +export const SupportedFeatureFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type SupportedFeatureFeatureState = (typeof SupportedFeatureFeatureState)[keyof typeof SupportedFeatureFeatureState]; +export const SupportedFeatureFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type SupportedFeatureFeatureType = (typeof SupportedFeatureFeatureType)[keyof typeof SupportedFeatureFeatureType]; +export const SupportedFeaturesFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type SupportedFeaturesFeatureState = (typeof SupportedFeaturesFeatureState)[keyof typeof SupportedFeaturesFeatureState]; +export const SupportedFeaturesFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type SupportedFeaturesFeatureType = (typeof SupportedFeaturesFeatureType)[keyof typeof SupportedFeaturesFeatureType]; +export const SyncSettingDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SyncSettingDataType = (typeof SyncSettingDataType)[keyof typeof SyncSettingDataType]; +export const SyncSettingDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SyncSettingDataTypeDataTypes = (typeof SyncSettingDataTypeDataTypes)[keyof typeof SyncSettingDataTypeDataTypes]; +export const SyncSettingDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SyncSettingDataTypes = (typeof SyncSettingDataTypes)[keyof typeof SyncSettingDataTypes]; +export const SyncSettingsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SyncSettingsDataTypeDataTypes = (typeof SyncSettingsDataTypeDataTypes)[keyof typeof SyncSettingsDataTypeDataTypes]; +export const SyncSettingsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SyncSettingsDataTypes = (typeof SyncSettingsDataTypes)[keyof typeof SyncSettingsDataTypes]; +export const TypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type TypePushChangeType = (typeof TypePushChangeType)[keyof typeof TypePushChangeType]; +export const TypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type TypePushOptionType = (typeof TypePushOptionType)[keyof typeof TypePushOptionType]; +export const TypeWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type TypeWriteType = (typeof TypeWriteType)[keyof typeof TypeWriteType]; +export const UpdateConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type UpdateConnectionStatusDataConnectionStatus = (typeof UpdateConnectionStatusDataConnectionStatus)[keyof typeof UpdateConnectionStatusDataConnectionStatus]; +export const UpdateConnectionStatusStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type UpdateConnectionStatusStatusDataConnectionStatus = (typeof UpdateConnectionStatusStatusDataConnectionStatus)[keyof typeof UpdateConnectionStatusStatusDataConnectionStatus]; +export const UpdateProfileSyncSettingsRequestBodyDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateProfileSyncSettingsRequestBodyDataTypeDataTypes = (typeof UpdateProfileSyncSettingsRequestBodyDataTypeDataTypes)[keyof typeof UpdateProfileSyncSettingsRequestBodyDataTypeDataTypes]; +export const UpdateProfileSyncSettingsRequestBodyDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateProfileSyncSettingsRequestBodyDataTypes = (typeof UpdateProfileSyncSettingsRequestBodyDataTypes)[keyof typeof UpdateProfileSyncSettingsRequestBodyDataTypes]; +export const WriteRequestStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type WriteRequestStatus = (typeof WriteRequestStatus)[keyof typeof WriteRequestStatus]; +export const WriteRequestStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type WriteRequestStatusPushOperationStatus = (typeof WriteRequestStatusPushOperationStatus)[keyof typeof WriteRequestStatusPushOperationStatus]; +export const WriteStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type WriteStatusPushOperationStatus = (typeof WriteStatusPushOperationStatus)[keyof typeof WriteStatusPushOperationStatus]; +export const WriteStatusWriteStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type WriteStatusWriteStatus = (typeof WriteStatusWriteStatus)[keyof typeof WriteStatusWriteStatus]; +export const WriteTypeWriteType = { + Create: "Create", + Delete: "Delete", + Update: "Update", + UploadAttachment: "UploadAttachment", +} as const; +export type WriteTypeWriteType = (typeof WriteTypeWriteType)[keyof typeof WriteTypeWriteType]; +export const ZeroDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ZeroDataConnectionStatus = (typeof ZeroDataConnectionStatus)[keyof typeof ZeroDataConnectionStatus]; +export const ZeroDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ZeroDataTypes = (typeof ZeroDataTypes)[keyof typeof ZeroDataTypes]; +export const ZeroDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ZeroDatasetStatus = (typeof ZeroDatasetStatus)[keyof typeof ZeroDatasetStatus]; +export const ZeroErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ZeroErrorStatus = (typeof ZeroErrorStatus)[keyof typeof ZeroErrorStatus]; +export const ZeroFeatureState = { + Alpha: "Alpha", + Beta: "Beta", + Deprecated: "Deprecated", + NotImplemented: "NotImplemented", + NotSupported: "NotSupported", + Release: "Release", +} as const; +export type ZeroFeatureState = (typeof ZeroFeatureState)[keyof typeof ZeroFeatureState]; +export const ZeroFeatureType = { + Categorization: "Categorization", + Delete: "Delete", + DownloadAttachment: "DownloadAttachment", + Get: "Get", + GetAsPdf: "GetAsPdf", + GetAttachment: "GetAttachment", + GetAttachments: "GetAttachments", + Post: "Post", + Put: "Put", + UploadAttachment: "UploadAttachment", +} as const; +export type ZeroFeatureType = (typeof ZeroFeatureType)[keyof typeof ZeroFeatureType]; +export const ZeroPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ZeroPushChangeType = (typeof ZeroPushChangeType)[keyof typeof ZeroPushChangeType]; +export const ZeroPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ZeroPushOperationStatus = (typeof ZeroPushOperationStatus)[keyof typeof ZeroPushOperationStatus]; +export const ZeroSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ZeroSourceType = (typeof ZeroSourceType)[keyof typeof ZeroSourceType]; diff --git a/platform/src/sdk/models/_speakeasy_hoisted.ts b/platform/src/sdk/models/_speakeasy_hoisted.ts new file mode 100644 index 000000000..61885b940 --- /dev/null +++ b/platform/src/sdk/models/_speakeasy_hoisted.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type * as shared from './index'; + + +export interface ConnectionInfo {} + +export interface Content {} + +export interface DefinitionDataTypeWriteWebhookRecord { + id?: string; +} + +export interface DefinitionSummaryOfDataTypeReads { + connectionId?: string; + dataType?: string; + issues?: Array<{ [key: string]: any }> | null; + recordsModified?: boolean; + status?: string; +} + +export interface DefinitionWriteRequestStatus {} + +export interface DefinitionWriteType {} + +export interface Properties {} + +export interface PullData {} + +export interface PushData {} + +export interface RequiredData {} + +export interface SupplementalDataConfig {} + +export interface Tags {} diff --git a/platform/src/sdk/models/errors/codatplatformerror.ts b/platform/src/sdk/models/errors/codatplatformerror.ts index 32dfeae30..0df4cbbc7 100644 --- a/platform/src/sdk/models/errors/codatplatformerror.ts +++ b/platform/src/sdk/models/errors/codatplatformerror.ts @@ -1,35 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** The base class for all HTTP error responses */ export class CodatPlatformError extends Error { - /** HTTP status code */ - public readonly statusCode: number; - /** HTTP body */ - public readonly body: string; - /** HTTP headers */ - public readonly headers: Headers; - /** HTTP content type */ - public readonly contentType: string; - /** Raw response */ - public readonly rawResponse: Response; + readonly body: string; + readonly statusCode: number; + readonly contentType: string; + readonly headers: Headers; + readonly rawResponse: Response; - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.statusCode = httpMeta.response.status; - this.body = httpMeta.body; - this.headers = httpMeta.response.headers; - this.contentType = httpMeta.response.headers.get("content-type") || ""; - this.rawResponse = httpMeta.response; - - this.name = "CodatPlatformError"; - } + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message); + this.name = "CodatPlatformError"; + this.body = httpMeta.body; + this.statusCode = httpMeta.response.status; + this.contentType = httpMeta.response.headers.get("content-type") ?? ""; + this.headers = httpMeta.response.headers; + this.rawResponse = httpMeta.response; + } } diff --git a/platform/src/sdk/models/errors/errormessage.ts b/platform/src/sdk/models/errors/errormessage.ts index 6ad9c7a28..2bd2351bc 100644 --- a/platform/src/sdk/models/errors/errormessage.ts +++ b/platform/src/sdk/models/errors/errormessage.ts @@ -1,120 +1,38 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; -import { CodatPlatformError } from "./codatplatformerror.js"; +import { CodatPlatformError } from "./codatplatformerror"; +import type { ErrorMessageData } from "../ErrorMessage"; +import type { ErrorValidation } from "../shared/errorvalidation"; -/** - * Your `query` parameter was not correctly formed - */ -export type ErrorMessageData = { - /** - * The HTTP status code returned by the error. - */ - statusCode?: number | undefined; - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; -}; +export type { ErrorMessageData }; -/** - * Your `query` parameter was not correctly formed - */ export class ErrorMessage extends CodatPlatformError { - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; + service?: string | undefined; + error?: string | undefined; + correlationId?: string | undefined; + validation?: ErrorValidation | null | undefined; + canBeRetried?: string | undefined; + detailedErrorCode?: number | undefined; - /** The original data that was passed to this error instance. */ - data$: ErrorMessageData; + data$: ErrorMessageData; - constructor( - err: ErrorMessageData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - if (err.service != null) this.service = err.service; - if (err.error != null) this.error = err.error; - if (err.correlationId != null) this.correlationId = err.correlationId; - if (err.validation != null) this.validation = err.validation; - if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; - if (err.detailedErrorCode != null) { - this.detailedErrorCode = err.detailedErrorCode; + constructor( + err: ErrorMessageData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const data = err as ErrorMessageData & { message?: unknown }; + const message = typeof data.message === "string" + ? data.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + if (err.service != null) this.service = err.service; + if (err.error != null) this.error = err.error; + if (err.correlationId != null) this.correlationId = err.correlationId; + if (err.validation != null) this.validation = err.validation; + if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; + if (err.detailedErrorCode != null) this.detailedErrorCode = err.detailedErrorCode; + this.name = "ErrorMessage"; } - - this.name = "ErrorMessage"; - } } - -/** @internal */ -export const ErrorMessage$inboundSchema: z.ZodType< - ErrorMessage, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - service: z.string().optional(), - error: z.string().optional(), - correlationId: z.string().optional(), - validation: z.nullable(shared.ErrorValidation$inboundSchema).optional(), - canBeRetried: z.string().optional(), - detailedErrorCode: z.number().int().optional(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new ErrorMessage(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/platform/src/sdk/models/errors/httpclienterrors.ts b/platform/src/sdk/models/errors/httpclienterrors.ts index b34f61212..0bfc5af09 100644 --- a/platform/src/sdk/models/errors/httpclienterrors.ts +++ b/platform/src/sdk/models/errors/httpclienterrors.ts @@ -1,62 +1,47 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Base class for all HTTP errors. - */ export class HTTPClientError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - override name = "HTTPClientError"; - constructor(message: string, opts?: { cause?: unknown }) { - let msg = message; - if (opts?.cause) { - msg += `: ${opts.cause}`; - } + readonly cause: unknown; - super(msg, opts); - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = opts?.cause; + constructor(message: string, opts?: { cause?: unknown }) { + super(message); + this.name = "HTTPClientError"; + this.cause = opts?.cause; } - } } -/** - * An error to capture unrecognised or unexpected errors when making HTTP calls. - */ export class UnexpectedClientError extends HTTPClientError { - override name = "UnexpectedClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "UnexpectedClientError"; + } } -/** - * An error that is raised when any inputs used to create a request are invalid. - */ export class InvalidRequestError extends HTTPClientError { - override name = "InvalidRequestError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "InvalidRequestError"; + } } -/** - * An error that is raised when a HTTP request was aborted by the client error. - */ export class RequestAbortedError extends HTTPClientError { - override readonly name = "RequestAbortedError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestAbortedError"; + } } -/** - * An error that is raised when a HTTP request timed out due to an AbortSignal - * signal timeout. - */ export class RequestTimeoutError extends HTTPClientError { - override readonly name = "RequestTimeoutError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestTimeoutError"; + } } -/** - * An error that is raised when a HTTP client is unable to make a request to - * a server. - */ export class ConnectionError extends HTTPClientError { - override readonly name = "ConnectionError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "ConnectionError"; + } } diff --git a/platform/src/sdk/models/errors/index.ts b/platform/src/sdk/models/errors/index.ts index 709731241..6f3d7d604 100644 --- a/platform/src/sdk/models/errors/index.ts +++ b/platform/src/sdk/models/errors/index.ts @@ -1,10 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./codatplatformerror.js"; -export * from "./errormessage.js"; -export * from "./httpclienterrors.js"; -export * from "./responsevalidationerror.js"; -export * from "./sdkerror.js"; -export * from "./sdkvalidationerror.js"; +export * from './codatplatformerror'; +export * from './errormessage'; +export * from './httpclienterrors'; +export * from './responsevalidationerror'; +export * from './sdkerror'; +export * from './sdkvalidationerror'; diff --git a/platform/src/sdk/models/errors/responsevalidationerror.ts b/platform/src/sdk/models/errors/responsevalidationerror.ts index e98a5961a..50542a290 100644 --- a/platform/src/sdk/models/errors/responsevalidationerror.ts +++ b/platform/src/sdk/models/errors/responsevalidationerror.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatPlatformError } from "./codatplatformerror.js"; -import { formatZodError } from "./sdkvalidationerror.js"; +import { CodatPlatformError } from "./codatplatformerror"; export class ResponseValidationError extends CodatPlatformError { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; + readonly cause: unknown; + readonly rawMessage: unknown; + readonly rawValue: unknown; - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - constructor( - message: string, - extra: { - response: Response; - request: Request; - body: string; - cause: unknown; - rawValue: unknown; - rawMessage: unknown; - }, - ) { - super(message, extra); - this.name = "ResponseValidationError"; - this.cause = extra.cause; - this.rawValue = extra.rawValue; - this.rawMessage = extra.rawMessage; - } + constructor( + message: string, + extra: { response: Response; request: Request; body: string; cause: unknown; rawValue: unknown; rawMessage: unknown }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawMessage = extra.rawMessage; + this.rawValue = extra.rawValue; + } - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + pretty(): string { + return this.message; } - } } diff --git a/platform/src/sdk/models/errors/sdkerror.ts b/platform/src/sdk/models/errors/sdkerror.ts index e272fee5e..102891bad 100644 --- a/platform/src/sdk/models/errors/sdkerror.ts +++ b/platform/src/sdk/models/errors/sdkerror.ts @@ -1,40 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatPlatformError } from "./codatplatformerror.js"; +import { CodatPlatformError } from "./codatplatformerror"; -/** The fallback error class if no more specific error class is matched */ export class SDKError extends CodatPlatformError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message, httpMeta); + this.name = "SDKError"; } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : ". "; - let bodyDisplay = body; - if (body.length > 10000) { - const truncated = body.substring(0, 10000); - const remaining = body.length - 10000; - bodyDisplay = `${truncated}...and ${remaining} more chars`; - } - message += `Body: ${bodyDisplay}`; - message = message.trim(); - super(message, httpMeta); - this.name = "SDKError"; - } } diff --git a/platform/src/sdk/models/errors/sdkvalidationerror.ts b/platform/src/sdk/models/errors/sdkvalidationerror.ts index 6826e1208..23a011c8c 100644 --- a/platform/src/sdk/models/errors/sdkvalidationerror.ts +++ b/platform/src/sdk/models/errors/sdkvalidationerror.ts @@ -1,109 +1,26 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export class SDKValidationError extends Error { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` - static override [Symbol.hasInstance]( - instance: unknown, - ): instance is SDKValidationError { - if (!(instance instanceof Error)) return false; - if (!("rawValue" in instance)) return false; - if (!("rawMessage" in instance)) return false; - if (!("pretty" in instance)) return false; - if (typeof instance.pretty !== "function") return false; - return true; - } - - constructor(message: string, cause: unknown, rawValue: unknown) { - super(`${message}: ${cause}`); - this.name = "SDKValidationError"; - this.cause = cause; - this.rawValue = rawValue; - this.rawMessage = message; - } - - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + readonly cause: unknown; + readonly rawValue: unknown; + readonly rawMessage: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + this.rawMessage = message; } - } -} -export function formatZodError(err: z.ZodError, level = 0): string { - let pre = " ".repeat(level); - pre = level > 0 ? `│${pre}` : pre; - pre += " ".repeat(level); - - let message = ""; - const append = (str: string) => (message += `\n${pre}${str}`); - - const len = err.issues.length; - const headline = len === 1 ? `${len} issue found` : `${len} issues found`; - - if (len) { - append(`┌ ${headline}:`); - } - - for (const issue of err.issues) { - let path = issue.path.join("."); - path = path ? `.${path}` : ""; - append(`│ • [${path}]: ${issue.message} (${issue.code})`); - switch (issue.code) { - case "invalid_literal": - case "invalid_type": { - append(`│ Want: ${issue.expected}`); - append(`│ Got: ${issue.received}`); - break; - } - case "unrecognized_keys": { - append(`│ Keys: ${issue.keys.join(", ")}`); - break; - } - case "invalid_enum_value": { - append(`│ Allowed: ${issue.options.join(", ")}`); - append(`│ Got: ${issue.received}`); - break; - } - case "invalid_union_discriminator": { - append(`│ Allowed: ${issue.options.join(", ")}`); - break; - } - case "invalid_union": { - const len = issue.unionErrors.length; - append( - `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, - ); - issue.unionErrors.forEach((err, i) => { - append(`│ ✖︎ Member ${i + 1} of ${len}`); - append(`${formatZodError(err, level + 1)}`); - }); - } + pretty(): string { + return this.message; } - } - - if (err.issues.length) { - append(`└─*`); - } +} - return message.slice(1); +export function formatZodError(err: unknown, level?: number): string { + void err; + void level; + return ""; } diff --git a/platform/src/sdk/models/index.ts b/platform/src/sdk/models/index.ts new file mode 100644 index 000000000..77701f5d0 --- /dev/null +++ b/platform/src/sdk/models/index.ts @@ -0,0 +1,141 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AccessToken'; +export * from './shared/apikeydetails'; +export * from './shared/apikeys'; +export * from './shared/branding'; +export * from './shared/brandingbutton'; +export * from './shared/brandingimage'; +export * from './shared/brandinglogo'; +export * from './shared/clientratelimitwebhook'; +export * from './shared/clientratelimitwebhookpayload'; +export * from './shared/companies'; +export * from './shared/company'; +export * from './shared/companyaccesstoken'; +export * from './shared/companydetails'; +export * from './CompanyProductWebhook'; +export * from './CompanyProductWebhookPayload'; +export * from './shared/companyreference'; +export * from './shared/companyreferencelinks'; +export * from './shared/companyrequestbody'; +export * from './shared/companysyncsettings'; +export * from './shared/companyupdaterequest'; +export * from './shared/companywebhook'; +export * from './shared/connection'; +export * from './shared/connectionmanagementaccesstoken'; +export * from './shared/connectionmanagementallowedorigins'; +export * from './shared/connectionwebhook'; +export * from './shared/connectionwebhookpayload'; +export * from './shared/connections'; +export * from './shared/createapikey'; +export * from './operations/createconnectionrequestbody'; +export * from './shared/customdatatypeconfiguration'; +export * from './shared/customdatatyperecord'; +export * from './shared/customdatatyperecords'; +export * from './shared/dataconnectionerror'; +export * from './shared/dataconnectionstatus'; +export * from './shared/datastatus'; +export * from './shared/datastatuses'; +export * from './DataType'; +export * from './shared/datatypefeature'; +export * from './shared/datatypereadsummary'; +export * from './shared/datatypewritewebhook'; +export * from './shared/datatypewritewebhookpayload'; +export * from './shared/datatypewritewebhookrecord'; +export * from './ErrorMessage'; +export * from './shared/errorvalidation'; +export * from './shared/errorvalidationitem'; +export * from './shared/featurestate'; +export * from './shared/featuretype'; +export * from './shared/halref'; +export * from './shared/imagereference'; +export * from './shared/integration'; +export * from './shared/integrations'; +export * from './shared/issue'; +export * from './shared/issuelinks'; +export * from './shared/links'; +export * from './shared/modifieddate'; +export * from './PagingInfo'; +export * from './shared/profile'; +export * from './shared/pulloperation'; +export * from './shared/pulloperations'; +export * from './shared/pushchangetype'; +export * from './shared/pushfieldvalidation'; +export * from './shared/pushoperation'; +export * from './shared/pushoperationchange'; +export * from './shared/pushoperationref'; +export * from './shared/pushoperationstatus'; +export * from './shared/pushoperations'; +export * from './shared/pushoption'; +export * from './shared/pushoptionchoice'; +export * from './shared/pushoptionproperty'; +export * from './shared/pushoptiontype'; +export * from './shared/pushvalidationinfo'; +export * from './shared/readcompletedwebhook'; +export * from './shared/readcompletedwebhookpayload'; +export * from './operations/refreshproductdatarequestbody'; +export * from './operations/setcompanysyncsettingsrequestbody'; +export * from './shared/sourcetype'; +export * from './shared/status'; +export * from './shared/supplementaldataconfiguration'; +export * from './shared/supplementaldatasourceconfiguration'; +export * from './shared/supportedfeature'; +export * from './shared/syncsetting'; +export * from './shared/syncsettings'; +export * from './shared/updateconnectionstatus'; +export * from './operations/updateprofilesyncsettings'; +export * from './shared/validation'; +export * from './shared/validationitem'; +export * from './shared/validationitem1'; +export * from './shared/validationresult'; +export * from './shared/webhookconsumer'; +export * from './shared/webhookconsumerprototype'; +export * from './shared/webhookconsumers'; +export * from './WebhookZapierKey'; +export * from './shared/writestatus'; +export * from './shared/writetype'; +export * from './_speakeasy_enums'; +export * from './_speakeasy_hoisted'; +export type { Security } from '../../lib/sdkconfig'; + +export type { ListCompaniesRequest } from './operations/listcompanies'; +export type { GetCompanyRequest } from './operations/getcompany'; +export type { ReplaceCompanyRequest } from './operations/replacecompany'; +export type { UpdateCompanyRequest } from './operations/updatecompany'; +export type { DeleteCompanyRequest } from './operations/deletecompany'; +export type { AddProductRequest } from './operations/addproduct'; +export type { RemoveProductRequest } from './operations/removeproduct'; +export type { RefreshProductDataRequest } from './operations/refreshproductdata'; +export type { ListConnectionsRequest } from './operations/listconnections'; +export type { CreateConnectionRequest } from './operations/createconnection'; +export type { GetConnectionRequest } from './operations/getconnection'; +export type { UnlinkConnectionRequest } from './operations/unlinkconnection'; +export type { DeleteConnectionRequest } from './operations/deleteconnection'; +export type { UpdateConnectionAuthorizationRequest } from './operations/updateconnectionauthorization'; +export type { GetCompanyAccessTokenRequest } from './operations/getcompanyaccesstoken'; +export type { GetCompanySyncSettingsRequest } from './operations/getcompanysyncsettings'; +export type { SetCompanySyncSettingsRequest } from './operations/setcompanysyncsettings'; +export type { GetConnectionManagementAccessTokenRequest } from './operations/getconnectionmanagementaccesstoken'; +export type { RefreshCompanyDataRequest } from './operations/refreshcompanydata'; +export type { RefreshDataTypeRequest } from './operations/refreshdatatype'; +export type { GetCompanyDataStatusRequest } from './operations/getcompanydatastatus'; +export type { ListPullOperationsRequest } from './operations/listpulloperations'; +export type { GetPullOperationRequest } from './operations/getpulloperation'; +export type { DeleteWebhookConsumerRequest } from './operations/deletewebhookconsumer'; +export type { ListIntegrationsRequest } from './operations/listintegrations'; +export type { GetIntegrationRequest } from './operations/getintegration'; +export type { GetIntegrationsBrandingRequest } from './operations/getintegrationsbranding'; +export type { DeleteApiKeyRequest } from './operations/deleteapikey'; +export type { GetReadValidationResultsRequest } from './operations/getreadvalidationresults'; +export type { GetCreateUpdateModelOptionsByDataTypeRequest } from './operations/getcreateupdatemodeloptionsbydatatype'; +export type { GetCompanyPushHistoryRequest } from './operations/getcompanypushhistory'; +export type { GetPushOperationRequest } from './operations/getpushoperation'; +export type { GetSupplementalDataConfigurationRequest } from './operations/getsupplementaldataconfiguration'; +export type { ConfigureSupplementalDataRequest } from './operations/configuresupplementaldata'; +export type { GetCustomDataTypeConfigurationRequest } from './operations/getcustomdatatypeconfiguration'; +export type { ConfigureCustomDataTypeRequest } from './operations/configurecustomdatatype'; +export type { RefreshCustomDataTypeRequest } from './operations/refreshcustomdatatype'; +export type { ListCustomDataTypeRecordsRequest } from './operations/listcustomdatatyperecords'; + +export * as operations from './operations'; +export * as shared from './shared'; diff --git a/platform/src/sdk/models/operations/addproduct.ts b/platform/src/sdk/models/operations/addproduct.ts index e40c51754..63f89592e 100644 --- a/platform/src/sdk/models/operations/addproduct.ts +++ b/platform/src/sdk/models/operations/addproduct.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type AddProductRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Human-readable product identifier for a product. - */ - productIdentifier: string; -}; - -/** @internal */ -export type AddProductRequest$Outbound = { - companyId: string; - productIdentifier: string; -}; - -/** @internal */ -export const AddProductRequest$outboundSchema: z.ZodType< - AddProductRequest$Outbound, - z.ZodTypeDef, - AddProductRequest -> = z.object({ - companyId: z.string(), - productIdentifier: z.string(), -}); - -export function addProductRequestToJSON( - addProductRequest: AddProductRequest, -): string { - return JSON.stringify( - AddProductRequest$outboundSchema.parse(addProductRequest), - ); +export interface AddProductRequest { + companyId: string; + productIdentifier: string; } diff --git a/platform/src/sdk/models/operations/configurecustomdatatype.ts b/platform/src/sdk/models/operations/configurecustomdatatype.ts index 11307f880..5ed878f50 100644 --- a/platform/src/sdk/models/operations/configurecustomdatatype.ts +++ b/platform/src/sdk/models/operations/configurecustomdatatype.ts @@ -1,57 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CustomDataTypeConfiguration } from '../shared/customdatatypeconfiguration'; +/* eslint-disable */ -export type ConfigureCustomDataTypeRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; - /** - * Unique identifier for a custom data type. - */ - customDataIdentifier: string; - /** - * Custom data type configuration for the specified platform. - */ - customDataTypeConfiguration?: shared.CustomDataTypeConfiguration | undefined; -}; - -/** @internal */ -export type ConfigureCustomDataTypeRequest$Outbound = { - platformKey: string; - customDataIdentifier: string; - CustomDataTypeConfiguration?: - | shared.CustomDataTypeConfiguration$Outbound - | undefined; -}; - -/** @internal */ -export const ConfigureCustomDataTypeRequest$outboundSchema: z.ZodType< - ConfigureCustomDataTypeRequest$Outbound, - z.ZodTypeDef, - ConfigureCustomDataTypeRequest -> = z.object({ - platformKey: z.string(), - customDataIdentifier: z.string(), - customDataTypeConfiguration: shared.CustomDataTypeConfiguration$outboundSchema - .optional(), -}).transform((v) => { - return remap$(v, { - customDataTypeConfiguration: "CustomDataTypeConfiguration", - }); -}); - -export function configureCustomDataTypeRequestToJSON( - configureCustomDataTypeRequest: ConfigureCustomDataTypeRequest, -): string { - return JSON.stringify( - ConfigureCustomDataTypeRequest$outboundSchema.parse( - configureCustomDataTypeRequest, - ), - ); +export interface ConfigureCustomDataTypeRequest { + platformKey: string; + customDataIdentifier: string; + customDataTypeConfiguration?: CustomDataTypeConfiguration | undefined; } diff --git a/platform/src/sdk/models/operations/configuresupplementaldata.ts b/platform/src/sdk/models/operations/configuresupplementaldata.ts index d17dc21bd..977369c95 100644 --- a/platform/src/sdk/models/operations/configuresupplementaldata.ts +++ b/platform/src/sdk/models/operations/configuresupplementaldata.ts @@ -1,95 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { ClosedEnum } from "../../types/enums.js"; -import * as shared from "../shared/index.js"; +import type { DataType } from '../DataType'; +import type { SupplementalDataConfiguration } from '../shared/supplementaldataconfiguration'; +/* eslint-disable */ -/** - * Data types that support supplemental data - */ -export const DataType = { - ChartOfAccounts: "chartOfAccounts", - Bills: "bills", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - Invoices: "invoices", - Items: "items", - JournalEntries: "journalEntries", - Suppliers: "suppliers", - TaxRates: "taxRates", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePayments: "commerce-payments", - CommercePaymentMethods: "commerce-paymentMethods", - CommerceProducts: "commerce-products", - CommerceProductCategories: "commerce-productCategories", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", -} as const; -/** - * Data types that support supplemental data - */ -export type DataType = ClosedEnum; - -export type ConfigureSupplementalDataRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; - /** - * Supported supplemental data data type. - */ - dataType: DataType; - /** - * The configuration for the specified platform and data type. - */ - supplementalDataConfiguration?: - | shared.SupplementalDataConfiguration - | undefined; -}; - -/** @internal */ -export const DataType$outboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataType); - -/** @internal */ -export type ConfigureSupplementalDataRequest$Outbound = { - platformKey: string; - dataType: string; - SupplementalDataConfiguration?: - | shared.SupplementalDataConfiguration$Outbound - | undefined; -}; - -/** @internal */ -export const ConfigureSupplementalDataRequest$outboundSchema: z.ZodType< - ConfigureSupplementalDataRequest$Outbound, - z.ZodTypeDef, - ConfigureSupplementalDataRequest -> = z.object({ - platformKey: z.string(), - dataType: DataType$outboundSchema, - supplementalDataConfiguration: shared - .SupplementalDataConfiguration$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - supplementalDataConfiguration: "SupplementalDataConfiguration", - }); -}); - -export function configureSupplementalDataRequestToJSON( - configureSupplementalDataRequest: ConfigureSupplementalDataRequest, -): string { - return JSON.stringify( - ConfigureSupplementalDataRequest$outboundSchema.parse( - configureSupplementalDataRequest, - ), - ); +export interface ConfigureSupplementalDataRequest { + platformKey: string; + dataType: DataType; + supplementalDataConfiguration?: SupplementalDataConfiguration | undefined; } diff --git a/platform/src/sdk/models/operations/createconnection.ts b/platform/src/sdk/models/operations/createconnection.ts index dc5bcac12..99117b45a 100644 --- a/platform/src/sdk/models/operations/createconnection.ts +++ b/platform/src/sdk/models/operations/createconnection.ts @@ -1,74 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; +import type { CreateConnectionRequestBody } from './createconnectionrequestbody'; +/* eslint-disable */ -export type CreateConnectionRequestBody = { - /** - * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. - */ - platformKey?: string | undefined; -}; - -export type CreateConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: CreateConnectionRequestBody | undefined; -}; - -/** @internal */ -export type CreateConnectionRequestBody$Outbound = { - platformKey?: string | undefined; -}; - -/** @internal */ -export const CreateConnectionRequestBody$outboundSchema: z.ZodType< - CreateConnectionRequestBody$Outbound, - z.ZodTypeDef, - CreateConnectionRequestBody -> = z.object({ - platformKey: z.string().optional(), -}); - -export function createConnectionRequestBodyToJSON( - createConnectionRequestBody: CreateConnectionRequestBody, -): string { - return JSON.stringify( - CreateConnectionRequestBody$outboundSchema.parse( - createConnectionRequestBody, - ), - ); -} - -/** @internal */ -export type CreateConnectionRequest$Outbound = { - companyId: string; - RequestBody?: CreateConnectionRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateConnectionRequest$outboundSchema: z.ZodType< - CreateConnectionRequest$Outbound, - z.ZodTypeDef, - CreateConnectionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.lazy(() => CreateConnectionRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createConnectionRequestToJSON( - createConnectionRequest: CreateConnectionRequest, -): string { - return JSON.stringify( - CreateConnectionRequest$outboundSchema.parse(createConnectionRequest), - ); +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody | undefined; } diff --git a/platform/src/sdk/models/operations/createconnectionrequestbody.ts b/platform/src/sdk/models/operations/createconnectionrequestbody.ts new file mode 100644 index 000000000..4361f09a5 --- /dev/null +++ b/platform/src/sdk/models/operations/createconnectionrequestbody.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateConnectionRequestBody + */ +export interface CreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +/** + * Check if a given object implements the CreateConnectionRequestBody interface. + */ +export function instanceOfCreateConnectionRequestBody(value: object): value is CreateConnectionRequestBody { + return true; +} + +export function CreateConnectionRequestBodyFromJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyFromJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateConnectionRequestBody { + if (json == null) { + return json; + } + return { + + 'platformKey': json['platformKey'] == null ? undefined : json['platformKey'], + }; +} + +export function CreateConnectionRequestBodyToJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyToJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyToJSONTyped(value?: CreateConnectionRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'platformKey': value['platformKey'], + }; +} + + +export interface ConnectionCreateRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +export interface CreateConnectionCreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} diff --git a/platform/src/sdk/models/operations/deleteapikey.ts b/platform/src/sdk/models/operations/deleteapikey.ts index bdfb45a4d..ef8a7a6ff 100644 --- a/platform/src/sdk/models/operations/deleteapikey.ts +++ b/platform/src/sdk/models/operations/deleteapikey.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteApiKeyRequest = { - /** - * Unique identifier for api key. - */ - apiKeyId: string; -}; - -/** @internal */ -export type DeleteApiKeyRequest$Outbound = { - apiKeyId: string; -}; - -/** @internal */ -export const DeleteApiKeyRequest$outboundSchema: z.ZodType< - DeleteApiKeyRequest$Outbound, - z.ZodTypeDef, - DeleteApiKeyRequest -> = z.object({ - apiKeyId: z.string(), -}); - -export function deleteApiKeyRequestToJSON( - deleteApiKeyRequest: DeleteApiKeyRequest, -): string { - return JSON.stringify( - DeleteApiKeyRequest$outboundSchema.parse(deleteApiKeyRequest), - ); +export interface DeleteApiKeyRequest { + apiKeyId: string; } diff --git a/platform/src/sdk/models/operations/deletecompany.ts b/platform/src/sdk/models/operations/deletecompany.ts index dbe555534..84680d5e6 100644 --- a/platform/src/sdk/models/operations/deletecompany.ts +++ b/platform/src/sdk/models/operations/deletecompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type DeleteCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const DeleteCompanyRequest$outboundSchema: z.ZodType< - DeleteCompanyRequest$Outbound, - z.ZodTypeDef, - DeleteCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function deleteCompanyRequestToJSON( - deleteCompanyRequest: DeleteCompanyRequest, -): string { - return JSON.stringify( - DeleteCompanyRequest$outboundSchema.parse(deleteCompanyRequest), - ); +export interface DeleteCompanyRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/deleteconnection.ts b/platform/src/sdk/models/operations/deleteconnection.ts index 83f759970..9a9aeb05b 100644 --- a/platform/src/sdk/models/operations/deleteconnection.ts +++ b/platform/src/sdk/models/operations/deleteconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type DeleteConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const DeleteConnectionRequest$outboundSchema: z.ZodType< - DeleteConnectionRequest$Outbound, - z.ZodTypeDef, - DeleteConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function deleteConnectionRequestToJSON( - deleteConnectionRequest: DeleteConnectionRequest, -): string { - return JSON.stringify( - DeleteConnectionRequest$outboundSchema.parse(deleteConnectionRequest), - ); +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/platform/src/sdk/models/operations/deletewebhookconsumer.ts b/platform/src/sdk/models/operations/deletewebhookconsumer.ts index 630c1122a..f598b18b6 100644 --- a/platform/src/sdk/models/operations/deletewebhookconsumer.ts +++ b/platform/src/sdk/models/operations/deletewebhookconsumer.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteWebhookConsumerRequest = { - /** - * Unique identifier for the webhook consumer. - */ - webhookId: string; -}; - -/** @internal */ -export type DeleteWebhookConsumerRequest$Outbound = { - webhookId: string; -}; - -/** @internal */ -export const DeleteWebhookConsumerRequest$outboundSchema: z.ZodType< - DeleteWebhookConsumerRequest$Outbound, - z.ZodTypeDef, - DeleteWebhookConsumerRequest -> = z.object({ - webhookId: z.string(), -}); - -export function deleteWebhookConsumerRequestToJSON( - deleteWebhookConsumerRequest: DeleteWebhookConsumerRequest, -): string { - return JSON.stringify( - DeleteWebhookConsumerRequest$outboundSchema.parse( - deleteWebhookConsumerRequest, - ), - ); +export interface DeleteWebhookConsumerRequest { + webhookId: string; } diff --git a/platform/src/sdk/models/operations/getcompany.ts b/platform/src/sdk/models/operations/getcompany.ts index 77734decc..fc2a6e4a5 100644 --- a/platform/src/sdk/models/operations/getcompany.ts +++ b/platform/src/sdk/models/operations/getcompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyRequest$outboundSchema: z.ZodType< - GetCompanyRequest$Outbound, - z.ZodTypeDef, - GetCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyRequestToJSON( - getCompanyRequest: GetCompanyRequest, -): string { - return JSON.stringify( - GetCompanyRequest$outboundSchema.parse(getCompanyRequest), - ); +export interface GetCompanyRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/getcompanyaccesstoken.ts b/platform/src/sdk/models/operations/getcompanyaccesstoken.ts index 6b76f47f2..1ec1601ba 100644 --- a/platform/src/sdk/models/operations/getcompanyaccesstoken.ts +++ b/platform/src/sdk/models/operations/getcompanyaccesstoken.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyAccessTokenRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyAccessTokenRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyAccessTokenRequest$outboundSchema: z.ZodType< - GetCompanyAccessTokenRequest$Outbound, - z.ZodTypeDef, - GetCompanyAccessTokenRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyAccessTokenRequestToJSON( - getCompanyAccessTokenRequest: GetCompanyAccessTokenRequest, -): string { - return JSON.stringify( - GetCompanyAccessTokenRequest$outboundSchema.parse( - getCompanyAccessTokenRequest, - ), - ); +export interface GetCompanyAccessTokenRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/getcompanydatastatus.ts b/platform/src/sdk/models/operations/getcompanydatastatus.ts index f9953a249..b6d2319e0 100644 --- a/platform/src/sdk/models/operations/getcompanydatastatus.ts +++ b/platform/src/sdk/models/operations/getcompanydatastatus.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyDataStatusRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyDataStatusRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyDataStatusRequest$outboundSchema: z.ZodType< - GetCompanyDataStatusRequest$Outbound, - z.ZodTypeDef, - GetCompanyDataStatusRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyDataStatusRequestToJSON( - getCompanyDataStatusRequest: GetCompanyDataStatusRequest, -): string { - return JSON.stringify( - GetCompanyDataStatusRequest$outboundSchema.parse( - getCompanyDataStatusRequest, - ), - ); +export interface GetCompanyDataStatusRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/getcompanypushhistory.ts b/platform/src/sdk/models/operations/getcompanypushhistory.ts index 0e34ee5b0..b8c77f70c 100644 --- a/platform/src/sdk/models/operations/getcompanypushhistory.ts +++ b/platform/src/sdk/models/operations/getcompanypushhistory.ts @@ -1,60 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type GetCompanyPushHistoryRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type GetCompanyPushHistoryRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const GetCompanyPushHistoryRequest$outboundSchema: z.ZodType< - GetCompanyPushHistoryRequest$Outbound, - z.ZodTypeDef, - GetCompanyPushHistoryRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function getCompanyPushHistoryRequestToJSON( - getCompanyPushHistoryRequest: GetCompanyPushHistoryRequest, -): string { - return JSON.stringify( - GetCompanyPushHistoryRequest$outboundSchema.parse( - getCompanyPushHistoryRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface GetCompanyPushHistoryRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/platform/src/sdk/models/operations/getcompanysyncsettings.ts b/platform/src/sdk/models/operations/getcompanysyncsettings.ts index 6fabd765d..c494a6721 100644 --- a/platform/src/sdk/models/operations/getcompanysyncsettings.ts +++ b/platform/src/sdk/models/operations/getcompanysyncsettings.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanySyncSettingsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanySyncSettingsRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanySyncSettingsRequest$outboundSchema: z.ZodType< - GetCompanySyncSettingsRequest$Outbound, - z.ZodTypeDef, - GetCompanySyncSettingsRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanySyncSettingsRequestToJSON( - getCompanySyncSettingsRequest: GetCompanySyncSettingsRequest, -): string { - return JSON.stringify( - GetCompanySyncSettingsRequest$outboundSchema.parse( - getCompanySyncSettingsRequest, - ), - ); +export interface GetCompanySyncSettingsRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/getconnection.ts b/platform/src/sdk/models/operations/getconnection.ts index 126d23b85..0c787e45b 100644 --- a/platform/src/sdk/models/operations/getconnection.ts +++ b/platform/src/sdk/models/operations/getconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetConnectionRequest$outboundSchema: z.ZodType< - GetConnectionRequest$Outbound, - z.ZodTypeDef, - GetConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getConnectionRequestToJSON( - getConnectionRequest: GetConnectionRequest, -): string { - return JSON.stringify( - GetConnectionRequest$outboundSchema.parse(getConnectionRequest), - ); +export interface GetConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/platform/src/sdk/models/operations/getconnectionmanagementaccesstoken.ts b/platform/src/sdk/models/operations/getconnectionmanagementaccesstoken.ts index d77a4d7f6..c83b1449b 100644 --- a/platform/src/sdk/models/operations/getconnectionmanagementaccesstoken.ts +++ b/platform/src/sdk/models/operations/getconnectionmanagementaccesstoken.ts @@ -1,38 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetConnectionManagementAccessTokenRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetConnectionManagementAccessTokenRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetConnectionManagementAccessTokenRequest$outboundSchema: - z.ZodType< - GetConnectionManagementAccessTokenRequest$Outbound, - z.ZodTypeDef, - GetConnectionManagementAccessTokenRequest - > = z.object({ - companyId: z.string(), - }); - -export function getConnectionManagementAccessTokenRequestToJSON( - getConnectionManagementAccessTokenRequest: - GetConnectionManagementAccessTokenRequest, -): string { - return JSON.stringify( - GetConnectionManagementAccessTokenRequest$outboundSchema.parse( - getConnectionManagementAccessTokenRequest, - ), - ); +export interface GetConnectionManagementAccessTokenRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts b/platform/src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts index 2c1cd46ce..68a4a5406 100644 --- a/platform/src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts +++ b/platform/src/sdk/models/operations/getcreateupdatemodeloptionsbydatatype.ts @@ -1,51 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { SchemaDataType } from '../_speakeasy_enums'; +import type { DataType } from '../DataType'; +/* eslint-disable */ -export type GetCreateUpdateModelOptionsByDataTypeRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * The key of a Codat data type. - */ - dataType: shared.SchemaDataType; -}; - -/** @internal */ -export type GetCreateUpdateModelOptionsByDataTypeRequest$Outbound = { - companyId: string; - connectionId: string; - dataType: string; -}; - -/** @internal */ -export const GetCreateUpdateModelOptionsByDataTypeRequest$outboundSchema: - z.ZodType< - GetCreateUpdateModelOptionsByDataTypeRequest$Outbound, - z.ZodTypeDef, - GetCreateUpdateModelOptionsByDataTypeRequest - > = z.object({ - companyId: z.string(), - connectionId: z.string(), - dataType: shared.SchemaDataType$outboundSchema, - }); - -export function getCreateUpdateModelOptionsByDataTypeRequestToJSON( - getCreateUpdateModelOptionsByDataTypeRequest: - GetCreateUpdateModelOptionsByDataTypeRequest, -): string { - return JSON.stringify( - GetCreateUpdateModelOptionsByDataTypeRequest$outboundSchema.parse( - getCreateUpdateModelOptionsByDataTypeRequest, - ), - ); +export interface GetCreateUpdateModelOptionsByDataTypeRequest { + companyId: string; + connectionId: string; + dataType: SchemaDataType; } diff --git a/platform/src/sdk/models/operations/getcustomdatatypeconfiguration.ts b/platform/src/sdk/models/operations/getcustomdatatypeconfiguration.ts index 31b20d15b..d130274f6 100644 --- a/platform/src/sdk/models/operations/getcustomdatatypeconfiguration.ts +++ b/platform/src/sdk/models/operations/getcustomdatatypeconfiguration.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCustomDataTypeConfigurationRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; - /** - * Unique identifier for a custom data type. - */ - customDataIdentifier: string; -}; - -/** @internal */ -export type GetCustomDataTypeConfigurationRequest$Outbound = { - platformKey: string; - customDataIdentifier: string; -}; - -/** @internal */ -export const GetCustomDataTypeConfigurationRequest$outboundSchema: z.ZodType< - GetCustomDataTypeConfigurationRequest$Outbound, - z.ZodTypeDef, - GetCustomDataTypeConfigurationRequest -> = z.object({ - platformKey: z.string(), - customDataIdentifier: z.string(), -}); - -export function getCustomDataTypeConfigurationRequestToJSON( - getCustomDataTypeConfigurationRequest: GetCustomDataTypeConfigurationRequest, -): string { - return JSON.stringify( - GetCustomDataTypeConfigurationRequest$outboundSchema.parse( - getCustomDataTypeConfigurationRequest, - ), - ); +export interface GetCustomDataTypeConfigurationRequest { + platformKey: string; + customDataIdentifier: string; } diff --git a/platform/src/sdk/models/operations/getintegration.ts b/platform/src/sdk/models/operations/getintegration.ts index f7b44cad1..77b97a10e 100644 --- a/platform/src/sdk/models/operations/getintegration.ts +++ b/platform/src/sdk/models/operations/getintegration.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetIntegrationRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; -}; - -/** @internal */ -export type GetIntegrationRequest$Outbound = { - platformKey: string; -}; - -/** @internal */ -export const GetIntegrationRequest$outboundSchema: z.ZodType< - GetIntegrationRequest$Outbound, - z.ZodTypeDef, - GetIntegrationRequest -> = z.object({ - platformKey: z.string(), -}); - -export function getIntegrationRequestToJSON( - getIntegrationRequest: GetIntegrationRequest, -): string { - return JSON.stringify( - GetIntegrationRequest$outboundSchema.parse(getIntegrationRequest), - ); +export interface GetIntegrationRequest { + platformKey: string; } diff --git a/platform/src/sdk/models/operations/getintegrationsbranding.ts b/platform/src/sdk/models/operations/getintegrationsbranding.ts index 7ea6273d9..1c10c490a 100644 --- a/platform/src/sdk/models/operations/getintegrationsbranding.ts +++ b/platform/src/sdk/models/operations/getintegrationsbranding.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetIntegrationsBrandingRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; -}; - -/** @internal */ -export type GetIntegrationsBrandingRequest$Outbound = { - platformKey: string; -}; - -/** @internal */ -export const GetIntegrationsBrandingRequest$outboundSchema: z.ZodType< - GetIntegrationsBrandingRequest$Outbound, - z.ZodTypeDef, - GetIntegrationsBrandingRequest -> = z.object({ - platformKey: z.string(), -}); - -export function getIntegrationsBrandingRequestToJSON( - getIntegrationsBrandingRequest: GetIntegrationsBrandingRequest, -): string { - return JSON.stringify( - GetIntegrationsBrandingRequest$outboundSchema.parse( - getIntegrationsBrandingRequest, - ), - ); +export interface GetIntegrationsBrandingRequest { + platformKey: string; } diff --git a/platform/src/sdk/models/operations/getpulloperation.ts b/platform/src/sdk/models/operations/getpulloperation.ts index 2df9079da..3eda7bf20 100644 --- a/platform/src/sdk/models/operations/getpulloperation.ts +++ b/platform/src/sdk/models/operations/getpulloperation.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetPullOperationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for the dataset that completed its sync. - */ - datasetId: string; -}; - -/** @internal */ -export type GetPullOperationRequest$Outbound = { - companyId: string; - datasetId: string; -}; - -/** @internal */ -export const GetPullOperationRequest$outboundSchema: z.ZodType< - GetPullOperationRequest$Outbound, - z.ZodTypeDef, - GetPullOperationRequest -> = z.object({ - companyId: z.string(), - datasetId: z.string(), -}); - -export function getPullOperationRequestToJSON( - getPullOperationRequest: GetPullOperationRequest, -): string { - return JSON.stringify( - GetPullOperationRequest$outboundSchema.parse(getPullOperationRequest), - ); +export interface GetPullOperationRequest { + companyId: string; + datasetId: string; } diff --git a/platform/src/sdk/models/operations/getpushoperation.ts b/platform/src/sdk/models/operations/getpushoperation.ts index 3a950624c..bb3d4ada9 100644 --- a/platform/src/sdk/models/operations/getpushoperation.ts +++ b/platform/src/sdk/models/operations/getpushoperation.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetPushOperationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Push operation key. - */ - pushOperationKey: string; -}; - -/** @internal */ -export type GetPushOperationRequest$Outbound = { - companyId: string; - pushOperationKey: string; -}; - -/** @internal */ -export const GetPushOperationRequest$outboundSchema: z.ZodType< - GetPushOperationRequest$Outbound, - z.ZodTypeDef, - GetPushOperationRequest -> = z.object({ - companyId: z.string(), - pushOperationKey: z.string(), -}); - -export function getPushOperationRequestToJSON( - getPushOperationRequest: GetPushOperationRequest, -): string { - return JSON.stringify( - GetPushOperationRequest$outboundSchema.parse(getPushOperationRequest), - ); +export interface GetPushOperationRequest { + companyId: string; + pushOperationKey: string; } diff --git a/platform/src/sdk/models/operations/getreadvalidationresults.ts b/platform/src/sdk/models/operations/getreadvalidationresults.ts index 68933c193..71d55c148 100644 --- a/platform/src/sdk/models/operations/getreadvalidationresults.ts +++ b/platform/src/sdk/models/operations/getreadvalidationresults.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetReadValidationResultsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for the dataset that completed its sync. - */ - datasetId: string; -}; - -/** @internal */ -export type GetReadValidationResultsRequest$Outbound = { - companyId: string; - datasetId: string; -}; - -/** @internal */ -export const GetReadValidationResultsRequest$outboundSchema: z.ZodType< - GetReadValidationResultsRequest$Outbound, - z.ZodTypeDef, - GetReadValidationResultsRequest -> = z.object({ - companyId: z.string(), - datasetId: z.string(), -}); - -export function getReadValidationResultsRequestToJSON( - getReadValidationResultsRequest: GetReadValidationResultsRequest, -): string { - return JSON.stringify( - GetReadValidationResultsRequest$outboundSchema.parse( - getReadValidationResultsRequest, - ), - ); +export interface GetReadValidationResultsRequest { + companyId: string; + datasetId: string; } diff --git a/platform/src/sdk/models/operations/getsupplementaldataconfiguration.ts b/platform/src/sdk/models/operations/getsupplementaldataconfiguration.ts index 06a087af2..69fcc0ba4 100644 --- a/platform/src/sdk/models/operations/getsupplementaldataconfiguration.ts +++ b/platform/src/sdk/models/operations/getsupplementaldataconfiguration.ts @@ -1,80 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; +import type { PathParamDataType } from '../_speakeasy_enums'; +/* eslint-disable */ -/** - * Data types that support supplemental data - */ -export const PathParamDataType = { - ChartOfAccounts: "chartOfAccounts", - Bills: "bills", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - Invoices: "invoices", - Items: "items", - JournalEntries: "journalEntries", - Suppliers: "suppliers", - TaxRates: "taxRates", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePayments: "commerce-payments", - CommercePaymentMethods: "commerce-paymentMethods", - CommerceProducts: "commerce-products", - CommerceProductCategories: "commerce-productCategories", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", -} as const; -/** - * Data types that support supplemental data - */ -export type PathParamDataType = ClosedEnum; - -export type GetSupplementalDataConfigurationRequest = { - /** - * A unique 4-letter key to represent a platform in each integration. - */ - platformKey: string; - /** - * Supported supplemental data data type. - */ - dataType: PathParamDataType; -}; - -/** @internal */ -export const PathParamDataType$outboundSchema: z.ZodNativeEnum< - typeof PathParamDataType -> = z.nativeEnum(PathParamDataType); - -/** @internal */ -export type GetSupplementalDataConfigurationRequest$Outbound = { - platformKey: string; - dataType: string; -}; - -/** @internal */ -export const GetSupplementalDataConfigurationRequest$outboundSchema: z.ZodType< - GetSupplementalDataConfigurationRequest$Outbound, - z.ZodTypeDef, - GetSupplementalDataConfigurationRequest -> = z.object({ - platformKey: z.string(), - dataType: PathParamDataType$outboundSchema, -}); - -export function getSupplementalDataConfigurationRequestToJSON( - getSupplementalDataConfigurationRequest: - GetSupplementalDataConfigurationRequest, -): string { - return JSON.stringify( - GetSupplementalDataConfigurationRequest$outboundSchema.parse( - getSupplementalDataConfigurationRequest, - ), - ); +export interface GetSupplementalDataConfigurationRequest { + platformKey: string; + dataType: PathParamDataType; } diff --git a/platform/src/sdk/models/operations/index.ts b/platform/src/sdk/models/operations/index.ts index 182d597cb..b2fc9e8b1 100644 --- a/platform/src/sdk/models/operations/index.ts +++ b/platform/src/sdk/models/operations/index.ts @@ -1,43 +1,47 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./addproduct.js"; -export * from "./configurecustomdatatype.js"; -export * from "./configuresupplementaldata.js"; -export * from "./createconnection.js"; -export * from "./deleteapikey.js"; -export * from "./deletecompany.js"; -export * from "./deleteconnection.js"; -export * from "./deletewebhookconsumer.js"; -export * from "./getcompany.js"; -export * from "./getcompanyaccesstoken.js"; -export * from "./getcompanydatastatus.js"; -export * from "./getcompanypushhistory.js"; -export * from "./getcompanysyncsettings.js"; -export * from "./getconnection.js"; -export * from "./getconnectionmanagementaccesstoken.js"; -export * from "./getcreateupdatemodeloptionsbydatatype.js"; -export * from "./getcustomdatatypeconfiguration.js"; -export * from "./getintegration.js"; -export * from "./getintegrationsbranding.js"; -export * from "./getpulloperation.js"; -export * from "./getpushoperation.js"; -export * from "./getreadvalidationresults.js"; -export * from "./getsupplementaldataconfiguration.js"; -export * from "./listcompanies.js"; -export * from "./listconnections.js"; -export * from "./listcustomdatatyperecords.js"; -export * from "./listintegrations.js"; -export * from "./listpulloperations.js"; -export * from "./refreshcompanydata.js"; -export * from "./refreshcustomdatatype.js"; -export * from "./refreshdatatype.js"; -export * from "./refreshproductdata.js"; -export * from "./removeproduct.js"; -export * from "./replacecompany.js"; -export * from "./setcompanysyncsettings.js"; -export * from "./unlinkconnection.js"; -export * from "./updatecompany.js"; -export * from "./updateconnectionauthorization.js"; -export * from "./updateprofilesyncsettings.js"; +export * from './addproduct'; +export * from './configurecustomdatatype'; +export * from './configuresupplementaldata'; +export * from './createconnection'; +export * from './createconnectionrequestbody'; +export * from './deleteapikey'; +export * from './deletecompany'; +export * from './deleteconnection'; +export * from './deletewebhookconsumer'; +export * from './getcompanyaccesstoken'; +export * from './getcompanydatastatus'; +export * from './getcompanypushhistory'; +export * from './getcompany'; +export * from './getcompanysyncsettings'; +export * from './getconnectionmanagementaccesstoken'; +export * from './getconnection'; +export * from './getcreateupdatemodeloptionsbydatatype'; +export * from './getcustomdatatypeconfiguration'; +export * from './getintegration'; +export * from './getintegrationsbranding'; +export * from './getpulloperation'; +export * from './getpushoperation'; +export * from './getreadvalidationresults'; +export * from './getsupplementaldataconfiguration'; +export * from './listcompanies'; +export * from './listconnections'; +export * from './listcustomdatatyperecords'; +export * from './listintegrations'; +export * from './listpulloperations'; +export * from './refreshcompanydata'; +export * from './refreshcustomdatatype'; +export * from './refreshdatatype'; +export * from './refreshproductdata'; +export * from './refreshproductdatarequestbody'; +export * from './removeproduct'; +export * from './replacecompany'; +export * from './setcompanysyncsettings'; +export * from './setcompanysyncsettingsrequestbody'; +export * from './unlinkconnection'; +export * from './updatecompany'; +export * from './updateconnectionauthorization'; +export * from './updateprofilesyncsettings'; +export { DataType } from '../DataType'; +export { PathParamDataType } from '../_speakeasy_enums'; diff --git a/platform/src/sdk/models/operations/listcompanies.ts b/platform/src/sdk/models/operations/listcompanies.ts index 837a6aae5..939f42b3f 100644 --- a/platform/src/sdk/models/operations/listcompanies.ts +++ b/platform/src/sdk/models/operations/listcompanies.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCompaniesRequest = { - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; - /** - * Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). - */ - tags?: string | undefined; -}; - -/** @internal */ -export type ListCompaniesRequest$Outbound = { - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; - tags?: string | undefined; -}; - -/** @internal */ -export const ListCompaniesRequest$outboundSchema: z.ZodType< - ListCompaniesRequest$Outbound, - z.ZodTypeDef, - ListCompaniesRequest -> = z.object({ - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), - tags: z.string().optional(), -}); - -export function listCompaniesRequestToJSON( - listCompaniesRequest: ListCompaniesRequest, -): string { - return JSON.stringify( - ListCompaniesRequest$outboundSchema.parse(listCompaniesRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; } diff --git a/platform/src/sdk/models/operations/listconnections.ts b/platform/src/sdk/models/operations/listconnections.ts index d1be0d942..47d6ac043 100644 --- a/platform/src/sdk/models/operations/listconnections.ts +++ b/platform/src/sdk/models/operations/listconnections.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListConnectionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListConnectionsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListConnectionsRequest$outboundSchema: z.ZodType< - ListConnectionsRequest$Outbound, - z.ZodTypeDef, - ListConnectionsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listConnectionsRequestToJSON( - listConnectionsRequest: ListConnectionsRequest, -): string { - return JSON.stringify( - ListConnectionsRequest$outboundSchema.parse(listConnectionsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/platform/src/sdk/models/operations/listcustomdatatyperecords.ts b/platform/src/sdk/models/operations/listcustomdatatyperecords.ts index 19ec7d32a..e7ff454e6 100644 --- a/platform/src/sdk/models/operations/listcustomdatatyperecords.ts +++ b/platform/src/sdk/models/operations/listcustomdatatyperecords.ts @@ -1,60 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCustomDataTypeRecordsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a custom data type. - */ - customDataIdentifier: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; -}; - -/** @internal */ -export type ListCustomDataTypeRecordsRequest$Outbound = { - companyId: string; - connectionId: string; - customDataIdentifier: string; - page: number; - pageSize: number; -}; - -/** @internal */ -export const ListCustomDataTypeRecordsRequest$outboundSchema: z.ZodType< - ListCustomDataTypeRecordsRequest$Outbound, - z.ZodTypeDef, - ListCustomDataTypeRecordsRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - customDataIdentifier: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), -}); - -export function listCustomDataTypeRecordsRequestToJSON( - listCustomDataTypeRecordsRequest: ListCustomDataTypeRecordsRequest, -): string { - return JSON.stringify( - ListCustomDataTypeRecordsRequest$outboundSchema.parse( - listCustomDataTypeRecordsRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCustomDataTypeRecordsRequest { + companyId: string; + connectionId: string; + customDataIdentifier: string; + page?: number; + pageSize?: number; } diff --git a/platform/src/sdk/models/operations/listintegrations.ts b/platform/src/sdk/models/operations/listintegrations.ts index 01ba5000f..a75deee14 100644 --- a/platform/src/sdk/models/operations/listintegrations.ts +++ b/platform/src/sdk/models/operations/listintegrations.ts @@ -1,52 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListIntegrationsRequest = { - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListIntegrationsRequest$Outbound = { - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListIntegrationsRequest$outboundSchema: z.ZodType< - ListIntegrationsRequest$Outbound, - z.ZodTypeDef, - ListIntegrationsRequest -> = z.object({ - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listIntegrationsRequestToJSON( - listIntegrationsRequest: ListIntegrationsRequest, -): string { - return JSON.stringify( - ListIntegrationsRequest$outboundSchema.parse(listIntegrationsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListIntegrationsRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/platform/src/sdk/models/operations/listpulloperations.ts b/platform/src/sdk/models/operations/listpulloperations.ts index d12f7bd86..e29c613bf 100644 --- a/platform/src/sdk/models/operations/listpulloperations.ts +++ b/platform/src/sdk/models/operations/listpulloperations.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListPullOperationsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListPullOperationsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListPullOperationsRequest$outboundSchema: z.ZodType< - ListPullOperationsRequest$Outbound, - z.ZodTypeDef, - ListPullOperationsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listPullOperationsRequestToJSON( - listPullOperationsRequest: ListPullOperationsRequest, -): string { - return JSON.stringify( - ListPullOperationsRequest$outboundSchema.parse(listPullOperationsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListPullOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/platform/src/sdk/models/operations/refreshcompanydata.ts b/platform/src/sdk/models/operations/refreshcompanydata.ts index 43671cece..2c7658287 100644 --- a/platform/src/sdk/models/operations/refreshcompanydata.ts +++ b/platform/src/sdk/models/operations/refreshcompanydata.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type RefreshCompanyDataRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type RefreshCompanyDataRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const RefreshCompanyDataRequest$outboundSchema: z.ZodType< - RefreshCompanyDataRequest$Outbound, - z.ZodTypeDef, - RefreshCompanyDataRequest -> = z.object({ - companyId: z.string(), -}); - -export function refreshCompanyDataRequestToJSON( - refreshCompanyDataRequest: RefreshCompanyDataRequest, -): string { - return JSON.stringify( - RefreshCompanyDataRequest$outboundSchema.parse(refreshCompanyDataRequest), - ); +export interface RefreshCompanyDataRequest { + companyId: string; } diff --git a/platform/src/sdk/models/operations/refreshcustomdatatype.ts b/platform/src/sdk/models/operations/refreshcustomdatatype.ts index 410d11966..e6e40d370 100644 --- a/platform/src/sdk/models/operations/refreshcustomdatatype.ts +++ b/platform/src/sdk/models/operations/refreshcustomdatatype.ts @@ -1,48 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type RefreshCustomDataTypeRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a custom data type. - */ - customDataIdentifier: string; -}; - -/** @internal */ -export type RefreshCustomDataTypeRequest$Outbound = { - companyId: string; - connectionId: string; - customDataIdentifier: string; -}; - -/** @internal */ -export const RefreshCustomDataTypeRequest$outboundSchema: z.ZodType< - RefreshCustomDataTypeRequest$Outbound, - z.ZodTypeDef, - RefreshCustomDataTypeRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - customDataIdentifier: z.string(), -}); - -export function refreshCustomDataTypeRequestToJSON( - refreshCustomDataTypeRequest: RefreshCustomDataTypeRequest, -): string { - return JSON.stringify( - RefreshCustomDataTypeRequest$outboundSchema.parse( - refreshCustomDataTypeRequest, - ), - ); +export interface RefreshCustomDataTypeRequest { + companyId: string; + connectionId: string; + customDataIdentifier: string; } diff --git a/platform/src/sdk/models/operations/refreshdatatype.ts b/platform/src/sdk/models/operations/refreshdatatype.ts index 021dcc185..e4db2d8f8 100644 --- a/platform/src/sdk/models/operations/refreshdatatype.ts +++ b/platform/src/sdk/models/operations/refreshdatatype.ts @@ -1,47 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { SchemaDataType } from '../_speakeasy_enums'; +import type { DataType } from '../DataType'; +/* eslint-disable */ -export type RefreshDataTypeRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * The key of a Codat data type. - */ - dataType: shared.SchemaDataType; - /** - * Optionally, provide a data connection id to only queue pull operations on that connection. - */ - connectionId?: string | undefined; -}; - -/** @internal */ -export type RefreshDataTypeRequest$Outbound = { - companyId: string; - dataType: string; - connectionId?: string | undefined; -}; - -/** @internal */ -export const RefreshDataTypeRequest$outboundSchema: z.ZodType< - RefreshDataTypeRequest$Outbound, - z.ZodTypeDef, - RefreshDataTypeRequest -> = z.object({ - companyId: z.string(), - dataType: shared.SchemaDataType$outboundSchema, - connectionId: z.string().optional(), -}); - -export function refreshDataTypeRequestToJSON( - refreshDataTypeRequest: RefreshDataTypeRequest, -): string { - return JSON.stringify( - RefreshDataTypeRequest$outboundSchema.parse(refreshDataTypeRequest), - ); +export interface RefreshDataTypeRequest { + companyId: string; + dataType: SchemaDataType; + connectionId?: string; } diff --git a/platform/src/sdk/models/operations/refreshproductdata.ts b/platform/src/sdk/models/operations/refreshproductdata.ts index 8636ba525..cf0b429c7 100644 --- a/platform/src/sdk/models/operations/refreshproductdata.ts +++ b/platform/src/sdk/models/operations/refreshproductdata.ts @@ -1,86 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; +import type { RefreshProductDataRequestBody } from './refreshproductdatarequestbody'; +/* eslint-disable */ -/** - * Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product. - */ -export type RefreshProductDataRequestBody = { - /** - * One or more data types to refresh for the product. - */ - dataTypes?: Array | undefined; -}; - -export type RefreshProductDataRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Human-readable product identifier for a product. - */ - productIdentifier: string; - /** - * Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product. - */ - requestBody?: RefreshProductDataRequestBody | undefined; -}; - -/** @internal */ -export type RefreshProductDataRequestBody$Outbound = { - dataTypes?: Array | undefined; -}; - -/** @internal */ -export const RefreshProductDataRequestBody$outboundSchema: z.ZodType< - RefreshProductDataRequestBody$Outbound, - z.ZodTypeDef, - RefreshProductDataRequestBody -> = z.object({ - dataTypes: z.array(z.string()).optional(), -}); - -export function refreshProductDataRequestBodyToJSON( - refreshProductDataRequestBody: RefreshProductDataRequestBody, -): string { - return JSON.stringify( - RefreshProductDataRequestBody$outboundSchema.parse( - refreshProductDataRequestBody, - ), - ); -} - -/** @internal */ -export type RefreshProductDataRequest$Outbound = { - companyId: string; - productIdentifier: string; - RequestBody?: RefreshProductDataRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const RefreshProductDataRequest$outboundSchema: z.ZodType< - RefreshProductDataRequest$Outbound, - z.ZodTypeDef, - RefreshProductDataRequest -> = z.object({ - companyId: z.string(), - productIdentifier: z.string(), - requestBody: z.lazy(() => RefreshProductDataRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function refreshProductDataRequestToJSON( - refreshProductDataRequest: RefreshProductDataRequest, -): string { - return JSON.stringify( - RefreshProductDataRequest$outboundSchema.parse(refreshProductDataRequest), - ); +export interface RefreshProductDataRequest { + companyId: string; + productIdentifier: string; + requestBody?: RefreshProductDataRequestBody | undefined; } diff --git a/platform/src/sdk/models/operations/refreshproductdatarequestbody.ts b/platform/src/sdk/models/operations/refreshproductdatarequestbody.ts new file mode 100644 index 000000000..f9262a6c1 --- /dev/null +++ b/platform/src/sdk/models/operations/refreshproductdatarequestbody.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface RefreshProductDataRequestBody + */ +export interface RefreshProductDataRequestBody { + [key: string]: any | any; + /** + * One or more data types to refresh for the product. + * @type {Array} + * @memberof RefreshProductDataRequestBody + */ + dataTypes?: Array; +} + +/** + * Check if a given object implements the RefreshProductDataRequestBody interface. + */ +export function instanceOfRefreshProductDataRequestBody(value: object): value is RefreshProductDataRequestBody { + return true; +} + +export function RefreshProductDataRequestBodyFromJSON(json: any): RefreshProductDataRequestBody { + return RefreshProductDataRequestBodyFromJSONTyped(json, false); +} + +export function RefreshProductDataRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RefreshProductDataRequestBody { + if (json == null) { + return json; + } + return { + + ...json, + 'dataTypes': json['dataTypes'] == null ? undefined : json['dataTypes'], + }; +} + +export function RefreshProductDataRequestBodyToJSON(json: any): RefreshProductDataRequestBody { + return RefreshProductDataRequestBodyToJSONTyped(json, false); +} + +export function RefreshProductDataRequestBodyToJSONTyped(value?: RefreshProductDataRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'dataTypes': value['dataTypes'], + }; +} + + +export interface ProductDataRefreshRequestBody { + [key: string]: any | any; + /** + * One or more data types to refresh for the product. + * @type {Array} + * @memberof RefreshProductDataRequestBody + */ + dataTypes?: Array; +} + +export interface RefreshProductDataRefreshProductDataRequestBody { + [key: string]: any | any; + /** + * One or more data types to refresh for the product. + * @type {Array} + * @memberof RefreshProductDataRequestBody + */ + dataTypes?: Array; +} diff --git a/platform/src/sdk/models/operations/removeproduct.ts b/platform/src/sdk/models/operations/removeproduct.ts index 2cba04535..a0afc77c8 100644 --- a/platform/src/sdk/models/operations/removeproduct.ts +++ b/platform/src/sdk/models/operations/removeproduct.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type RemoveProductRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Human-readable product identifier for a product. - */ - productIdentifier: string; -}; - -/** @internal */ -export type RemoveProductRequest$Outbound = { - companyId: string; - productIdentifier: string; -}; - -/** @internal */ -export const RemoveProductRequest$outboundSchema: z.ZodType< - RemoveProductRequest$Outbound, - z.ZodTypeDef, - RemoveProductRequest -> = z.object({ - companyId: z.string(), - productIdentifier: z.string(), -}); - -export function removeProductRequestToJSON( - removeProductRequest: RemoveProductRequest, -): string { - return JSON.stringify( - RemoveProductRequest$outboundSchema.parse(removeProductRequest), - ); +export interface RemoveProductRequest { + companyId: string; + productIdentifier: string; } diff --git a/platform/src/sdk/models/operations/replacecompany.ts b/platform/src/sdk/models/operations/replacecompany.ts index 5ee35551d..6add5d7c2 100644 --- a/platform/src/sdk/models/operations/replacecompany.ts +++ b/platform/src/sdk/models/operations/replacecompany.ts @@ -1,43 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyRequestBody } from '../shared/companyrequestbody'; +/* eslint-disable */ -export type ReplaceCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyRequestBody?: shared.CompanyRequestBody | undefined; -}; - -/** @internal */ -export type ReplaceCompanyRequest$Outbound = { - companyId: string; - CompanyRequestBody?: shared.CompanyRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const ReplaceCompanyRequest$outboundSchema: z.ZodType< - ReplaceCompanyRequest$Outbound, - z.ZodTypeDef, - ReplaceCompanyRequest -> = z.object({ - companyId: z.string(), - companyRequestBody: shared.CompanyRequestBody$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyRequestBody: "CompanyRequestBody", - }); -}); - -export function replaceCompanyRequestToJSON( - replaceCompanyRequest: ReplaceCompanyRequest, -): string { - return JSON.stringify( - ReplaceCompanyRequest$outboundSchema.parse(replaceCompanyRequest), - ); +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody | undefined; } diff --git a/platform/src/sdk/models/operations/setcompanysyncsettings.ts b/platform/src/sdk/models/operations/setcompanysyncsettings.ts index a966402d8..bae325e03 100644 --- a/platform/src/sdk/models/operations/setcompanysyncsettings.ts +++ b/platform/src/sdk/models/operations/setcompanysyncsettings.ts @@ -1,98 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { SetCompanySyncSettingsRequestBody } from './setcompanysyncsettingsrequestbody'; +/* eslint-disable */ -/** - * Include a `syncSetting` object for each data type. - * - * @remarks - * `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. - */ -export type SetCompanySyncSettingsRequestBody = { - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - settings: Array; - /** - * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). - */ - overridesDefaults?: boolean | undefined; -}; - -export type SetCompanySyncSettingsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Include a `syncSetting` object for each data type. - * - * @remarks - * `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. - */ - requestBody?: SetCompanySyncSettingsRequestBody | undefined; -}; - -/** @internal */ -export type SetCompanySyncSettingsRequestBody$Outbound = { - companyId: string; - settings: Array; - overridesDefaults: boolean; -}; - -/** @internal */ -export const SetCompanySyncSettingsRequestBody$outboundSchema: z.ZodType< - SetCompanySyncSettingsRequestBody$Outbound, - z.ZodTypeDef, - SetCompanySyncSettingsRequestBody -> = z.object({ - companyId: z.string(), - settings: z.array(shared.SyncSetting$outboundSchema), - overridesDefaults: z.boolean().default(true), -}); - -export function setCompanySyncSettingsRequestBodyToJSON( - setCompanySyncSettingsRequestBody: SetCompanySyncSettingsRequestBody, -): string { - return JSON.stringify( - SetCompanySyncSettingsRequestBody$outboundSchema.parse( - setCompanySyncSettingsRequestBody, - ), - ); -} - -/** @internal */ -export type SetCompanySyncSettingsRequest$Outbound = { - companyId: string; - RequestBody?: SetCompanySyncSettingsRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const SetCompanySyncSettingsRequest$outboundSchema: z.ZodType< - SetCompanySyncSettingsRequest$Outbound, - z.ZodTypeDef, - SetCompanySyncSettingsRequest -> = z.object({ - companyId: z.string(), - requestBody: z.lazy(() => SetCompanySyncSettingsRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function setCompanySyncSettingsRequestToJSON( - setCompanySyncSettingsRequest: SetCompanySyncSettingsRequest, -): string { - return JSON.stringify( - SetCompanySyncSettingsRequest$outboundSchema.parse( - setCompanySyncSettingsRequest, - ), - ); +export interface SetCompanySyncSettingsRequest { + companyId: string; + requestBody?: SetCompanySyncSettingsRequestBody | undefined; } diff --git a/platform/src/sdk/models/operations/setcompanysyncsettingsrequestbody.ts b/platform/src/sdk/models/operations/setcompanysyncsettingsrequestbody.ts new file mode 100644 index 000000000..42fc18950 --- /dev/null +++ b/platform/src/sdk/models/operations/setcompanysyncsettingsrequestbody.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +import type { SyncSetting } from '../shared/syncsetting'; +import { + SyncSettingFromJSON, + SyncSettingFromJSONTyped, + SyncSettingToJSON, + SyncSettingToJSONTyped, +} from '../shared/syncsetting'; + +/** + * + * @export + * @interface SetCompanySyncSettingsRequestBody + */ +export interface SetCompanySyncSettingsRequestBody { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SetCompanySyncSettingsRequestBody + */ + companyId: string; + /** + * + * @type {Array} + * @memberof SetCompanySyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SetCompanySyncSettingsRequestBody + */ + overridesDefaults?: boolean; +} + +/** + * Check if a given object implements the SetCompanySyncSettingsRequestBody interface. + */ +export function instanceOfSetCompanySyncSettingsRequestBody(value: object): value is SetCompanySyncSettingsRequestBody { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('settings' in value) || value['settings'] === undefined) return false; + if (!('overridesDefaults' in value) || value['overridesDefaults'] === undefined) return false; + return true; +} + +export function SetCompanySyncSettingsRequestBodyFromJSON(json: any): SetCompanySyncSettingsRequestBody { + return SetCompanySyncSettingsRequestBodyFromJSONTyped(json, false); +} + +export function SetCompanySyncSettingsRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): SetCompanySyncSettingsRequestBody { + if (json == null) { + return json; + } + return { + + 'companyId': json['companyId'], + 'settings': ((json['settings'] as Array).map(SyncSettingFromJSON)), + 'overridesDefaults': json['overridesDefaults'], + }; +} + +export function SetCompanySyncSettingsRequestBodyToJSON(json: any): SetCompanySyncSettingsRequestBody { + return SetCompanySyncSettingsRequestBodyToJSONTyped(json, false); +} + +export function SetCompanySyncSettingsRequestBodyToJSONTyped(value?: SetCompanySyncSettingsRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyId': value['companyId'], + 'settings': ((value['settings'] as Array).map(SyncSettingToJSON)), + 'overridesDefaults': value['overridesDefaults'], + }; +} + + +export interface CompanySyncSettingsSetRequestBody { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SetCompanySyncSettingsRequestBody + */ + companyId: string; + /** + * + * @type {Array} + * @memberof SetCompanySyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SetCompanySyncSettingsRequestBody + */ + overridesDefaults: boolean; +} + +export interface SetCompanySyncSettingsSetCompanySyncSettingsRequestBody { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SetCompanySyncSettingsRequestBody + */ + companyId: string; + /** + * + * @type {Array} + * @memberof SetCompanySyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SetCompanySyncSettingsRequestBody + */ + overridesDefaults: boolean; +} diff --git a/platform/src/sdk/models/operations/unlinkconnection.ts b/platform/src/sdk/models/operations/unlinkconnection.ts index 87a6113ed..ba89ed84b 100644 --- a/platform/src/sdk/models/operations/unlinkconnection.ts +++ b/platform/src/sdk/models/operations/unlinkconnection.ts @@ -1,50 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { UpdateConnectionStatus } from '../shared/updateconnectionstatus'; +/* eslint-disable */ -export type UnlinkConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - updateConnectionStatus?: shared.UpdateConnectionStatus | undefined; -}; - -/** @internal */ -export type UnlinkConnectionRequest$Outbound = { - companyId: string; - connectionId: string; - UpdateConnectionStatus?: shared.UpdateConnectionStatus$Outbound | undefined; -}; - -/** @internal */ -export const UnlinkConnectionRequest$outboundSchema: z.ZodType< - UnlinkConnectionRequest$Outbound, - z.ZodTypeDef, - UnlinkConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - updateConnectionStatus: shared.UpdateConnectionStatus$outboundSchema - .optional(), -}).transform((v) => { - return remap$(v, { - updateConnectionStatus: "UpdateConnectionStatus", - }); -}); - -export function unlinkConnectionRequestToJSON( - unlinkConnectionRequest: UnlinkConnectionRequest, -): string { - return JSON.stringify( - UnlinkConnectionRequest$outboundSchema.parse(unlinkConnectionRequest), - ); +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + updateConnectionStatus?: UpdateConnectionStatus | undefined; } diff --git a/platform/src/sdk/models/operations/updatecompany.ts b/platform/src/sdk/models/operations/updatecompany.ts index 37ead4428..618928d50 100644 --- a/platform/src/sdk/models/operations/updatecompany.ts +++ b/platform/src/sdk/models/operations/updatecompany.ts @@ -1,43 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyUpdateRequest } from '../shared/companyupdaterequest'; +/* eslint-disable */ -export type UpdateCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyUpdateRequest?: shared.CompanyUpdateRequest | undefined; -}; - -/** @internal */ -export type UpdateCompanyRequest$Outbound = { - companyId: string; - CompanyUpdateRequest?: shared.CompanyUpdateRequest$Outbound | undefined; -}; - -/** @internal */ -export const UpdateCompanyRequest$outboundSchema: z.ZodType< - UpdateCompanyRequest$Outbound, - z.ZodTypeDef, - UpdateCompanyRequest -> = z.object({ - companyId: z.string(), - companyUpdateRequest: shared.CompanyUpdateRequest$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyUpdateRequest: "CompanyUpdateRequest", - }); -}); +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; +} -export function updateCompanyRequestToJSON( - updateCompanyRequest: UpdateCompanyRequest, -): string { - return JSON.stringify( - UpdateCompanyRequest$outboundSchema.parse(updateCompanyRequest), - ); +export interface CompanyUpdateRequestUpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; } diff --git a/platform/src/sdk/models/operations/updateconnectionauthorization.ts b/platform/src/sdk/models/operations/updateconnectionauthorization.ts index b196a24aa..1008876ee 100644 --- a/platform/src/sdk/models/operations/updateconnectionauthorization.ts +++ b/platform/src/sdk/models/operations/updateconnectionauthorization.ts @@ -1,50 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type UpdateConnectionAuthorizationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type UpdateConnectionAuthorizationRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: { [k: string]: string } | undefined; -}; +export interface UpdateConnectionAuthorizationRequest { + companyId: string; + connectionId: string; + requestBody?: any | undefined; +} -/** @internal */ -export const UpdateConnectionAuthorizationRequest$outboundSchema: z.ZodType< - UpdateConnectionAuthorizationRequest$Outbound, - z.ZodTypeDef, - UpdateConnectionAuthorizationRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.record(z.string()).optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); +export interface ConnectionAuthorizationUpdateRequestBody { + companyId: string; + connectionId: string; + requestBody?: any | undefined; +} -export function updateConnectionAuthorizationRequestToJSON( - updateConnectionAuthorizationRequest: UpdateConnectionAuthorizationRequest, -): string { - return JSON.stringify( - UpdateConnectionAuthorizationRequest$outboundSchema.parse( - updateConnectionAuthorizationRequest, - ), - ); +export interface UpdateConnectionAuthorizationRequestBody { + companyId: string; + connectionId: string; + requestBody?: any | undefined; } diff --git a/platform/src/sdk/models/operations/updateprofilesyncsettings.ts b/platform/src/sdk/models/operations/updateprofilesyncsettings.ts index 0f33ccee6..1b5fdd159 100644 --- a/platform/src/sdk/models/operations/updateprofilesyncsettings.ts +++ b/platform/src/sdk/models/operations/updateprofilesyncsettings.ts @@ -1,52 +1,134 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import { mapValues } from '../../../runtime'; +import type { SyncSetting } from '../shared/syncsetting'; +import { + SyncSettingFromJSON, + SyncSettingFromJSONTyped, + SyncSettingToJSON, + SyncSettingToJSONTyped, +} from '../shared/syncsetting'; /** - * Include a `syncSetting` object for each data type. - * - * @remarks - * `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. + * + * @export + * @interface UpdateProfileSyncSettingsRequestBody */ -export type UpdateProfileSyncSettingsRequestBody = { - /** - * Unique identifier for your client in Codat. - */ - clientId: string; - settings: Array; - /** - * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). - */ - overridesDefaults?: boolean | undefined; -}; - -/** @internal */ -export type UpdateProfileSyncSettingsRequestBody$Outbound = { - clientId: string; - settings: Array; - overridesDefaults: boolean; -}; - -/** @internal */ -export const UpdateProfileSyncSettingsRequestBody$outboundSchema: z.ZodType< - UpdateProfileSyncSettingsRequestBody$Outbound, - z.ZodTypeDef, - UpdateProfileSyncSettingsRequestBody -> = z.object({ - clientId: z.string(), - settings: z.array(shared.SyncSetting$outboundSchema), - overridesDefaults: z.boolean().default(true), -}); - -export function updateProfileSyncSettingsRequestBodyToJSON( - updateProfileSyncSettingsRequestBody: UpdateProfileSyncSettingsRequestBody, -): string { - return JSON.stringify( - UpdateProfileSyncSettingsRequestBody$outboundSchema.parse( - updateProfileSyncSettingsRequestBody, - ), - ); +export interface UpdateProfileSyncSettingsRequestBody { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + clientId: string; + /** + * + * @type {Array} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + overridesDefaults?: boolean; +} + +/** + * Check if a given object implements the UpdateProfileSyncSettingsRequestBody interface. + */ +export function instanceOfUpdateProfileSyncSettingsRequestBody(value: object): value is UpdateProfileSyncSettingsRequestBody { + if (!('clientId' in value) || value['clientId'] === undefined) return false; + if (!('settings' in value) || value['settings'] === undefined) return false; + if (!('overridesDefaults' in value) || value['overridesDefaults'] === undefined) return false; + return true; +} + +export function UpdateProfileSyncSettingsRequestBodyFromJSON(json: any): UpdateProfileSyncSettingsRequestBody { + return UpdateProfileSyncSettingsRequestBodyFromJSONTyped(json, false); +} + +export function UpdateProfileSyncSettingsRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateProfileSyncSettingsRequestBody { + if (json == null) { + return json; + } + return { + + 'clientId': json['clientId'], + 'settings': ((json['settings'] as Array).map(SyncSettingFromJSON)), + 'overridesDefaults': json['overridesDefaults'], + }; +} + +export function UpdateProfileSyncSettingsRequestBodyToJSON(json: any): UpdateProfileSyncSettingsRequestBody { + return UpdateProfileSyncSettingsRequestBodyToJSONTyped(json, false); +} + +export function UpdateProfileSyncSettingsRequestBodyToJSONTyped(value?: UpdateProfileSyncSettingsRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'clientId': value['clientId'], + 'settings': ((value['settings'] as Array).map(SyncSettingToJSON)), + 'overridesDefaults': value['overridesDefaults'], + }; +} + + +export interface ProfileSyncSettingsUpdateRequestBody { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + clientId: string; + /** + * + * @type {Array} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + overridesDefaults: boolean; +} + +export interface UpdateProfileSyncSettingsUpdateProfileSyncSettingsRequestBody { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + clientId: string; + /** + * + * @type {Array} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + settings: Array; + /** + * Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof UpdateProfileSyncSettingsRequestBody + */ + overridesDefaults: boolean; } diff --git a/platform/src/sdk/models/shared/apikeydetails.ts b/platform/src/sdk/models/shared/apikeydetails.ts index f72afdc77..f89cc3e65 100644 --- a/platform/src/sdk/models/shared/apikeydetails.ts +++ b/platform/src/sdk/models/shared/apikeydetails.ts @@ -1,70 +1,737 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; /** * Details of the API key. + * @export + * @interface ApiKeyDetails + */ +export interface ApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +/** + * Check if a given object implements the ApiKeyDetails interface. */ -export type ApiKeyDetails = { - /** - * Unique identifier for the API key. - */ - id?: string | undefined; - /** - * A meaningful name assigned to the API key. - */ - name?: string | null | undefined; - /** - * The API key value used to make authenticated http requests. - */ - apiKey?: 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. - */ - createdDate?: string | undefined; -}; - -/** @internal */ -export const ApiKeyDetails$inboundSchema: z.ZodType< - ApiKeyDetails, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.nullable(z.string()).optional(), - apiKey: z.string().optional(), - createdDate: z.string().optional(), -}); - -export function apiKeyDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ApiKeyDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ApiKeyDetails' from JSON`, - ); +export function instanceOfApiKeyDetails(value: object): value is ApiKeyDetails { + return true; +} + +export function ApiKeyDetailsFromJSON(json: any): ApiKeyDetails { + return ApiKeyDetailsFromJSONTyped(json, false); +} + +export function ApiKeyDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeyDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'apiKey': json['apiKey'] == null ? undefined : json['apiKey'], + 'createdDate': json['createdDate'] == null ? undefined : json['createdDate'], + }; +} + +export function ApiKeyDetailsToJSON(json: any): ApiKeyDetails { + return ApiKeyDetailsToJSONTyped(json, false); +} + +export function ApiKeyDetailsToJSONTyped(value?: ApiKeyDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'apiKey': value['apiKey'], + 'createdDate': value['createdDate'], + }; +} + + +export interface APIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface APIKeysAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface APIKeysApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeyCreateResponseAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeyCreateResponseApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeyDetailsAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeysAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeysApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeysListResponseAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ApiKeysListResponseApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface CreateApiKeyResponseAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface CreateApiKeyResponseApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ListApiKeysResponseAPIKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; +} + +export interface ListApiKeysResponseApiKeyDetails { + /** + * Unique identifier for the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof ApiKeyDetails + */ + name?: string | null; + /** + * The API key value used to make authenticated http requests. + * @type {string} + * @memberof ApiKeyDetails + */ + apiKey?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ApiKeyDetails + */ + createdDate?: string; } diff --git a/platform/src/sdk/models/shared/apikeys.ts b/platform/src/sdk/models/shared/apikeys.ts index 3985195f8..35523e562 100644 --- a/platform/src/sdk/models/shared/apikeys.ts +++ b/platform/src/sdk/models/shared/apikeys.ts @@ -1,29 +1,127 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { ApiKeyDetails, ApiKeyDetails$inboundSchema } from "./apikeydetails.js"; - -export type ApiKeys = { - results?: Array | undefined; -}; - -/** @internal */ -export const ApiKeys$inboundSchema: z.ZodType = - z.object({ - results: z.array(z.nullable(ApiKeyDetails$inboundSchema)).optional(), - }); - -export function apiKeysFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ApiKeys$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ApiKeys' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { ApiKeyDetails } from './apikeydetails'; +import { + ApiKeyDetailsFromJSON, + ApiKeyDetailsFromJSONTyped, + ApiKeyDetailsToJSON, + ApiKeyDetailsToJSONTyped, +} from './apikeydetails'; + +/** + * + * @export + * @interface ApiKeys + */ +export interface ApiKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +/** + * Check if a given object implements the ApiKeys interface. + */ +export function instanceOfApiKeys(value: object): value is ApiKeys { + return true; +} + +export function ApiKeysFromJSON(json: any): ApiKeys { + return ApiKeysFromJSONTyped(json, false); +} + +export function ApiKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeys { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(ApiKeyDetailsFromJSON)), + }; +} + +export function ApiKeysToJSON(json: any): ApiKeys { + return ApiKeysToJSONTyped(json, false); +} + +export function ApiKeysToJSONTyped(value?: ApiKeys | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(ApiKeyDetailsToJSON)), + }; +} + + +export interface APIKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +export interface ApiKeysAPIKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +export interface ApiKeysListResponseAPIKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +export interface ApiKeysListResponseApiKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +export interface ListApiKeysResponseAPIKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; +} + +export interface ListApiKeysResponseApiKeys { + /** + * + * @type {Array} + * @memberof ApiKeys + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/branding.ts b/platform/src/sdk/models/shared/branding.ts index f38d76637..daee2250a 100644 --- a/platform/src/sdk/models/shared/branding.ts +++ b/platform/src/sdk/models/shared/branding.ts @@ -1,49 +1,138 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { BrandingButton } from './brandingbutton'; import { - BrandingButton, - BrandingButton$inboundSchema, -} from "./brandingbutton.js"; -import { BrandingLogo, BrandingLogo$inboundSchema } from "./brandinglogo.js"; - -export type Branding = { - /** - * Logo branding references. - */ - logo?: BrandingLogo | undefined; - /** - * Button branding references. - */ - button?: BrandingButton | undefined; - /** - * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. - */ - sourceId?: string | undefined; -}; - -/** @internal */ -export const Branding$inboundSchema: z.ZodType< - Branding, - z.ZodTypeDef, - unknown -> = z.object({ - logo: BrandingLogo$inboundSchema.optional(), - button: BrandingButton$inboundSchema.optional(), - sourceId: z.string().optional(), -}); - -export function brandingFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Branding$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Branding' from JSON`, - ); + BrandingButtonFromJSON, + BrandingButtonFromJSONTyped, + BrandingButtonToJSON, + BrandingButtonToJSONTyped, +} from './brandingbutton'; +import type { BrandingLogo } from './brandinglogo'; +import { + BrandingLogoFromJSON, + BrandingLogoFromJSONTyped, + BrandingLogoToJSON, + BrandingLogoToJSONTyped, +} from './brandinglogo'; + +/** + * + * @export + * @interface Branding + */ +export interface Branding { + /** + * + * @type {BrandingLogo} + * @memberof Branding + */ + logo?: BrandingLogo; + /** + * + * @type {BrandingButton} + * @memberof Branding + */ + button?: BrandingButton; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Branding + */ + sourceId?: string; +} + +/** + * Check if a given object implements the Branding interface. + */ +export function instanceOfBranding(value: object): value is Branding { + return true; +} + +export function BrandingFromJSON(json: any): Branding { + return BrandingFromJSONTyped(json, false); +} + +export function BrandingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Branding { + if (json == null) { + return json; + } + return { + + 'logo': json['logo'] == null ? undefined : BrandingLogoFromJSON(json['logo']), + 'button': json['button'] == null ? undefined : BrandingButtonFromJSON(json['button']), + 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'], + }; +} + +export function BrandingToJSON(json: any): Branding { + return BrandingToJSONTyped(json, false); +} + +export function BrandingToJSONTyped(value?: Branding | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'logo': BrandingLogoToJSON(value['logo']), + 'button': BrandingButtonToJSON(value['button']), + 'sourceId': value['sourceId'], + }; +} + + +export interface GetIntegrationsBrandingResponseBranding { + /** + * + * @type {BrandingLogo} + * @memberof Branding + */ + logo?: BrandingLogo; + /** + * + * @type {BrandingButton} + * @memberof Branding + */ + button?: BrandingButton; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Branding + */ + sourceId?: string; +} + +export interface IntegrationsBrandingGetResponseBranding { + /** + * + * @type {BrandingLogo} + * @memberof Branding + */ + logo?: BrandingLogo; + /** + * + * @type {BrandingButton} + * @memberof Branding + */ + button?: BrandingButton; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Branding + */ + sourceId?: string; } diff --git a/platform/src/sdk/models/shared/brandingbutton.ts b/platform/src/sdk/models/shared/brandingbutton.ts index 1f9a4dfad..41ebe13df 100644 --- a/platform/src/sdk/models/shared/brandingbutton.ts +++ b/platform/src/sdk/models/shared/brandingbutton.ts @@ -1,37 +1,126 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { BrandingImage, BrandingImage$inboundSchema } from "./brandingimage.js"; +import { mapValues } from '../../../runtime'; +import type { BrandingImage } from './brandingimage'; +import { + BrandingImageFromJSON, + BrandingImageFromJSONTyped, + BrandingImageToJSON, + BrandingImageToJSONTyped, +} from './brandingimage'; /** * Button branding references. + * @export + * @interface BrandingButton + */ +export interface BrandingButton { + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + default?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + hover?: BrandingImage; +} + +/** + * Check if a given object implements the BrandingButton interface. */ -export type BrandingButton = { - default?: BrandingImage | undefined; - hover?: BrandingImage | undefined; -}; - -/** @internal */ -export const BrandingButton$inboundSchema: z.ZodType< - BrandingButton, - z.ZodTypeDef, - unknown -> = z.object({ - default: BrandingImage$inboundSchema.optional(), - hover: BrandingImage$inboundSchema.optional(), -}); - -export function brandingButtonFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BrandingButton$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BrandingButton' from JSON`, - ); +export function instanceOfBrandingButton(value: object): value is BrandingButton { + return true; +} + +export function BrandingButtonFromJSON(json: any): BrandingButton { + return BrandingButtonFromJSONTyped(json, false); +} + +export function BrandingButtonFromJSONTyped(json: any, ignoreDiscriminator: boolean): BrandingButton { + if (json == null) { + return json; + } + return { + + 'default': json['default'] == null ? undefined : BrandingImageFromJSON(json['default']), + 'hover': json['hover'] == null ? undefined : BrandingImageFromJSON(json['hover']), + }; +} + +export function BrandingButtonToJSON(json: any): BrandingButton { + return BrandingButtonToJSONTyped(json, false); +} + +export function BrandingButtonToJSONTyped(value?: BrandingButton | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'default': BrandingImageToJSON(value['default']), + 'hover': BrandingImageToJSON(value['hover']), + }; +} + + +export interface BrandingBrandingButton { + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + default?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + hover?: BrandingImage; +} + +export interface GetIntegrationsBrandingResponseBrandingButton { + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + default?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + hover?: BrandingImage; +} + +export interface IntegrationsBrandingGetResponseBrandingButton { + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + default?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingButton + */ + hover?: BrandingImage; } diff --git a/platform/src/sdk/models/shared/brandingimage.ts b/platform/src/sdk/models/shared/brandingimage.ts index 5ca98b079..3a22dfd0e 100644 --- a/platform/src/sdk/models/shared/brandingimage.ts +++ b/platform/src/sdk/models/shared/brandingimage.ts @@ -1,38 +1,100 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ImageReference } from './imagereference'; import { - ImageReference, - ImageReference$inboundSchema, -} from "./imagereference.js"; - -export type BrandingImage = { - /** - * Image reference. - */ - image?: ImageReference | undefined; -}; - -/** @internal */ -export const BrandingImage$inboundSchema: z.ZodType< - BrandingImage, - z.ZodTypeDef, - unknown -> = z.object({ - image: ImageReference$inboundSchema.optional(), -}); - -export function brandingImageFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BrandingImage$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BrandingImage' from JSON`, - ); + ImageReferenceFromJSON, + ImageReferenceFromJSONTyped, + ImageReferenceToJSON, + ImageReferenceToJSONTyped, +} from './imagereference'; + +/** + * + * @export + * @interface BrandingImage + */ +export interface BrandingImage { + /** + * + * @type {ImageReference} + * @memberof BrandingImage + */ + image?: ImageReference; +} + +/** + * Check if a given object implements the BrandingImage interface. + */ +export function instanceOfBrandingImage(value: object): value is BrandingImage { + return true; +} + +export function BrandingImageFromJSON(json: any): BrandingImage { + return BrandingImageFromJSONTyped(json, false); +} + +export function BrandingImageFromJSONTyped(json: any, ignoreDiscriminator: boolean): BrandingImage { + if (json == null) { + return json; + } + return { + + 'image': json['image'] == null ? undefined : ImageReferenceFromJSON(json['image']), + }; +} + +export function BrandingImageToJSON(json: any): BrandingImage { + return BrandingImageToJSONTyped(json, false); +} + +export function BrandingImageToJSONTyped(value?: BrandingImage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'image': ImageReferenceToJSON(value['image']), + }; +} + + +export interface BrandingBrandingImage { + /** + * + * @type {ImageReference} + * @memberof BrandingImage + */ + image?: ImageReference; +} + +export interface GetIntegrationsBrandingResponseBrandingImage { + /** + * + * @type {ImageReference} + * @memberof BrandingImage + */ + image?: ImageReference; +} + +export interface IntegrationsBrandingGetResponseBrandingImage { + /** + * + * @type {ImageReference} + * @memberof BrandingImage + */ + image?: ImageReference; } diff --git a/platform/src/sdk/models/shared/brandinglogo.ts b/platform/src/sdk/models/shared/brandinglogo.ts index 1a8fe7ee8..4bec2953d 100644 --- a/platform/src/sdk/models/shared/brandinglogo.ts +++ b/platform/src/sdk/models/shared/brandinglogo.ts @@ -1,37 +1,126 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { BrandingImage, BrandingImage$inboundSchema } from "./brandingimage.js"; +import { mapValues } from '../../../runtime'; +import type { BrandingImage } from './brandingimage'; +import { + BrandingImageFromJSON, + BrandingImageFromJSONTyped, + BrandingImageToJSON, + BrandingImageToJSONTyped, +} from './brandingimage'; /** * Logo branding references. + * @export + * @interface BrandingLogo + */ +export interface BrandingLogo { + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + full?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + square?: BrandingImage; +} + +/** + * Check if a given object implements the BrandingLogo interface. */ -export type BrandingLogo = { - full?: BrandingImage | undefined; - square?: BrandingImage | undefined; -}; - -/** @internal */ -export const BrandingLogo$inboundSchema: z.ZodType< - BrandingLogo, - z.ZodTypeDef, - unknown -> = z.object({ - full: BrandingImage$inboundSchema.optional(), - square: BrandingImage$inboundSchema.optional(), -}); - -export function brandingLogoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BrandingLogo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BrandingLogo' from JSON`, - ); +export function instanceOfBrandingLogo(value: object): value is BrandingLogo { + return true; +} + +export function BrandingLogoFromJSON(json: any): BrandingLogo { + return BrandingLogoFromJSONTyped(json, false); +} + +export function BrandingLogoFromJSONTyped(json: any, ignoreDiscriminator: boolean): BrandingLogo { + if (json == null) { + return json; + } + return { + + 'full': json['full'] == null ? undefined : BrandingImageFromJSON(json['full']), + 'square': json['square'] == null ? undefined : BrandingImageFromJSON(json['square']), + }; +} + +export function BrandingLogoToJSON(json: any): BrandingLogo { + return BrandingLogoToJSONTyped(json, false); +} + +export function BrandingLogoToJSONTyped(value?: BrandingLogo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'full': BrandingImageToJSON(value['full']), + 'square': BrandingImageToJSON(value['square']), + }; +} + + +export interface BrandingBrandingLogo { + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + full?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + square?: BrandingImage; +} + +export interface GetIntegrationsBrandingResponseBrandingLogo { + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + full?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + square?: BrandingImage; +} + +export interface IntegrationsBrandingGetResponseBrandingLogo { + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + full?: BrandingImage; + /** + * + * @type {BrandingImage} + * @memberof BrandingLogo + */ + square?: BrandingImage; } diff --git a/platform/src/sdk/models/shared/clientratelimitwebhook.ts b/platform/src/sdk/models/shared/clientratelimitwebhook.ts index cdc40c0b8..92ce3bcf4 100644 --- a/platform/src/sdk/models/shared/clientratelimitwebhook.ts +++ b/platform/src/sdk/models/shared/clientratelimitwebhook.ts @@ -1,96 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ClientRateLimitWebhookPayload } from './clientratelimitwebhookpayload'; import { - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayload$inboundSchema, - ClientRateLimitWebhookPayload$Outbound, - ClientRateLimitWebhookPayload$outboundSchema, -} from "./clientratelimitwebhookpayload.js"; + ClientRateLimitWebhookPayloadFromJSON, + ClientRateLimitWebhookPayloadFromJSONTyped, + ClientRateLimitWebhookPayloadToJSON, + ClientRateLimitWebhookPayloadToJSONTyped, +} from './clientratelimitwebhookpayload'; -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; -}; +/** + * + * @export + * @interface ClientRateLimitWebhook + */ +export interface ClientRateLimitWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + generatedDate?: string; + /** + * + * @type {ClientRateLimitWebhookPayload} + * @memberof ClientRateLimitWebhook + */ + payload?: ClientRateLimitWebhookPayload; +} + +/** + * Check if a given object implements the ClientRateLimitWebhook interface. + */ +export function instanceOfClientRateLimitWebhook(value: object): value is ClientRateLimitWebhook { + return true; +} -/** @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; -}; +export function ClientRateLimitWebhookFromJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookFromJSONTyped(json, false); +} -/** @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 ClientRateLimitWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ClientRateLimitWebhookPayloadFromJSON(json['payload']), + }; +} -export function clientRateLimitWebhookToJSON( - clientRateLimitWebhook: ClientRateLimitWebhook, -): string { - return JSON.stringify( - ClientRateLimitWebhook$outboundSchema.parse(clientRateLimitWebhook), - ); +export function ClientRateLimitWebhookToJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookToJSONTyped(json, false); } -export function clientRateLimitWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhook' from JSON`, - ); + +export function ClientRateLimitWebhookToJSONTyped(value?: ClientRateLimitWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ClientRateLimitWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts b/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts index 72605d624..1e7d0efd6 100644 --- a/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts +++ b/platform/src/sdk/models/shared/clientratelimitwebhookpayload.ts @@ -1,88 +1,138 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ClientRateLimitWebhookPayload + */ +export interface ClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * 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. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; +} -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; -}; +/** + * Check if a given object implements the ClientRateLimitWebhookPayload interface. + */ +export function instanceOfClientRateLimitWebhookPayload(value: object): value is ClientRateLimitWebhookPayload { + return true; +} -/** @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; -}; +export function ClientRateLimitWebhookPayloadFromJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadFromJSONTyped(json, false); +} -/** @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 ClientRateLimitWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhookPayload { + if (json == null) { + return json; + } + return { + + 'dailyQuota': json['dailyQuota'] == null ? undefined : json['dailyQuota'], + 'quotaRemaining': json['quotaRemaining'] == null ? undefined : json['quotaRemaining'], + 'expiryDate': json['expiryDate'] == null ? undefined : json['expiryDate'], + }; +} -export function clientRateLimitWebhookPayloadToJSON( - clientRateLimitWebhookPayload: ClientRateLimitWebhookPayload, -): string { - return JSON.stringify( - ClientRateLimitWebhookPayload$outboundSchema.parse( - clientRateLimitWebhookPayload, - ), - ); +export function ClientRateLimitWebhookPayloadToJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadToJSONTyped(json, false); } -export function clientRateLimitWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhookPayload' from JSON`, - ); + +export function ClientRateLimitWebhookPayloadToJSONTyped(value?: ClientRateLimitWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dailyQuota': value['dailyQuota'], + 'quotaRemaining': value['quotaRemaining'], + 'expiryDate': value['expiryDate'], + }; +} + + +export interface ClientRateLimitWebhookClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * 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. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; } diff --git a/platform/src/sdk/models/shared/companies.ts b/platform/src/sdk/models/shared/companies.ts index 0f308542e..9ef58c005 100644 --- a/platform/src/sdk/models/shared/companies.ts +++ b/platform/src/sdk/models/shared/companies.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Company, Company$inboundSchema } from "./company.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Companies = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Companies$inboundSchema: z.ZodType< - Companies, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Company$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function companiesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Companies$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Companies' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Company } from './company'; +import { + CompanyFromJSON, + CompanyFromJSONTyped, + CompanyToJSON, + CompanyToJSONTyped, +} from './company'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Companies + */ +export interface Companies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +/** + * Check if a given object implements the Companies interface. + */ +export function instanceOfCompanies(value: object): value is Companies { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function CompaniesFromJSON(json: any): Companies { + return CompaniesFromJSONTyped(json, false); +} + +export function CompaniesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Companies { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CompanyFromJSON)), + }; +} + +export function CompaniesToJSON(json: any): Companies { + return CompaniesToJSONTyped(json, false); +} + +export function CompaniesToJSONTyped(value?: Companies | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CompanyToJSON)), + }; +} + + +export interface CompaniesListResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +export interface ListCompaniesResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/company.ts b/platform/src/sdk/models/shared/company.ts index e48fca2fb..36c2d1fb4 100644 --- a/platform/src/sdk/models/shared/company.ts +++ b/platform/src/sdk/models/shared/company.ts @@ -1,131 +1,1432 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, -} from "./companyreference.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; /** - * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - * - * @remarks - * + * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + * * Typically each company is one of your customers. - * + * * When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + * @export + * @interface Company + */ +export interface Company { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +/** + * Check if a given object implements the Company interface. */ -export type Company = { - /** - * 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; - dataConnections?: Array | undefined; -}; - -/** @internal */ -export const Company$inboundSchema: z.ZodType = - 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(), - dataConnections: z.array(Connection$inboundSchema).optional(), - }); - -export function companyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Company$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Company' from JSON`, - ); +export function instanceOfCompany(value: object): value is Company { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyFromJSON(json: any): Company { + return CompanyFromJSONTyped(json, false); +} + +export function CompanyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Company { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + 'dataConnections': json['dataConnections'] == null ? undefined : ((json['dataConnections'] as Array).map(ConnectionFromJSON)), + }; +} + +export function CompanyToJSON(json: any): Company { + return CompanyToJSONTyped(json, false); +} + +export function CompanyToJSONTyped(value?: Company | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + 'dataConnections': value['dataConnections'] == null ? undefined : ((value['dataConnections'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface CompaniesCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompaniesListResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyCreateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyGetResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyReplaceResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyUpdateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CreateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface GetCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ListCompaniesResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ReplaceCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface UpdateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; } diff --git a/platform/src/sdk/models/shared/companyaccesstoken.ts b/platform/src/sdk/models/shared/companyaccesstoken.ts index 456b27496..5c9581c4b 100644 --- a/platform/src/sdk/models/shared/companyaccesstoken.ts +++ b/platform/src/sdk/models/shared/companyaccesstoken.ts @@ -1,47 +1,126 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; /** * Details of the access token provisioned for a company. + * @export + * @interface CompanyAccessToken + */ +export interface CompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; +} + +/** + * Check if a given object implements the CompanyAccessToken interface. */ -export type CompanyAccessToken = { - /** - * The number of seconds until the access token expires. - */ - expiresIn: number; - /** - * The access token for the company. - */ - accessToken: string; - /** - * The type of token. - */ - tokenType: string; -}; - -/** @internal */ -export const CompanyAccessToken$inboundSchema: z.ZodType< - CompanyAccessToken, - z.ZodTypeDef, - unknown -> = z.object({ - expiresIn: z.number().int(), - accessToken: z.string(), - tokenType: z.string(), -}); - -export function companyAccessTokenFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyAccessToken$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyAccessToken' from JSON`, - ); +export function instanceOfCompanyAccessToken(value: object): value is CompanyAccessToken { + if (!('expiresIn' in value) || value['expiresIn'] === undefined) return false; + if (!('accessToken' in value) || value['accessToken'] === undefined) return false; + if (!('tokenType' in value) || value['tokenType'] === undefined) return false; + return true; +} + +export function CompanyAccessTokenFromJSON(json: any): CompanyAccessToken { + return CompanyAccessTokenFromJSONTyped(json, false); +} + +export function CompanyAccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyAccessToken { + if (json == null) { + return json; + } + return { + + 'expiresIn': json['expiresIn'], + 'accessToken': json['accessToken'], + 'tokenType': json['tokenType'], + }; +} + +export function CompanyAccessTokenToJSON(json: any): CompanyAccessToken { + return CompanyAccessTokenToJSONTyped(json, false); +} + +export function CompanyAccessTokenToJSONTyped(value?: CompanyAccessToken | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'expiresIn': value['expiresIn'], + 'accessToken': value['accessToken'], + 'tokenType': value['tokenType'], + }; +} + + +export interface CompanyAccessTokenGetResponseCompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; +} + +export interface GetCompanyAccessTokenResponseCompanyAccessToken { + /** + * The number of seconds until the access token expires. + * @type {number} + * @memberof CompanyAccessToken + */ + expiresIn: number; + /** + * The access token for the company. + * @type {string} + * @memberof CompanyAccessToken + */ + accessToken: string; + /** + * The type of token. + * @type {string} + * @memberof CompanyAccessToken + */ + tokenType: string; } diff --git a/platform/src/sdk/models/shared/companydetails.ts b/platform/src/sdk/models/shared/companydetails.ts index bf84c6f43..3351aa3d4 100644 --- a/platform/src/sdk/models/shared/companydetails.ts +++ b/platform/src/sdk/models/shared/companydetails.ts @@ -1,161 +1,1557 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; 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`, - ); + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; + +/** + * + * @export + * @interface CompanyDetails + */ +export interface CompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +/** + * Check if a given object implements the CompanyDetails interface. + */ +export function instanceOfCompanyDetails(value: object): value is CompanyDetails { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyDetailsFromJSON(json: any): CompanyDetails { + return CompanyDetailsFromJSONTyped(json, false); +} + +export function CompanyDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + }; +} + +export function CompanyDetailsToJSON(json: any): CompanyDetails { + return CompanyDetailsToJSONTyped(json, false); +} + +export function CompanyDetailsToJSONTyped(value?: CompanyDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + }; +} + + +export interface CompaniesCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompaniesListResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCreateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyGetResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyReplaceResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyUpdateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyWebhookCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CreateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface GetCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ListCompaniesResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ReplaceCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface UpdateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; } diff --git a/platform/src/sdk/models/shared/companyreference.ts b/platform/src/sdk/models/shared/companyreference.ts index e40af5e26..c7c3aff74 100644 --- a/platform/src/sdk/models/shared/companyreference.ts +++ b/platform/src/sdk/models/shared/companyreference.ts @@ -1,131 +1,600 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReferenceLinks } from './companyreferencelinks'; +import { + CompanyReferenceLinksFromJSON, + CompanyReferenceLinksFromJSONTyped, + CompanyReferenceLinksToJSON, + CompanyReferenceLinksToJSONTyped, +} from './companyreferencelinks'; + +/** + * + * @export + * @interface CompanyReference + */ +export interface CompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} /** - * A collection of links for the company. + * Check if a given object implements the CompanyReference interface. */ -export type CompanyReferenceLinks = { - /** - * Link to the company page in the portal. - */ - portal?: string | undefined; -}; - -export type CompanyReference = { - /** - * Unique identifier for your SMB in Codat. - */ - id?: string | undefined; - /** - * The name of the company - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of links for the company. - */ - links?: CompanyReferenceLinks | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$inboundSchema: z.ZodType< - CompanyReferenceLinks, - z.ZodTypeDef, - unknown -> = 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 { - return safeParse( - jsonString, - (x) => CompanyReferenceLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReferenceLinks' from JSON`, - ); -} - -/** @internal */ -export const CompanyReference$inboundSchema: z.ZodType< - CompanyReference, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - 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 { - return safeParse( - jsonString, - (x) => CompanyReference$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReference' from JSON`, - ); +export function instanceOfCompanyReference(value: object): value is CompanyReference { + return true; +} + +export function CompanyReferenceFromJSON(json: any): CompanyReference { + return CompanyReferenceFromJSONTyped(json, false); +} + +export function CompanyReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'links': json['links'] == null ? undefined : CompanyReferenceLinksFromJSON(json['links']), + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyReferenceToJSON(json: any): CompanyReference { + return CompanyReferenceToJSONTyped(json, false); +} + +export function CompanyReferenceToJSONTyped(value?: CompanyReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'links': CompanyReferenceLinksToJSON(value['links']), + 'tags': value['tags'], + }; +} + + +export interface CompaniesCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCreateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyGetResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyUpdateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ConnectionWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface DataTypeWriteWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface GetCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ReadCompletedWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface WriteDataTypeWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; } diff --git a/platform/src/sdk/models/shared/companyreferencelinks.ts b/platform/src/sdk/models/shared/companyreferencelinks.ts new file mode 100644 index 000000000..f69eb20d9 --- /dev/null +++ b/platform/src/sdk/models/shared/companyreferencelinks.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * A collection of links for the company. + * @export + * @interface CompanyReferenceLinks + */ +export interface CompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +/** + * Check if a given object implements the CompanyReferenceLinks interface. + */ +export function instanceOfCompanyReferenceLinks(value: object): value is CompanyReferenceLinks { + return true; +} + +export function CompanyReferenceLinksFromJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksFromJSONTyped(json, false); +} + +export function CompanyReferenceLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReferenceLinks { + if (json == null) { + return json; + } + return { + + 'portal': json['portal'] == null ? undefined : json['portal'], + }; +} + +export function CompanyReferenceLinksToJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksToJSONTyped(json, false); +} + +export function CompanyReferenceLinksToJSONTyped(value?: CompanyReferenceLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'portal': value['portal'], + }; +} + diff --git a/platform/src/sdk/models/shared/companyrequestbody.ts b/platform/src/sdk/models/shared/companyrequestbody.ts index 5e438635a..dc3b33656 100644 --- a/platform/src/sdk/models/shared/companyrequestbody.ts +++ b/platform/src/sdk/models/shared/companyrequestbody.ts @@ -1,46 +1,208 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyRequestBody = { - /** - * Name of company being connected. - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyRequestBody$Outbound = { - name: string; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyRequestBody$outboundSchema: z.ZodType< - CompanyRequestBody$Outbound, - z.ZodTypeDef, - CompanyRequestBody -> = z.object({ - name: z.string(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyRequestBodyToJSON( - companyRequestBody: CompanyRequestBody, -): string { - return JSON.stringify( - CompanyRequestBody$outboundSchema.parse(companyRequestBody), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyRequestBody + */ +export interface CompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyRequestBody interface. + */ +export function instanceOfCompanyRequestBody(value: object): value is CompanyRequestBody { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CompanyRequestBodyFromJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyFromJSONTyped(json, false); +} + +export function CompanyRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyRequestBody { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyRequestBodyToJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyToJSONTyped(json, false); +} + +export function CompanyRequestBodyToJSONTyped(value?: CompanyRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyCreateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; } diff --git a/platform/src/sdk/models/shared/companysyncsettings.ts b/platform/src/sdk/models/shared/companysyncsettings.ts index be0e794a8..d9f94befe 100644 --- a/platform/src/sdk/models/shared/companysyncsettings.ts +++ b/platform/src/sdk/models/shared/companysyncsettings.ts @@ -1,42 +1,131 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { SyncSetting, SyncSetting$inboundSchema } from "./syncsetting.js"; - -export type CompanySyncSettings = { - /** - * Unique identifier for your SMB in Codat. - */ - companyId?: string | undefined; - settings?: Array | undefined; - /** - * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). - */ - overridesDefaults?: boolean | undefined; -}; - -/** @internal */ -export const CompanySyncSettings$inboundSchema: z.ZodType< - CompanySyncSettings, - z.ZodTypeDef, - unknown -> = z.object({ - companyId: z.string().optional(), - settings: z.array(SyncSetting$inboundSchema).optional(), - overridesDefaults: z.boolean().optional(), -}); - -export function companySyncSettingsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanySyncSettings$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanySyncSettings' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { SyncSetting } from './syncsetting'; +import { + SyncSettingFromJSON, + SyncSettingFromJSONTyped, + SyncSettingToJSON, + SyncSettingToJSONTyped, +} from './syncsetting'; + +/** + * + * @export + * @interface CompanySyncSettings + */ +export interface CompanySyncSettings { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncSettings + */ + companyId?: string; + /** + * + * @type {Array} + * @memberof CompanySyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof CompanySyncSettings + */ + overridesDefaults?: boolean; +} + +/** + * Check if a given object implements the CompanySyncSettings interface. + */ +export function instanceOfCompanySyncSettings(value: object): value is CompanySyncSettings { + return true; +} + +export function CompanySyncSettingsFromJSON(json: any): CompanySyncSettings { + return CompanySyncSettingsFromJSONTyped(json, false); +} + +export function CompanySyncSettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanySyncSettings { + if (json == null) { + return json; + } + return { + + 'companyId': json['companyId'] == null ? undefined : json['companyId'], + 'settings': json['settings'] == null ? undefined : ((json['settings'] as Array).map(SyncSettingFromJSON)), + 'overridesDefaults': json['overridesDefaults'] == null ? undefined : json['overridesDefaults'], + }; +} + +export function CompanySyncSettingsToJSON(json: any): CompanySyncSettings { + return CompanySyncSettingsToJSONTyped(json, false); +} + +export function CompanySyncSettingsToJSONTyped(value?: CompanySyncSettings | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyId': value['companyId'], + 'settings': value['settings'] == null ? undefined : ((value['settings'] as Array).map(SyncSettingToJSON)), + 'overridesDefaults': value['overridesDefaults'], + }; +} + + +export interface CompanySyncSettingsGetResponseCompanySyncSettings { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncSettings + */ + companyId?: string; + /** + * + * @type {Array} + * @memberof CompanySyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof CompanySyncSettings + */ + overridesDefaults?: boolean; +} + +export interface GetCompanySyncSettingsResponseCompanySyncSettings { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncSettings + */ + companyId?: string; + /** + * + * @type {Array} + * @memberof CompanySyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof CompanySyncSettings + */ + overridesDefaults?: boolean; } diff --git a/platform/src/sdk/models/shared/companyupdaterequest.ts b/platform/src/sdk/models/shared/companyupdaterequest.ts index 442b7a78c..c5bdf7b20 100644 --- a/platform/src/sdk/models/shared/companyupdaterequest.ts +++ b/platform/src/sdk/models/shared/companyupdaterequest.ts @@ -1,46 +1,144 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyUpdateRequest = { - /** - * Name of company being connected. - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyUpdateRequest$Outbound = { - name?: string | undefined; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyUpdateRequest$outboundSchema: z.ZodType< - CompanyUpdateRequest$Outbound, - z.ZodTypeDef, - CompanyUpdateRequest -> = z.object({ - name: z.string().optional(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyUpdateRequestToJSON( - companyUpdateRequest: CompanyUpdateRequest, -): string { - return JSON.stringify( - CompanyUpdateRequest$outboundSchema.parse(companyUpdateRequest), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyUpdateRequest + */ +export interface CompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyUpdateRequest interface. + */ +export function instanceOfCompanyUpdateRequest(value: object): value is CompanyUpdateRequest { + return true; +} + +export function CompanyUpdateRequestFromJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestFromJSONTyped(json, false); +} + +export function CompanyUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyUpdateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyUpdateRequestToJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestToJSONTyped(json, false); +} + +export function CompanyUpdateRequestToJSONTyped(value?: CompanyUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyUpdateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyCompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; } diff --git a/platform/src/sdk/models/shared/companywebhook.ts b/platform/src/sdk/models/shared/companywebhook.ts index 08dcc2eeb..b446fe8d4 100644 --- a/platform/src/sdk/models/shared/companywebhook.ts +++ b/platform/src/sdk/models/shared/companywebhook.ts @@ -1,92 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyDetails } from './companydetails'; import { - CompanyDetails, - CompanyDetails$inboundSchema, - CompanyDetails$Outbound, - CompanyDetails$outboundSchema, -} from "./companydetails.js"; + CompanyDetailsFromJSON, + CompanyDetailsFromJSONTyped, + CompanyDetailsToJSON, + CompanyDetailsToJSONTyped, +} from './companydetails'; -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; -}; +/** + * + * @export + * @interface CompanyWebhook + */ +export interface CompanyWebhook { + /** + * Unique identifier of the event + * @type {string} + * @memberof CompanyWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof CompanyWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof CompanyWebhook + */ + generatedDate?: string; + /** + * + * @type {CompanyDetails} + * @memberof CompanyWebhook + */ + payload?: CompanyDetails; +} + +/** + * Check if a given object implements the CompanyWebhook interface. + */ +export function instanceOfCompanyWebhook(value: object): value is CompanyWebhook { + return true; +} -/** @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; -}; +export function CompanyWebhookFromJSON(json: any): CompanyWebhook { + return CompanyWebhookFromJSONTyped(json, false); +} -/** @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 CompanyWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : CompanyDetailsFromJSON(json['payload']), + }; +} -export function companyWebhookToJSON(companyWebhook: CompanyWebhook): string { - return JSON.stringify(CompanyWebhook$outboundSchema.parse(companyWebhook)); +export function CompanyWebhookToJSON(json: any): CompanyWebhook { + return CompanyWebhookToJSONTyped(json, false); } -export function companyWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyWebhook' from JSON`, - ); + +export function CompanyWebhookToJSONTyped(value?: CompanyWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': CompanyDetailsToJSON(value['payload']), + }; } + diff --git a/platform/src/sdk/models/shared/connection.ts b/platform/src/sdk/models/shared/connection.ts index d0a2d40ab..11bd56f72 100644 --- a/platform/src/sdk/models/shared/connection.ts +++ b/platform/src/sdk/models/shared/connection.ts @@ -1,189 +1,2585 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { DataConnectionStatus } from './dataconnectionstatus'; import { - DataConnectionError, - DataConnectionError$inboundSchema, - DataConnectionError$Outbound, - DataConnectionError$outboundSchema, -} from "./dataconnectionerror.js"; + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './dataconnectionstatus'; +import type { SourceType } from './sourcetype'; import { - DataConnectionStatus, - DataConnectionStatus$inboundSchema, - DataConnectionStatus$outboundSchema, -} from "./dataconnectionstatus.js"; + SourceTypeFromJSON, + SourceTypeFromJSONTyped, + SourceTypeToJSON, + SourceTypeToJSONTyped, +} from './sourcetype'; +import type { DataConnectionError } from './dataconnectionerror'; import { - SourceType, - SourceType$inboundSchema, - SourceType$outboundSchema, -} from "./sourcetype.js"; + DataConnectionErrorFromJSON, + DataConnectionErrorFromJSONTyped, + DataConnectionErrorToJSON, + DataConnectionErrorToJSONTyped, +} from './dataconnectionerror'; /** - * 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 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). + * @export + * @interface Connection */ -export type Connection = { - /** - * Unique identifier for a company's data connection. - */ - id: string; - /** - * A Codat ID representing the integration. - */ - integrationId: string; - /** - * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. - */ - integrationKey?: string | undefined; - /** - * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. - */ - sourceId: string; - /** - * The type of platform of the connection. - */ - sourceType: SourceType; - /** - * Name of integration connected to company. - */ - platformName: string; - /** - * The link URL your customers can use to authorize access to their business application. - */ - linkUrl: string; - /** - * The current authorization status of the data connection. - */ - status: DataConnectionStatus; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSync?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - created: string; - dataConnectionErrors?: Array | null | undefined; - connectionInfo?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const Connection$inboundSchema: z.ZodType< - Connection, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - integrationId: z.string(), - integrationKey: z.string().optional(), - sourceId: z.string(), - sourceType: SourceType$inboundSchema, - platformName: z.string(), - linkUrl: z.string(), - status: DataConnectionStatus$inboundSchema, - lastSync: z.string().optional(), - created: z.string(), - dataConnectionErrors: z.nullable(z.array(DataConnectionError$inboundSchema)) - .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 { - return safeParse( - jsonString, - (x) => Connection$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connection' from JSON`, - ); +export interface Connection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + + + +/** + * Check if a given object implements the Connection interface. + */ +export function instanceOfConnection(value: object): value is Connection { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('integrationId' in value) || value['integrationId'] === undefined) return false; + if (!('sourceId' in value) || value['sourceId'] === undefined) return false; + if (!('sourceType' in value) || value['sourceType'] === undefined) return false; + if (!('platformName' in value) || value['platformName'] === undefined) return false; + if (!('linkUrl' in value) || value['linkUrl'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('created' in value) || value['created'] === undefined) return false; + return true; +} + +export function ConnectionFromJSON(json: any): Connection { + return ConnectionFromJSONTyped(json, false); +} + +export function ConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connection { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'integrationId': json['integrationId'], + 'integrationKey': json['integrationKey'] == null ? undefined : json['integrationKey'], + 'sourceId': json['sourceId'], + 'sourceType': SourceTypeFromJSON(json['sourceType']), + 'platformName': json['platformName'], + 'linkUrl': json['linkUrl'], + 'status': DataConnectionStatusFromJSON(json['status']), + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'], + 'dataConnectionErrors': json['dataConnectionErrors'] == null ? undefined : ((json['dataConnectionErrors'] as Array).map(DataConnectionErrorFromJSON)), + 'connectionInfo': json['connectionInfo'] == null ? undefined : json['connectionInfo'], + }; +} + +export function ConnectionToJSON(json: any): Connection { + return ConnectionToJSONTyped(json, false); +} + +export function ConnectionToJSONTyped(value?: Connection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'integrationId': value['integrationId'], + 'integrationKey': value['integrationKey'], + 'sourceId': value['sourceId'], + 'sourceType': SourceTypeToJSON(value['sourceType']), + 'platformName': value['platformName'], + 'linkUrl': value['linkUrl'], + 'status': DataConnectionStatusToJSON(value['status']), + 'lastSync': value['lastSync'], + 'created': value['created'], + 'dataConnectionErrors': value['dataConnectionErrors'] == null ? undefined : ((value['dataConnectionErrors'] as Array).map(DataConnectionErrorToJSON)), + 'connectionInfo': value['connectionInfo'], + }; +} + + +export interface CompanyConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyReplaceResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyUpdateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionAuthorizationUpdateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionUnlinkResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionWebhookConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsListResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ListConnectionsResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ReplaceCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UnlinkConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UpdateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UpdateConnectionAuthorizationResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * + * @type {SourceType} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + lastSync?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; } diff --git a/platform/src/sdk/models/shared/connectionmanagementaccesstoken.ts b/platform/src/sdk/models/shared/connectionmanagementaccesstoken.ts index a2ca34fd4..d6baf3800 100644 --- a/platform/src/sdk/models/shared/connectionmanagementaccesstoken.ts +++ b/platform/src/sdk/models/shared/connectionmanagementaccesstoken.ts @@ -1,34 +1,83 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 ConnectionManagementAccessToken = { - /** - * Access token that allows SMBs to manage connections that have access to their data. - */ - accessToken?: string | undefined; -}; - -/** @internal */ -export const ConnectionManagementAccessToken$inboundSchema: z.ZodType< - ConnectionManagementAccessToken, - z.ZodTypeDef, - unknown -> = z.object({ - accessToken: z.string().optional(), -}); - -export function connectionManagementAccessTokenFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ConnectionManagementAccessToken$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionManagementAccessToken' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ConnectionManagementAccessToken + */ +export interface ConnectionManagementAccessToken { + /** + * Access token that allows SMBs to manage connections that have access to their data. + * @type {string} + * @memberof ConnectionManagementAccessToken + */ + accessToken?: string; +} + +/** + * Check if a given object implements the ConnectionManagementAccessToken interface. + */ +export function instanceOfConnectionManagementAccessToken(value: object): value is ConnectionManagementAccessToken { + return true; +} + +export function ConnectionManagementAccessTokenFromJSON(json: any): ConnectionManagementAccessToken { + return ConnectionManagementAccessTokenFromJSONTyped(json, false); +} + +export function ConnectionManagementAccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionManagementAccessToken { + if (json == null) { + return json; + } + return { + + 'accessToken': json['accessToken'] == null ? undefined : json['accessToken'], + }; +} + +export function ConnectionManagementAccessTokenToJSON(json: any): ConnectionManagementAccessToken { + return ConnectionManagementAccessTokenToJSONTyped(json, false); +} + +export function ConnectionManagementAccessTokenToJSONTyped(value?: ConnectionManagementAccessToken | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accessToken': value['accessToken'], + }; +} + + +export interface ConnectionManagementAccessTokenGetResponseConnectionManagementAccessToken { + /** + * Access token that allows SMBs to manage connections that have access to their data. + * @type {string} + * @memberof ConnectionManagementAccessToken + */ + accessToken?: string; +} + +export interface GetConnectionManagementAccessTokenResponseConnectionManagementAccessToken { + /** + * Access token that allows SMBs to manage connections that have access to their data. + * @type {string} + * @memberof ConnectionManagementAccessToken + */ + accessToken?: string; } diff --git a/platform/src/sdk/models/shared/connectionmanagementallowedorigins.ts b/platform/src/sdk/models/shared/connectionmanagementallowedorigins.ts index 0d85f1801..a41974581 100644 --- a/platform/src/sdk/models/shared/connectionmanagementallowedorigins.ts +++ b/platform/src/sdk/models/shared/connectionmanagementallowedorigins.ts @@ -1,60 +1,146 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ConnectionManagementAllowedOrigins + */ +export interface ConnectionManagementAllowedOrigins { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} /** - * Success + * Check if a given object implements the ConnectionManagementAllowedOrigins interface. */ -export type ConnectionManagementAllowedOrigins = { - /** - * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - */ - allowedOrigins?: Array | undefined; -}; - -/** @internal */ -export const ConnectionManagementAllowedOrigins$inboundSchema: z.ZodType< - ConnectionManagementAllowedOrigins, - z.ZodTypeDef, - unknown -> = z.object({ - allowedOrigins: z.array(z.string()).optional(), -}); -/** @internal */ -export type ConnectionManagementAllowedOrigins$Outbound = { - allowedOrigins?: Array | undefined; -}; - -/** @internal */ -export const ConnectionManagementAllowedOrigins$outboundSchema: z.ZodType< - ConnectionManagementAllowedOrigins$Outbound, - z.ZodTypeDef, - ConnectionManagementAllowedOrigins -> = z.object({ - allowedOrigins: z.array(z.string()).optional(), -}); - -export function connectionManagementAllowedOriginsToJSON( - connectionManagementAllowedOrigins: ConnectionManagementAllowedOrigins, -): string { - return JSON.stringify( - ConnectionManagementAllowedOrigins$outboundSchema.parse( - connectionManagementAllowedOrigins, - ), - ); -} -export function connectionManagementAllowedOriginsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - ConnectionManagementAllowedOrigins$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionManagementAllowedOrigins' from JSON`, - ); +export function instanceOfConnectionManagementAllowedOrigins(value: object): value is ConnectionManagementAllowedOrigins { + return true; +} + +export function ConnectionManagementAllowedOriginsFromJSON(json: any): ConnectionManagementAllowedOrigins { + return ConnectionManagementAllowedOriginsFromJSONTyped(json, false); +} + +export function ConnectionManagementAllowedOriginsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionManagementAllowedOrigins { + if (json == null) { + return json; + } + return { + + 'allowedOrigins': json['allowedOrigins'] == null ? undefined : json['allowedOrigins'], + }; +} + +export function ConnectionManagementAllowedOriginsToJSON(json: any): ConnectionManagementAllowedOrigins { + return ConnectionManagementAllowedOriginsToJSONTyped(json, false); +} + +export function ConnectionManagementAllowedOriginsToJSONTyped(value?: ConnectionManagementAllowedOrigins | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'allowedOrigins': value['allowedOrigins'], + }; +} + + +export interface AllowedOrigins { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface ConnectionManagementAllowedOriginsAllowedOrigins { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface ConnectionManagementAllowedOriginsData { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface ConnectionManagementCorsSettingsSetRequestBody { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface CorsSettingsSetRequestBody { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface SetConnectionManagementCorsSettingsConnectionManagementAllowedOrigins { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface SetConnectionManagementCorsSettingsRequestBody { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface SetCorsSettingsConnectionManagementAllowedOrigins { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; +} + +export interface SetCorsSettingsRequestBody { + /** + * An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + * @type {Array} + * @memberof ConnectionManagementAllowedOrigins + */ + allowedOrigins?: Array; } diff --git a/platform/src/sdk/models/shared/connections.ts b/platform/src/sdk/models/shared/connections.ts index 1278d54c3..714c79b56 100644 --- a/platform/src/sdk/models/shared/connections.ts +++ b/platform/src/sdk/models/shared/connections.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Connections = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Connections$inboundSchema: z.ZodType< - Connections, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Connection$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function connectionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connections$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connections' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Connections + */ +export interface Connections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +/** + * Check if a given object implements the Connections interface. + */ +export function instanceOfConnections(value: object): value is Connections { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function ConnectionsFromJSON(json: any): Connections { + return ConnectionsFromJSONTyped(json, false); +} + +export function ConnectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connections { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(ConnectionFromJSON)), + }; +} + +export function ConnectionsToJSON(json: any): Connections { + return ConnectionsToJSONTyped(json, false); +} + +export function ConnectionsToJSONTyped(value?: Connections | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface ConnectionsListResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +export interface ListConnectionsResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/connectionwebhook.ts b/platform/src/sdk/models/shared/connectionwebhook.ts index e44a55439..01a75a107 100644 --- a/platform/src/sdk/models/shared/connectionwebhook.ts +++ b/platform/src/sdk/models/shared/connectionwebhook.ts @@ -1,96 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ConnectionWebhookPayload } from './connectionwebhookpayload'; import { - ConnectionWebhookPayload, - ConnectionWebhookPayload$inboundSchema, - ConnectionWebhookPayload$Outbound, - ConnectionWebhookPayload$outboundSchema, -} from "./connectionwebhookpayload.js"; + ConnectionWebhookPayloadFromJSON, + ConnectionWebhookPayloadFromJSONTyped, + ConnectionWebhookPayloadToJSON, + ConnectionWebhookPayloadToJSONTyped, +} from './connectionwebhookpayload'; -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; -}; +/** + * + * @export + * @interface ConnectionWebhook + */ +export interface ConnectionWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ConnectionWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ConnectionWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ConnectionWebhook + */ + generatedDate?: string; + /** + * + * @type {ConnectionWebhookPayload} + * @memberof ConnectionWebhook + */ + payload?: ConnectionWebhookPayload; +} + +/** + * Check if a given object implements the ConnectionWebhook interface. + */ +export function instanceOfConnectionWebhook(value: object): value is ConnectionWebhook { + return true; +} -/** @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; -}; +export function ConnectionWebhookFromJSON(json: any): ConnectionWebhook { + return ConnectionWebhookFromJSONTyped(json, false); +} -/** @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 ConnectionWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ConnectionWebhookPayloadFromJSON(json['payload']), + }; +} -export function connectionWebhookToJSON( - connectionWebhook: ConnectionWebhook, -): string { - return JSON.stringify( - ConnectionWebhook$outboundSchema.parse(connectionWebhook), - ); +export function ConnectionWebhookToJSON(json: any): ConnectionWebhook { + return ConnectionWebhookToJSONTyped(json, false); } -export function connectionWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ConnectionWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionWebhook' from JSON`, - ); + +export function ConnectionWebhookToJSONTyped(value?: ConnectionWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ConnectionWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/platform/src/sdk/models/shared/connectionwebhookpayload.ts b/platform/src/sdk/models/shared/connectionwebhookpayload.ts index 58b5ad4a2..240d67a93 100644 --- a/platform/src/sdk/models/shared/connectionwebhookpayload.ts +++ b/platform/src/sdk/models/shared/connectionwebhookpayload.ts @@ -1,81 +1,103 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { Connection } from './connection'; import { - Connection, - Connection$inboundSchema, - Connection$Outbound, - Connection$outboundSchema, -} from "./connection.js"; + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; -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; -}; +/** + * + * @export + * @interface ConnectionWebhookPayload + */ +export interface ConnectionWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ConnectionWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * + * @type {Connection} + * @memberof ConnectionWebhookPayload + */ + connection?: Connection; +} + +/** + * Check if a given object implements the ConnectionWebhookPayload interface. + */ +export function instanceOfConnectionWebhookPayload(value: object): value is ConnectionWebhookPayload { + return true; +} + +export function ConnectionWebhookPayloadFromJSON(json: any): ConnectionWebhookPayload { + return ConnectionWebhookPayloadFromJSONTyped(json, false); +} + +export function ConnectionWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectionWebhookPayload { + if (json == null) { + return json; + } + return { + + 'referenceCompany': json['referenceCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceCompany']), + 'connection': json['connection'] == null ? undefined : ConnectionFromJSON(json['connection']), + }; +} -/** @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; -}; +export function ConnectionWebhookPayloadToJSON(json: any): ConnectionWebhookPayload { + return ConnectionWebhookPayloadToJSONTyped(json, false); +} -/** @internal */ -export const ConnectionWebhookPayload$outboundSchema: z.ZodType< - ConnectionWebhookPayload$Outbound, - z.ZodTypeDef, - ConnectionWebhookPayload -> = z.object({ - referenceCompany: CompanyReference$outboundSchema.optional(), - connection: Connection$outboundSchema.optional(), -}); +export function ConnectionWebhookPayloadToJSONTyped(value?: ConnectionWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function connectionWebhookPayloadToJSON( - connectionWebhookPayload: ConnectionWebhookPayload, -): string { - return JSON.stringify( - ConnectionWebhookPayload$outboundSchema.parse(connectionWebhookPayload), - ); + return { + + 'referenceCompany': CompanyReferenceToJSON(value['referenceCompany']), + 'connection': ConnectionToJSON(value['connection']), + }; } -export function connectionWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ConnectionWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ConnectionWebhookPayload' from JSON`, - ); + + +export interface ConnectionWebhookConnectionWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ConnectionWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * + * @type {Connection} + * @memberof ConnectionWebhookPayload + */ + connection?: Connection; } diff --git a/platform/src/sdk/models/shared/createapikey.ts b/platform/src/sdk/models/shared/createapikey.ts index fa84f952d..c5d43aad7 100644 --- a/platform/src/sdk/models/shared/createapikey.ts +++ b/platform/src/sdk/models/shared/createapikey.ts @@ -1,33 +1,110 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - +import { mapValues } from '../../../runtime'; /** * Details about the newly created API key. + * @export + * @interface CreateApiKey */ -export type CreateApiKey = { - /** - * A meaningful name assigned to the API key. - */ - name?: string | null | undefined; -}; - -/** @internal */ -export type CreateApiKey$Outbound = { - name?: string | null | undefined; -}; - -/** @internal */ -export const CreateApiKey$outboundSchema: z.ZodType< - CreateApiKey$Outbound, - z.ZodTypeDef, - CreateApiKey -> = z.object({ - name: z.nullable(z.string()).optional(), -}); - -export function createApiKeyToJSON(createApiKey: CreateApiKey): string { - return JSON.stringify(CreateApiKey$outboundSchema.parse(createApiKey)); +export interface CreateApiKey { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; +} + +/** + * Check if a given object implements the CreateApiKey interface. + */ +export function instanceOfCreateApiKey(value: object): value is CreateApiKey { + return true; +} + +export function CreateApiKeyFromJSON(json: any): CreateApiKey { + return CreateApiKeyFromJSONTyped(json, false); +} + +export function CreateApiKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateApiKey { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function CreateApiKeyToJSON(json: any): CreateApiKey { + return CreateApiKeyToJSONTyped(json, false); +} + +export function CreateApiKeyToJSONTyped(value?: CreateApiKey | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + }; +} + + +export interface ApiKeyCreateRequestBody { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; +} + +export interface CreateAPIKey { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; +} + +export interface CreateApiKeyCreateAPIKey { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; +} + +export interface CreateApiKeyCreateApiKey { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; +} + +export interface CreateApiKeyRequestBody { + /** + * A meaningful name assigned to the API key. + * @type {string} + * @memberof CreateApiKey + */ + name?: string | null; } diff --git a/platform/src/sdk/models/shared/customdatatypeconfiguration.ts b/platform/src/sdk/models/shared/customdatatypeconfiguration.ts index 543e120d3..57fc5aab4 100644 --- a/platform/src/sdk/models/shared/customdatatypeconfiguration.ts +++ b/platform/src/sdk/models/shared/customdatatypeconfiguration.ts @@ -1,80 +1,224 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; /** * Client's configuration details for a specific custom data type and platform pair. + * @export + * @interface CustomDataTypeConfiguration + */ +export interface CustomDataTypeConfiguration { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; +} + +/** + * Check if a given object implements the CustomDataTypeConfiguration interface. */ -export type CustomDataTypeConfiguration = { - /** - * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. - */ - dataSource?: string | undefined; - /** - * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. - */ - requiredData?: { [k: string]: string } | undefined; - /** - * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. - */ - keyBy?: Array | undefined; - /** - * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. - */ - sourceModifiedDate?: Array | null | undefined; -}; +export function instanceOfCustomDataTypeConfiguration(value: object): value is CustomDataTypeConfiguration { + return true; +} + +export function CustomDataTypeConfigurationFromJSON(json: any): CustomDataTypeConfiguration { + return CustomDataTypeConfigurationFromJSONTyped(json, false); +} + +export function CustomDataTypeConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomDataTypeConfiguration { + if (json == null) { + return json; + } + return { + + 'dataSource': json['dataSource'] == null ? undefined : json['dataSource'], + 'requiredData': json['requiredData'] == null ? undefined : json['requiredData'], + 'keyBy': json['keyBy'] == null ? undefined : json['keyBy'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function CustomDataTypeConfigurationToJSON(json: any): CustomDataTypeConfiguration { + return CustomDataTypeConfigurationToJSONTyped(json, false); +} + +export function CustomDataTypeConfigurationToJSONTyped(value?: CustomDataTypeConfiguration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataSource': value['dataSource'], + 'requiredData': value['requiredData'], + 'keyBy': value['keyBy'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} -/** @internal */ -export const CustomDataTypeConfiguration$inboundSchema: z.ZodType< - CustomDataTypeConfiguration, - z.ZodTypeDef, - unknown -> = z.object({ - dataSource: z.string().optional(), - requiredData: z.record(z.string()).optional(), - keyBy: z.array(z.string()).optional(), - sourceModifiedDate: z.nullable(z.array(z.string())).optional(), -}); -/** @internal */ -export type CustomDataTypeConfiguration$Outbound = { - dataSource?: string | undefined; - requiredData?: { [k: string]: string } | undefined; - keyBy?: Array | undefined; - sourceModifiedDate?: Array | null | undefined; -}; -/** @internal */ -export const CustomDataTypeConfiguration$outboundSchema: z.ZodType< - CustomDataTypeConfiguration$Outbound, - z.ZodTypeDef, - CustomDataTypeConfiguration -> = z.object({ - dataSource: z.string().optional(), - requiredData: z.record(z.string()).optional(), - keyBy: z.array(z.string()).optional(), - sourceModifiedDate: z.nullable(z.array(z.string())).optional(), -}); +export interface ConfigureCustomDataTypeCustomDataTypeConfiguration { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; +} -export function customDataTypeConfigurationToJSON( - customDataTypeConfiguration: CustomDataTypeConfiguration, -): string { - return JSON.stringify( - CustomDataTypeConfiguration$outboundSchema.parse( - customDataTypeConfiguration, - ), - ); +export interface ConfigureCustomDataTypeRequestBody { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; } -export function customDataTypeConfigurationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CustomDataTypeConfiguration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CustomDataTypeConfiguration' from JSON`, - ); + +export interface ConfigureCustomDataTypeResponseCustomDataTypeConfiguration { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; +} + +export interface CustomDataTypeConfigureRequestBody { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; +} + +export interface CustomDataTypeConfigureResponseCustomDataTypeConfiguration { + /** + * Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat. + * @type {string} + * @memberof CustomDataTypeConfiguration + */ + dataSource?: string; + /** + * Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat. + * @type {{ [key: string]: string; }} + * @memberof CustomDataTypeConfiguration + */ + requiredData?: { [key: string]: string; }; + /** + * An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + keyBy?: Array; + /** + * Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat. + * @type {Array} + * @memberof CustomDataTypeConfiguration + */ + sourceModifiedDate?: Array | null; } diff --git a/platform/src/sdk/models/shared/customdatatyperecord.ts b/platform/src/sdk/models/shared/customdatatyperecord.ts index 4fa035c5b..98e0662ac 100644 --- a/platform/src/sdk/models/shared/customdatatyperecord.ts +++ b/platform/src/sdk/models/shared/customdatatyperecord.ts @@ -1,80 +1,195 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 type { Content } from '../_speakeasy_hoisted'; +import { mapValues } from '../../../runtime'; +import type { ModifiedDate } from './modifieddate'; +import { + ModifiedDateFromJSON, + ModifiedDateFromJSONTyped, + ModifiedDateToJSON, + ModifiedDateToJSONTyped, +} from './modifieddate'; -export type Content = {}; +/** + * + * @export + * @interface CustomDataTypeRecord + */ +export interface CustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; +} + +/** + * Check if a given object implements the CustomDataTypeRecord interface. + */ +export function instanceOfCustomDataTypeRecord(value: object): value is CustomDataTypeRecord { + return true; +} + +export function CustomDataTypeRecordFromJSON(json: any): CustomDataTypeRecord { + return CustomDataTypeRecordFromJSONTyped(json, false); +} -export type ModifiedDate = { - modifiedDate?: string | undefined; -}; +export function CustomDataTypeRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomDataTypeRecord { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'content': json['content'] == null ? undefined : json['content'], + 'modifiedDate': json['modifiedDate'] == null ? undefined : ModifiedDateFromJSON(json['modifiedDate']), + }; +} -export type CustomDataTypeRecord = { - /** - * Unique identifier of the record. - */ - id?: string | undefined; - /** - * Values from the source system for the properties defined in the custom data type configuration. - */ - content?: { [k: string]: Content } | undefined; - modifiedDate?: ModifiedDate | undefined; -}; +export function CustomDataTypeRecordToJSON(json: any): CustomDataTypeRecord { + return CustomDataTypeRecordToJSONTyped(json, false); +} -/** @internal */ -export const Content$inboundSchema: z.ZodType = - z.object({}); +export function CustomDataTypeRecordToJSONTyped(value?: CustomDataTypeRecord | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function contentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Content$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Content' from JSON`, - ); + return { + + 'id': value['id'], + 'content': value['content'], + 'modifiedDate': ModifiedDateToJSON(value['modifiedDate']), + }; } -/** @internal */ -export const ModifiedDate$inboundSchema: z.ZodType< - ModifiedDate, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), -}); -export function modifiedDateFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ModifiedDate$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ModifiedDate' from JSON`, - ); +export interface CustomDataTypeConfigurationGetResponseCustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; +} + +export interface CustomDataTypeRecordsCustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; } -/** @internal */ -export const CustomDataTypeRecord$inboundSchema: z.ZodType< - CustomDataTypeRecord, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - content: z.record(z.lazy(() => Content$inboundSchema)).optional(), - modifiedDate: z.lazy(() => ModifiedDate$inboundSchema).optional(), -}); +export interface CustomDataTypeRecordsListResponseCustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; +} + +export interface GetCustomDataTypeConfigurationResponseCustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; +} -export function customDataTypeRecordFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CustomDataTypeRecord$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CustomDataTypeRecord' from JSON`, - ); +export interface ListCustomDataTypeRecordsResponseCustomDataTypeRecord { + /** + * Unique identifier of the record. + * @type {string} + * @memberof CustomDataTypeRecord + */ + id?: string; + /** + * Values from the source system for the properties defined in the custom data type configuration. + * @type {{ [key: string]: object; }} + * @memberof CustomDataTypeRecord + */ + content?: { [key: string]: Content; }; + /** + * + * @type {ModifiedDate} + * @memberof CustomDataTypeRecord + */ + modifiedDate?: ModifiedDate; } diff --git a/platform/src/sdk/models/shared/customdatatyperecords.ts b/platform/src/sdk/models/shared/customdatatyperecords.ts index df5741d18..5973b10db 100644 --- a/platform/src/sdk/models/shared/customdatatyperecords.ts +++ b/platform/src/sdk/models/shared/customdatatyperecords.ts @@ -1,53 +1,205 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CustomDataTypeRecord } from './customdatatyperecord'; import { - CustomDataTypeRecord, - CustomDataTypeRecord$inboundSchema, -} from "./customdatatyperecord.js"; + CustomDataTypeRecordFromJSON, + CustomDataTypeRecordFromJSONTyped, + CustomDataTypeRecordToJSON, + CustomDataTypeRecordToJSONTyped, +} from './customdatatyperecord'; /** * Resulting records pulled from the source platform for a specific custom data type. + * @export + * @interface CustomDataTypeRecords + */ +export interface CustomDataTypeRecords { + /** + * + * @type {Array} + * @memberof CustomDataTypeRecords + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageNumber?: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageSize?: number; + /** + * Total number of items. + * @type {number} + * @memberof CustomDataTypeRecords + */ + totalResults?: number; +} + +/** + * Check if a given object implements the CustomDataTypeRecords interface. */ -export type CustomDataTypeRecords = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber?: number | undefined; - /** - * Number of items to return in results array. - */ - pageSize?: number | undefined; - /** - * Total number of items. - */ - totalResults?: number | undefined; -}; - -/** @internal */ -export const CustomDataTypeRecords$inboundSchema: z.ZodType< - CustomDataTypeRecords, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(CustomDataTypeRecord$inboundSchema).optional(), - pageNumber: z.number().int().optional(), - pageSize: z.number().int().optional(), - totalResults: z.number().int().optional(), -}); - -export function customDataTypeRecordsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CustomDataTypeRecords$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CustomDataTypeRecords' from JSON`, - ); +export function instanceOfCustomDataTypeRecords(value: object): value is CustomDataTypeRecords { + return true; +} + +export function CustomDataTypeRecordsFromJSON(json: any): CustomDataTypeRecords { + return CustomDataTypeRecordsFromJSONTyped(json, false); +} + +export function CustomDataTypeRecordsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomDataTypeRecords { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CustomDataTypeRecordFromJSON)), + 'pageNumber': json['pageNumber'] == null ? undefined : json['pageNumber'], + 'pageSize': json['pageSize'] == null ? undefined : json['pageSize'], + 'totalResults': json['totalResults'] == null ? undefined : json['totalResults'], + }; +} + +export function CustomDataTypeRecordsToJSON(json: any): CustomDataTypeRecords { + return CustomDataTypeRecordsToJSONTyped(json, false); +} + +export function CustomDataTypeRecordsToJSONTyped(value?: CustomDataTypeRecords | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CustomDataTypeRecordToJSON)), + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + }; +} + + +export interface CustomDataTypeConfigurationGetResponseCustomDataTypeRecords { + /** + * + * @type {Array} + * @memberof CustomDataTypeRecords + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageNumber?: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageSize?: number; + /** + * Total number of items. + * @type {number} + * @memberof CustomDataTypeRecords + */ + totalResults?: number; +} + +export interface CustomDataTypeRecordsListResponseCustomDataTypeRecords { + /** + * + * @type {Array} + * @memberof CustomDataTypeRecords + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageNumber?: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageSize?: number; + /** + * Total number of items. + * @type {number} + * @memberof CustomDataTypeRecords + */ + totalResults?: number; +} + +export interface GetCustomDataTypeConfigurationResponseCustomDataTypeRecords { + /** + * + * @type {Array} + * @memberof CustomDataTypeRecords + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageNumber?: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageSize?: number; + /** + * Total number of items. + * @type {number} + * @memberof CustomDataTypeRecords + */ + totalResults?: number; +} + +export interface ListCustomDataTypeRecordsResponseCustomDataTypeRecords { + /** + * + * @type {Array} + * @memberof CustomDataTypeRecords + */ + results?: Array; + /** + * Current page number. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageNumber?: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof CustomDataTypeRecords + */ + pageSize?: number; + /** + * Total number of items. + * @type {number} + * @memberof CustomDataTypeRecords + */ + totalResults?: number; } diff --git a/platform/src/sdk/models/shared/dataconnectionerror.ts b/platform/src/sdk/models/shared/dataconnectionerror.ts index 90c1570e9..a9832d593 100644 --- a/platform/src/sdk/models/shared/dataconnectionerror.ts +++ b/platform/src/sdk/models/shared/dataconnectionerror.ts @@ -1,145 +1,828 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { ErrorStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DataConnectionError + */ +export interface DataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * @export */ -export const ErrorStatus = { - Active: "Active", - Resolved: "Resolved", +export const DataConnectionErrorStatusEnum = { + Active: 'Active', + Resolved: 'Resolved' } as const; +export type DataConnectionErrorStatusEnum = typeof DataConnectionErrorStatusEnum[keyof typeof DataConnectionErrorStatusEnum]; + + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * Check if a given object implements the DataConnectionError interface. */ -export type ErrorStatus = ClosedEnum; - -export type DataConnectionError = { - /** - * The HTTP status code returned by the source platform when the error occurred. - */ - statusCode?: string | undefined; - /** - * A non-numeric status code/text returned by the source platform when the error occurred. - */ - statusText?: string | undefined; - /** - * A message about a error returned by Codat. - */ - errorMessage?: 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. - */ - erroredOnUtc?: string | undefined; - /** - * The current status of a transient error. Null statuses indicate that the error is not transient. - */ - status?: ErrorStatus | null | 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. - */ - resolvedOnUtc?: string | undefined; -}; - -/** @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< - DataConnectionError, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.string().optional(), - statusText: z.string().optional(), - errorMessage: z.string().optional(), - erroredOnUtc: z.string().optional(), - 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 instanceOfDataConnectionError(value: object): value is DataConnectionError { + return true; +} + +export function DataConnectionErrorFromJSON(json: any): DataConnectionError { + return DataConnectionErrorFromJSONTyped(json, false); +} + +export function DataConnectionErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionError { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'statusText': json['statusText'] == null ? undefined : json['statusText'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'erroredOnUtc': json['erroredOnUtc'] == null ? undefined : json['erroredOnUtc'], + 'status': json['status'] == null ? undefined : json['status'], + 'resolvedOnUtc': json['resolvedOnUtc'] == null ? undefined : json['resolvedOnUtc'], + }; +} + +export function DataConnectionErrorToJSON(json: any): DataConnectionError { + return DataConnectionErrorToJSONTyped(json, false); +} + +export function DataConnectionErrorToJSONTyped(value?: DataConnectionError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'statusText': value['statusText'], + 'errorMessage': value['errorMessage'], + 'erroredOnUtc': value['erroredOnUtc'], + 'status': value['status'], + 'resolvedOnUtc': value['resolvedOnUtc'], + }; +} + + +export interface ConnectionAuthorizationUpdateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; } -export function dataConnectionErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataConnectionError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataConnectionError' from JSON`, - ); + +export interface ConnectionCreateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionGetResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface ConnectionUnlinkResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface CreateConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface GetConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface UnlinkConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; +} + +export interface UpdateConnectionAuthorizationResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * 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. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string; } diff --git a/platform/src/sdk/models/shared/dataconnectionstatus.ts b/platform/src/sdk/models/shared/dataconnectionstatus.ts index 88889c800..221f18fea 100644 --- a/platform/src/sdk/models/shared/dataconnectionstatus.ts +++ b/platform/src/sdk/models/shared/dataconnectionstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current authorization status of the data connection. + * @export */ export const DataConnectionStatus = { - PendingAuth: "PendingAuth", - Linked: "Linked", - Unlinked: "Unlinked", - Deauthorized: "Deauthorized", + PendingAuth: 'PendingAuth', + Linked: 'Linked', + Unlinked: 'Unlinked', + Deauthorized: 'Deauthorized' } as const; -/** - * The current authorization status of the data connection. - */ -export type DataConnectionStatus = ClosedEnum; - -/** @internal */ -export const DataConnectionStatus$inboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = z.nativeEnum(DataConnectionStatus); -/** @internal */ -export const DataConnectionStatus$outboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = DataConnectionStatus$inboundSchema; +export type DataConnectionStatus = typeof DataConnectionStatus[keyof typeof DataConnectionStatus]; + + +export function instanceOfDataConnectionStatus(value: any): boolean { + for (const key in DataConnectionStatus) { + if (Object.prototype.hasOwnProperty.call(DataConnectionStatus, key)) { + if (DataConnectionStatus[key as keyof typeof DataConnectionStatus] === value) { + return true; + } + } + } + return false; +} + +export function DataConnectionStatusFromJSON(json: any): DataConnectionStatus { + return DataConnectionStatusFromJSONTyped(json, false); +} + +export function DataConnectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return json as DataConnectionStatus; +} + +export function DataConnectionStatusToJSON(value?: DataConnectionStatus | null): any { + return value as any; +} + +export function DataConnectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return value as DataConnectionStatus; +} + diff --git a/platform/src/sdk/models/shared/datastatus.ts b/platform/src/sdk/models/shared/datastatus.ts index 431478c2d..833e2a8ad 100644 --- a/platform/src/sdk/models/shared/datastatus.ts +++ b/platform/src/sdk/models/shared/datastatus.ts @@ -1,134 +1,353 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Status } from './status'; +import type { DataTypes } from '../_speakeasy_enums'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; +/** + * Describes the state of data in the Codat cache for a company and data type + * @export + * @interface DataStatus */ +export interface DataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * 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. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: Status; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Status, Status$inboundSchema } from "./status.js"; /** - * Available data types + * @export */ -export const DataTypes = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", +export const DataStatusDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' } as const; +export type DataStatusDataTypeEnum = typeof DataStatusDataTypeEnum[keyof typeof DataStatusDataTypeEnum]; + /** - * Available data types + * @export */ -export type DataTypes = ClosedEnum; +export const DataStatusCurrentStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type DataStatusCurrentStatusEnum = typeof DataStatusCurrentStatusEnum[keyof typeof DataStatusCurrentStatusEnum]; + /** - * Describes the state of data in the Codat cache for a company and data type + * Check if a given object implements the DataStatus interface. */ -export type DataStatus = { - /** - * Available data types - */ - dataType: DataTypes; - /** - * 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. - */ - lastSuccessfulSync?: string | undefined; - /** - * The current status of the dataset. - */ - currentStatus: Status; - /** - * Unique identifier for most recent sync of data type. - */ - latestSyncId?: string | undefined; - /** - * Unique identifier for the most recent successful sync of data type. - */ - latestSuccessfulSyncId?: string | undefined; -}; +export function instanceOfDataStatus(value: object): value is DataStatus { + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('currentStatus' in value) || value['currentStatus'] === undefined) return false; + return true; +} -/** @internal */ -export const DataTypes$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataTypes); +export function DataStatusFromJSON(json: any): DataStatus { + return DataStatusFromJSONTyped(json, false); +} -/** @internal */ -export const DataStatus$inboundSchema: z.ZodType< - DataStatus, - z.ZodTypeDef, - unknown -> = z.object({ - dataType: DataTypes$inboundSchema, - lastSuccessfulSync: z.string().optional(), - currentStatus: Status$inboundSchema, - latestSyncId: z.string().optional(), - latestSuccessfulSyncId: z.string().optional(), -}); +export function DataStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataStatus { + if (json == null) { + return json; + } + return { + + 'dataType': json['dataType'], + 'lastSuccessfulSync': json['lastSuccessfulSync'] == null ? undefined : json['lastSuccessfulSync'], + 'currentStatus': json['currentStatus'], + 'latestSyncId': json['latestSyncId'] == null ? undefined : json['latestSyncId'], + 'latestSuccessfulSyncId': json['latestSuccessfulSyncId'] == null ? undefined : json['latestSuccessfulSyncId'], + }; +} + +export function DataStatusToJSON(json: any): DataStatus { + return DataStatusToJSONTyped(json, false); +} + +export function DataStatusToJSONTyped(value?: DataStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataType': value['dataType'], + 'lastSuccessfulSync': value['lastSuccessfulSync'], + 'currentStatus': value['currentStatus'], + 'latestSyncId': value['latestSyncId'], + 'latestSuccessfulSyncId': value['latestSuccessfulSyncId'], + }; +} + + +export interface CompanyDataStatusGetResponseDataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * 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. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} + +export interface DataStatusesDataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * 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. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} -export function dataStatusFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataStatus$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataStatus' from JSON`, - ); +export interface GetCompanyDataStatusResponseDataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * 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. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; } diff --git a/platform/src/sdk/models/shared/datastatuses.ts b/platform/src/sdk/models/shared/datastatuses.ts index 784b3c07a..cc79adf5c 100644 --- a/platform/src/sdk/models/shared/datastatuses.ts +++ b/platform/src/sdk/models/shared/datastatuses.ts @@ -1,264 +1,931 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { DataStatus, DataStatus$inboundSchema } from "./datastatus.js"; +import { mapValues } from '../../../runtime'; +import type { DataStatus } from './datastatus'; +import { + DataStatusFromJSON, + DataStatusFromJSONTyped, + DataStatusToJSON, + DataStatusToJSONTyped, +} from './datastatus'; -export type DataStatuses = { - /** - * Describes the state of data in the Codat cache for a company and data type - */ - accountTransactions?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - balanceSheet?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankAccounts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankTransactions?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - billCreditNotes?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - billPayments?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bills?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - cashFlowStatement?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - chartOfAccounts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - company?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - creditNotes?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - customers?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - directCosts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - directIncomes?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - invoices?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - itemReceipts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - items?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - journalEntries?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - journals?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - paymentMethods?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - payments?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - profitAndLoss?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - purchaseOrders?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - salesOrders?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - suppliers?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - taxRates?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - trackingCategories?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - transfers?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingAccountBalances?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingAccounts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingTransactionCategories?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingTransactions?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceCompanyInfo?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceCustomers?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceDisputes?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceLocations?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceOrders?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commercePaymentMethods?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commercePayments?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceProductCategories?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceProducts?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceTaxComponents?: DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceTransactions?: DataStatus | undefined; -}; +/** + * + * @export + * @interface DataStatuses + */ +export interface DataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} + +/** + * Check if a given object implements the DataStatuses interface. + */ +export function instanceOfDataStatuses(value: object): value is DataStatuses { + return true; +} + +export function DataStatusesFromJSON(json: any): DataStatuses { + return DataStatusesFromJSONTyped(json, false); +} + +export function DataStatusesFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataStatuses { + if (json == null) { + return json; + } + return { + + 'accountTransactions': json['accountTransactions'] == null ? undefined : DataStatusFromJSON(json['accountTransactions']), + 'balanceSheet': json['balanceSheet'] == null ? undefined : DataStatusFromJSON(json['balanceSheet']), + 'bankAccounts': json['bankAccounts'] == null ? undefined : DataStatusFromJSON(json['bankAccounts']), + 'bankTransactions': json['bankTransactions'] == null ? undefined : DataStatusFromJSON(json['bankTransactions']), + 'billCreditNotes': json['billCreditNotes'] == null ? undefined : DataStatusFromJSON(json['billCreditNotes']), + 'billPayments': json['billPayments'] == null ? undefined : DataStatusFromJSON(json['billPayments']), + 'bills': json['bills'] == null ? undefined : DataStatusFromJSON(json['bills']), + 'cashFlowStatement': json['cashFlowStatement'] == null ? undefined : DataStatusFromJSON(json['cashFlowStatement']), + 'chartOfAccounts': json['chartOfAccounts'] == null ? undefined : DataStatusFromJSON(json['chartOfAccounts']), + 'company': json['company'] == null ? undefined : DataStatusFromJSON(json['company']), + 'creditNotes': json['creditNotes'] == null ? undefined : DataStatusFromJSON(json['creditNotes']), + 'customers': json['customers'] == null ? undefined : DataStatusFromJSON(json['customers']), + 'directCosts': json['directCosts'] == null ? undefined : DataStatusFromJSON(json['directCosts']), + 'directIncomes': json['directIncomes'] == null ? undefined : DataStatusFromJSON(json['directIncomes']), + 'invoices': json['invoices'] == null ? undefined : DataStatusFromJSON(json['invoices']), + 'itemReceipts': json['itemReceipts'] == null ? undefined : DataStatusFromJSON(json['itemReceipts']), + 'items': json['items'] == null ? undefined : DataStatusFromJSON(json['items']), + 'journalEntries': json['journalEntries'] == null ? undefined : DataStatusFromJSON(json['journalEntries']), + 'journals': json['journals'] == null ? undefined : DataStatusFromJSON(json['journals']), + 'paymentMethods': json['paymentMethods'] == null ? undefined : DataStatusFromJSON(json['paymentMethods']), + 'payments': json['payments'] == null ? undefined : DataStatusFromJSON(json['payments']), + 'profitAndLoss': json['profitAndLoss'] == null ? undefined : DataStatusFromJSON(json['profitAndLoss']), + 'purchaseOrders': json['purchaseOrders'] == null ? undefined : DataStatusFromJSON(json['purchaseOrders']), + 'salesOrders': json['salesOrders'] == null ? undefined : DataStatusFromJSON(json['salesOrders']), + 'suppliers': json['suppliers'] == null ? undefined : DataStatusFromJSON(json['suppliers']), + 'taxRates': json['taxRates'] == null ? undefined : DataStatusFromJSON(json['taxRates']), + 'trackingCategories': json['trackingCategories'] == null ? undefined : DataStatusFromJSON(json['trackingCategories']), + 'transfers': json['transfers'] == null ? undefined : DataStatusFromJSON(json['transfers']), + 'bankingAccountBalances': json['banking-accountBalances'] == null ? undefined : DataStatusFromJSON(json['banking-accountBalances']), + 'bankingAccounts': json['banking-accounts'] == null ? undefined : DataStatusFromJSON(json['banking-accounts']), + 'bankingTransactionCategories': json['banking-transactionCategories'] == null ? undefined : DataStatusFromJSON(json['banking-transactionCategories']), + 'bankingTransactions': json['banking-transactions'] == null ? undefined : DataStatusFromJSON(json['banking-transactions']), + 'commerceCompanyInfo': json['commerce-companyInfo'] == null ? undefined : DataStatusFromJSON(json['commerce-companyInfo']), + 'commerceCustomers': json['commerce-customers'] == null ? undefined : DataStatusFromJSON(json['commerce-customers']), + 'commerceDisputes': json['commerce-disputes'] == null ? undefined : DataStatusFromJSON(json['commerce-disputes']), + 'commerceLocations': json['commerce-locations'] == null ? undefined : DataStatusFromJSON(json['commerce-locations']), + 'commerceOrders': json['commerce-orders'] == null ? undefined : DataStatusFromJSON(json['commerce-orders']), + 'commercePaymentMethods': json['commerce-paymentMethods'] == null ? undefined : DataStatusFromJSON(json['commerce-paymentMethods']), + 'commercePayments': json['commerce-payments'] == null ? undefined : DataStatusFromJSON(json['commerce-payments']), + 'commerceProductCategories': json['commerce-productCategories'] == null ? undefined : DataStatusFromJSON(json['commerce-productCategories']), + 'commerceProducts': json['commerce-products'] == null ? undefined : DataStatusFromJSON(json['commerce-products']), + 'commerceTaxComponents': json['commerce-taxComponents'] == null ? undefined : DataStatusFromJSON(json['commerce-taxComponents']), + 'commerceTransactions': json['commerce-transactions'] == null ? undefined : DataStatusFromJSON(json['commerce-transactions']), + }; +} + +export function DataStatusesToJSON(json: any): DataStatuses { + return DataStatusesToJSONTyped(json, false); +} + +export function DataStatusesToJSONTyped(value?: DataStatuses | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const DataStatuses$inboundSchema: z.ZodType< - DataStatuses, - z.ZodTypeDef, - unknown -> = z.object({ - accountTransactions: DataStatus$inboundSchema.optional(), - balanceSheet: DataStatus$inboundSchema.optional(), - bankAccounts: DataStatus$inboundSchema.optional(), - bankTransactions: DataStatus$inboundSchema.optional(), - billCreditNotes: DataStatus$inboundSchema.optional(), - billPayments: DataStatus$inboundSchema.optional(), - bills: DataStatus$inboundSchema.optional(), - cashFlowStatement: DataStatus$inboundSchema.optional(), - chartOfAccounts: DataStatus$inboundSchema.optional(), - company: DataStatus$inboundSchema.optional(), - creditNotes: DataStatus$inboundSchema.optional(), - customers: DataStatus$inboundSchema.optional(), - directCosts: DataStatus$inboundSchema.optional(), - directIncomes: DataStatus$inboundSchema.optional(), - invoices: DataStatus$inboundSchema.optional(), - itemReceipts: DataStatus$inboundSchema.optional(), - items: DataStatus$inboundSchema.optional(), - journalEntries: DataStatus$inboundSchema.optional(), - journals: DataStatus$inboundSchema.optional(), - paymentMethods: DataStatus$inboundSchema.optional(), - payments: DataStatus$inboundSchema.optional(), - profitAndLoss: DataStatus$inboundSchema.optional(), - purchaseOrders: DataStatus$inboundSchema.optional(), - salesOrders: DataStatus$inboundSchema.optional(), - suppliers: DataStatus$inboundSchema.optional(), - taxRates: DataStatus$inboundSchema.optional(), - trackingCategories: DataStatus$inboundSchema.optional(), - transfers: DataStatus$inboundSchema.optional(), - "banking-accountBalances": DataStatus$inboundSchema.optional(), - "banking-accounts": DataStatus$inboundSchema.optional(), - "banking-transactionCategories": DataStatus$inboundSchema.optional(), - "banking-transactions": DataStatus$inboundSchema.optional(), - "commerce-companyInfo": DataStatus$inboundSchema.optional(), - "commerce-customers": DataStatus$inboundSchema.optional(), - "commerce-disputes": DataStatus$inboundSchema.optional(), - "commerce-locations": DataStatus$inboundSchema.optional(), - "commerce-orders": DataStatus$inboundSchema.optional(), - "commerce-paymentMethods": DataStatus$inboundSchema.optional(), - "commerce-payments": DataStatus$inboundSchema.optional(), - "commerce-productCategories": DataStatus$inboundSchema.optional(), - "commerce-products": DataStatus$inboundSchema.optional(), - "commerce-taxComponents": DataStatus$inboundSchema.optional(), - "commerce-transactions": DataStatus$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "banking-accountBalances": "bankingAccountBalances", - "banking-accounts": "bankingAccounts", - "banking-transactionCategories": "bankingTransactionCategories", - "banking-transactions": "bankingTransactions", - "commerce-companyInfo": "commerceCompanyInfo", - "commerce-customers": "commerceCustomers", - "commerce-disputes": "commerceDisputes", - "commerce-locations": "commerceLocations", - "commerce-orders": "commerceOrders", - "commerce-paymentMethods": "commercePaymentMethods", - "commerce-payments": "commercePayments", - "commerce-productCategories": "commerceProductCategories", - "commerce-products": "commerceProducts", - "commerce-taxComponents": "commerceTaxComponents", - "commerce-transactions": "commerceTransactions", - }); -}); + return { + + 'accountTransactions': DataStatusToJSON(value['accountTransactions']), + 'balanceSheet': DataStatusToJSON(value['balanceSheet']), + 'bankAccounts': DataStatusToJSON(value['bankAccounts']), + 'bankTransactions': DataStatusToJSON(value['bankTransactions']), + 'billCreditNotes': DataStatusToJSON(value['billCreditNotes']), + 'billPayments': DataStatusToJSON(value['billPayments']), + 'bills': DataStatusToJSON(value['bills']), + 'cashFlowStatement': DataStatusToJSON(value['cashFlowStatement']), + 'chartOfAccounts': DataStatusToJSON(value['chartOfAccounts']), + 'company': DataStatusToJSON(value['company']), + 'creditNotes': DataStatusToJSON(value['creditNotes']), + 'customers': DataStatusToJSON(value['customers']), + 'directCosts': DataStatusToJSON(value['directCosts']), + 'directIncomes': DataStatusToJSON(value['directIncomes']), + 'invoices': DataStatusToJSON(value['invoices']), + 'itemReceipts': DataStatusToJSON(value['itemReceipts']), + 'items': DataStatusToJSON(value['items']), + 'journalEntries': DataStatusToJSON(value['journalEntries']), + 'journals': DataStatusToJSON(value['journals']), + 'paymentMethods': DataStatusToJSON(value['paymentMethods']), + 'payments': DataStatusToJSON(value['payments']), + 'profitAndLoss': DataStatusToJSON(value['profitAndLoss']), + 'purchaseOrders': DataStatusToJSON(value['purchaseOrders']), + 'salesOrders': DataStatusToJSON(value['salesOrders']), + 'suppliers': DataStatusToJSON(value['suppliers']), + 'taxRates': DataStatusToJSON(value['taxRates']), + 'trackingCategories': DataStatusToJSON(value['trackingCategories']), + 'transfers': DataStatusToJSON(value['transfers']), + 'banking-accountBalances': DataStatusToJSON(value['bankingAccountBalances']), + 'banking-accounts': DataStatusToJSON(value['bankingAccounts']), + 'banking-transactionCategories': DataStatusToJSON(value['bankingTransactionCategories']), + 'banking-transactions': DataStatusToJSON(value['bankingTransactions']), + 'commerce-companyInfo': DataStatusToJSON(value['commerceCompanyInfo']), + 'commerce-customers': DataStatusToJSON(value['commerceCustomers']), + 'commerce-disputes': DataStatusToJSON(value['commerceDisputes']), + 'commerce-locations': DataStatusToJSON(value['commerceLocations']), + 'commerce-orders': DataStatusToJSON(value['commerceOrders']), + 'commerce-paymentMethods': DataStatusToJSON(value['commercePaymentMethods']), + 'commerce-payments': DataStatusToJSON(value['commercePayments']), + 'commerce-productCategories': DataStatusToJSON(value['commerceProductCategories']), + 'commerce-products': DataStatusToJSON(value['commerceProducts']), + 'commerce-taxComponents': DataStatusToJSON(value['commerceTaxComponents']), + 'commerce-transactions': DataStatusToJSON(value['commerceTransactions']), + }; +} + + +export interface CompanyDataStatusGetResponseDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} -export function dataStatusesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataStatuses$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataStatuses' from JSON`, - ); +export interface GetCompanyDataStatusResponseDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; } diff --git a/platform/src/sdk/models/shared/datatype.ts b/platform/src/sdk/models/shared/datatype.ts deleted file mode 100644 index 172647cea..000000000 --- a/platform/src/sdk/models/shared/datatype.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * Available data types - */ -export const DataType = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", -} as const; -/** - * Available data types - */ -export type DataType = ClosedEnum; - -/** @internal */ -export const DataType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataType); -/** @internal */ -export const DataType$outboundSchema: z.ZodNativeEnum = - DataType$inboundSchema; diff --git a/platform/src/sdk/models/shared/datatypefeature.ts b/platform/src/sdk/models/shared/datatypefeature.ts index 34f56f1d6..b91e1a2b3 100644 --- a/platform/src/sdk/models/shared/datatypefeature.ts +++ b/platform/src/sdk/models/shared/datatypefeature.ts @@ -1,44 +1,181 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 } from "./datatype.js"; +import type { DataType } from '../DataType'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; +import type { SupportedFeature } from './supportedfeature'; import { - SupportedFeature, - SupportedFeature$inboundSchema, -} from "./supportedfeature.js"; + SupportedFeatureFromJSON, + SupportedFeatureFromJSONTyped, + SupportedFeatureToJSON, + SupportedFeatureToJSONTyped, +} from './supportedfeature'; /** * Describes support for a given datatype and associated operations + * @export + * @interface DataTypeFeature */ -export type DataTypeFeature = { - /** - * Available data types - */ - dataType?: DataType | undefined; - supportedFeatures: Array; -}; - -/** @internal */ -export const DataTypeFeature$inboundSchema: z.ZodType< - DataTypeFeature, - z.ZodTypeDef, - unknown -> = z.object({ - dataType: DataType$inboundSchema.optional(), - supportedFeatures: z.array(SupportedFeature$inboundSchema), -}); - -export function dataTypeFeatureFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeFeature$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeFeature' from JSON`, - ); +export interface DataTypeFeature { + /** + * Available data types + * @type {string} + * @memberof DataTypeFeature + */ + dataType?: DataType; + /** + * + * @type {Array} + * @memberof DataTypeFeature + */ + supportedFeatures: Array; +} + + +/** + * @export + */ +export const DataTypeFeatureDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type DataTypeFeatureDataTypeEnum = typeof DataTypeFeatureDataTypeEnum[keyof typeof DataTypeFeatureDataTypeEnum]; + + +/** + * Check if a given object implements the DataTypeFeature interface. + */ +export function instanceOfDataTypeFeature(value: object): value is DataTypeFeature { + if (!('supportedFeatures' in value) || value['supportedFeatures'] === undefined) return false; + return true; +} + +export function DataTypeFeatureFromJSON(json: any): DataTypeFeature { + return DataTypeFeatureFromJSONTyped(json, false); +} + +export function DataTypeFeatureFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataTypeFeature { + if (json == null) { + return json; + } + return { + + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'supportedFeatures': ((json['supportedFeatures'] as Array).map(SupportedFeatureFromJSON)), + }; +} + +export function DataTypeFeatureToJSON(json: any): DataTypeFeature { + return DataTypeFeatureToJSONTyped(json, false); +} + +export function DataTypeFeatureToJSONTyped(value?: DataTypeFeature | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataType': value['dataType'], + 'supportedFeatures': ((value['supportedFeatures'] as Array).map(SupportedFeatureToJSON)), + }; +} + + +export interface GetIntegrationResponseDataTypeFeature { + /** + * Available data types + * @type {string} + * @memberof DataTypeFeature + */ + dataType?: DataTypeFeatureDataTypeEnum; + /** + * + * @type {Array} + * @memberof DataTypeFeature + */ + supportedFeatures: Array; +} + +export interface IntegrationDataTypeFeature { + /** + * Available data types + * @type {string} + * @memberof DataTypeFeature + */ + dataType?: DataTypeFeatureDataTypeEnum; + /** + * + * @type {Array} + * @memberof DataTypeFeature + */ + supportedFeatures: Array; +} + +export interface IntegrationGetResponseDataTypeFeature { + /** + * Available data types + * @type {string} + * @memberof DataTypeFeature + */ + dataType?: DataTypeFeatureDataTypeEnum; + /** + * + * @type {Array} + * @memberof DataTypeFeature + */ + supportedFeatures: Array; } diff --git a/platform/src/sdk/models/shared/datatypereadsummary.ts b/platform/src/sdk/models/shared/datatypereadsummary.ts index d7e90ce7f..7f9fd19d8 100644 --- a/platform/src/sdk/models/shared/datatypereadsummary.ts +++ b/platform/src/sdk/models/shared/datatypereadsummary.ts @@ -1,98 +1,221 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 type { DataType } from '../DataType'; +import type { Status } from './status'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; +import type { Issue } from './issue'; 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"; + IssueFromJSON, + IssueFromJSONTyped, + IssueToJSON, + IssueToJSONTyped, +} from './issue'; + +/** + * + * @export + * @interface DataTypeReadSummary + */ +export interface DataTypeReadSummary { + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof DataTypeReadSummary + */ + connectionId?: string; + /** + * Available data types + * @type {string} + * @memberof DataTypeReadSummary + */ + dataType?: DataType; + /** + * `True` if records have been created, updated or deleted in Codat's cache. + * @type {boolean} + * @memberof DataTypeReadSummary + */ + recordsModified?: boolean; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataTypeReadSummary + */ + status?: Status; + /** + * A array of issues encountered during a data read. + * @type {Array} + * @memberof DataTypeReadSummary + */ + issues?: Array | null; +} + + +/** + * @export + */ +export const DataTypeReadSummaryDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type DataTypeReadSummaryDataTypeEnum = typeof DataTypeReadSummaryDataTypeEnum[keyof typeof DataTypeReadSummaryDataTypeEnum]; + +/** + * @export + */ +export const DataTypeReadSummaryStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type DataTypeReadSummaryStatusEnum = typeof DataTypeReadSummaryStatusEnum[keyof typeof DataTypeReadSummaryStatusEnum]; -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; -}; +/** + * Check if a given object implements the DataTypeReadSummary interface. + */ +export function instanceOfDataTypeReadSummary(value: object): value is DataTypeReadSummary { + return true; +} + +export function DataTypeReadSummaryFromJSON(json: any): DataTypeReadSummary { + return DataTypeReadSummaryFromJSONTyped(json, false); +} + +export function DataTypeReadSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataTypeReadSummary { + if (json == null) { + return json; + } + return { + + 'connectionId': json['connectionId'] == null ? undefined : json['connectionId'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'recordsModified': json['recordsModified'] == null ? undefined : json['recordsModified'], + 'status': json['status'] == null ? undefined : json['status'], + 'issues': json['issues'] == null ? undefined : ((json['issues'] as Array).map(IssueFromJSON)), + }; +} + +export function DataTypeReadSummaryToJSON(json: any): DataTypeReadSummary { + return DataTypeReadSummaryToJSONTyped(json, false); +} -/** @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 DataTypeReadSummaryToJSONTyped(value?: DataTypeReadSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function dataTypeReadSummaryToJSON( - dataTypeReadSummary: DataTypeReadSummary, -): string { - return JSON.stringify( - DataTypeReadSummary$outboundSchema.parse(dataTypeReadSummary), - ); + return { + + 'connectionId': value['connectionId'], + 'dataType': value['dataType'], + 'recordsModified': value['recordsModified'], + 'status': value['status'], + 'issues': value['issues'] == null ? undefined : ((value['issues'] as Array).map(IssueToJSON)), + }; } -export function dataTypeReadSummaryFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeReadSummary$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeReadSummary' from JSON`, - ); + + +export interface ReadCompletedWebhookDataTypeReadSummary { + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof DataTypeReadSummary + */ + connectionId?: string; + /** + * Available data types + * @type {string} + * @memberof DataTypeReadSummary + */ + dataType?: DataTypeReadSummaryDataTypeEnum; + /** + * `True` if records have been created, updated or deleted in Codat's cache. + * @type {boolean} + * @memberof DataTypeReadSummary + */ + recordsModified?: boolean; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataTypeReadSummary + */ + status?: DataTypeReadSummaryStatusEnum; + /** + * A array of issues encountered during a data read. + * @type {Array} + * @memberof DataTypeReadSummary + */ + issues?: Array | null; } diff --git a/platform/src/sdk/models/shared/datatypewritewebhook.ts b/platform/src/sdk/models/shared/datatypewritewebhook.ts index e7bb1bc43..d65b8de19 100644 --- a/platform/src/sdk/models/shared/datatypewritewebhook.ts +++ b/platform/src/sdk/models/shared/datatypewritewebhook.ts @@ -1,96 +1,205 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { DataTypeWriteWebhookPayload } from './datatypewritewebhookpayload'; import { - DataTypeWriteWebhookPayload, - DataTypeWriteWebhookPayload$inboundSchema, - DataTypeWriteWebhookPayload$Outbound, - DataTypeWriteWebhookPayload$outboundSchema, -} from "./datatypewritewebhookpayload.js"; + DataTypeWriteWebhookPayloadFromJSON, + DataTypeWriteWebhookPayloadFromJSONTyped, + DataTypeWriteWebhookPayloadToJSON, + DataTypeWriteWebhookPayloadToJSONTyped, +} from './datatypewritewebhookpayload'; -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; -}; +/** + * + * @export + * @interface DataTypeWriteWebhook + */ +export interface DataTypeWriteWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + generatedDate?: string; + /** + * + * @type {DataTypeWriteWebhookPayload} + * @memberof DataTypeWriteWebhook + */ + payload?: DataTypeWriteWebhookPayload; +} + +/** + * Check if a given object implements the DataTypeWriteWebhook interface. + */ +export function instanceOfDataTypeWriteWebhook(value: object): value is DataTypeWriteWebhook { + return true; +} + +export function DataTypeWriteWebhookFromJSON(json: any): DataTypeWriteWebhook { + return DataTypeWriteWebhookFromJSONTyped(json, false); +} -/** @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; -}; +export function DataTypeWriteWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataTypeWriteWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : DataTypeWriteWebhookPayloadFromJSON(json['payload']), + }; +} + +export function DataTypeWriteWebhookToJSON(json: any): DataTypeWriteWebhook { + return DataTypeWriteWebhookToJSONTyped(json, false); +} -/** @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 DataTypeWriteWebhookToJSONTyped(value?: DataTypeWriteWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function dataTypeWriteWebhookToJSON( - dataTypeWriteWebhook: DataTypeWriteWebhook, -): string { - return JSON.stringify( - DataTypeWriteWebhook$outboundSchema.parse(dataTypeWriteWebhook), - ); + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': DataTypeWriteWebhookPayloadToJSON(value['payload']), + }; } -export function dataTypeWriteWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeWriteWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeWriteWebhook' from JSON`, - ); + + +export interface DataTypeWriteWebhookWriteDataTypeWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + generatedDate?: string; + /** + * + * @type {DataTypeWriteWebhookPayload} + * @memberof DataTypeWriteWebhook + */ + payload?: DataTypeWriteWebhookPayload; +} + +export interface WriteDataTypeWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhook + */ + generatedDate?: string; + /** + * + * @type {DataTypeWriteWebhookPayload} + * @memberof DataTypeWriteWebhook + */ + payload?: DataTypeWriteWebhookPayload; } diff --git a/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts b/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts index 401fdaa3d..c6811867b 100644 --- a/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts +++ b/platform/src/sdk/models/shared/datatypewritewebhookpayload.ts @@ -1,164 +1,382 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { DataTypeWriteWebhookRecord } from './datatypewritewebhookrecord'; import { - DataTypeWriteWebhookRecord, - DataTypeWriteWebhookRecord$inboundSchema, - DataTypeWriteWebhookRecord$Outbound, - DataTypeWriteWebhookRecord$outboundSchema, -} from "./datatypewritewebhookrecord.js"; + DataTypeWriteWebhookRecordFromJSON, + DataTypeWriteWebhookRecordFromJSONTyped, + DataTypeWriteWebhookRecordToJSON, + DataTypeWriteWebhookRecordToJSONTyped, +} from './datatypewritewebhookrecord'; +import type { WriteType } from './writetype'; import { - WriteStatus, - WriteStatus$inboundSchema, - WriteStatus$outboundSchema, -} from "./writestatus.js"; + WriteTypeFromJSON, + WriteTypeFromJSONTyped, + WriteTypeToJSON, + WriteTypeToJSONTyped, +} from './writetype'; +import type { WriteStatus } from './writestatus'; import { - WriteType, - WriteType$inboundSchema, - WriteType$outboundSchema, -} from "./writetype.js"; + WriteStatusFromJSON, + WriteStatusFromJSONTyped, + WriteStatusToJSON, + WriteStatusToJSONTyped, +} from './writestatus'; -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; -}; +/** + * + * @export + * @interface DataTypeWriteWebhookPayload + */ +export interface DataTypeWriteWebhookPayload { + /** + * Unique identifier of the write request. This is also known as the push operation ID. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + id?: string; + /** + * + * @type {WriteType} + * @memberof DataTypeWriteWebhookPayload + */ + type?: WriteType; + /** + * + * @type {CompanyReference} + * @memberof DataTypeWriteWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + connectionId?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + requestedOnDate?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + completedOnDate?: string; + /** + * + * @type {WriteStatus} + * @memberof DataTypeWriteWebhookPayload + */ + status?: WriteStatus; + /** + * + * @type {DataTypeWriteWebhookRecord} + * @memberof DataTypeWriteWebhookPayload + */ + record?: DataTypeWriteWebhookRecord; + /** + * Unique identifier for the uploaded attachment, null if no attachment uploaded. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + attachmentId?: string | null; +} + + + +/** + * Check if a given object implements the DataTypeWriteWebhookPayload interface. + */ +export function instanceOfDataTypeWriteWebhookPayload(value: object): value is DataTypeWriteWebhookPayload { + return true; +} + +export function DataTypeWriteWebhookPayloadFromJSON(json: any): DataTypeWriteWebhookPayload { + return DataTypeWriteWebhookPayloadFromJSONTyped(json, false); +} + +export function DataTypeWriteWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataTypeWriteWebhookPayload { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'type': json['type'] == null ? undefined : WriteTypeFromJSON(json['type']), + 'referenceCompany': json['referenceCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceCompany']), + 'connectionId': json['connectionId'] == null ? undefined : json['connectionId'], + 'requestedOnDate': json['requestedOnDate'] == null ? undefined : json['requestedOnDate'], + 'completedOnDate': json['completedOnDate'] == null ? undefined : json['completedOnDate'], + 'status': json['status'] == null ? undefined : WriteStatusFromJSON(json['status']), + 'record': json['record'] == null ? undefined : DataTypeWriteWebhookRecordFromJSON(json['record']), + 'attachmentId': json['attachmentId'] == null ? undefined : json['attachmentId'], + }; +} + +export function DataTypeWriteWebhookPayloadToJSON(json: any): DataTypeWriteWebhookPayload { + return DataTypeWriteWebhookPayloadToJSONTyped(json, false); +} + +export function DataTypeWriteWebhookPayloadToJSONTyped(value?: DataTypeWriteWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @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; -}; + return { + + 'id': value['id'], + 'type': WriteTypeToJSON(value['type']), + 'referenceCompany': CompanyReferenceToJSON(value['referenceCompany']), + 'connectionId': value['connectionId'], + 'requestedOnDate': value['requestedOnDate'], + 'completedOnDate': value['completedOnDate'], + 'status': WriteStatusToJSON(value['status']), + 'record': DataTypeWriteWebhookRecordToJSON(value['record']), + 'attachmentId': value['attachmentId'], + }; +} -/** @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 interface DataTypeWriteWebhookDataTypeWriteWebhookPayload { + /** + * Unique identifier of the write request. This is also known as the push operation ID. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + id?: string; + /** + * + * @type {WriteType} + * @memberof DataTypeWriteWebhookPayload + */ + type?: WriteType; + /** + * + * @type {CompanyReference} + * @memberof DataTypeWriteWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + connectionId?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + requestedOnDate?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + completedOnDate?: string; + /** + * + * @type {WriteStatus} + * @memberof DataTypeWriteWebhookPayload + */ + status?: WriteStatus; + /** + * + * @type {DataTypeWriteWebhookRecord} + * @memberof DataTypeWriteWebhookPayload + */ + record?: DataTypeWriteWebhookRecord; + /** + * Unique identifier for the uploaded attachment, null if no attachment uploaded. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + attachmentId?: string | null; } -export function dataTypeWriteWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataTypeWriteWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataTypeWriteWebhookPayload' from JSON`, - ); + +export interface WriteDataTypeWebhookDataTypeWriteWebhookPayload { + /** + * Unique identifier of the write request. This is also known as the push operation ID. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + id?: string; + /** + * + * @type {WriteType} + * @memberof DataTypeWriteWebhookPayload + */ + type?: WriteType; + /** + * + * @type {CompanyReference} + * @memberof DataTypeWriteWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + connectionId?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + requestedOnDate?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + completedOnDate?: string; + /** + * + * @type {WriteStatus} + * @memberof DataTypeWriteWebhookPayload + */ + status?: WriteStatus; + /** + * + * @type {DataTypeWriteWebhookRecord} + * @memberof DataTypeWriteWebhookPayload + */ + record?: DataTypeWriteWebhookRecord; + /** + * Unique identifier for the uploaded attachment, null if no attachment uploaded. + * @type {string} + * @memberof DataTypeWriteWebhookPayload + */ + attachmentId?: string | null; } diff --git a/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts b/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts index 9170a229d..e22b42249 100644 --- a/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts +++ b/platform/src/sdk/models/shared/datatypewritewebhookrecord.ts @@ -1,54 +1,83 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DataTypeWriteWebhookRecord + */ +export interface DataTypeWriteWebhookRecord { + /** + * The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. + * @type {string} + * @memberof DataTypeWriteWebhookRecord + */ + id?: string; +} + +/** + * Check if a given object implements the DataTypeWriteWebhookRecord interface. + */ +export function instanceOfDataTypeWriteWebhookRecord(value: object): value is DataTypeWriteWebhookRecord { + return true; +} + +export function DataTypeWriteWebhookRecordFromJSON(json: any): DataTypeWriteWebhookRecord { + return DataTypeWriteWebhookRecordFromJSONTyped(json, false); +} + +export function DataTypeWriteWebhookRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataTypeWriteWebhookRecord { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function DataTypeWriteWebhookRecordToJSON(json: any): DataTypeWriteWebhookRecord { + return DataTypeWriteWebhookRecordToJSONTyped(json, false); +} + +export function DataTypeWriteWebhookRecordToJSONTyped(value?: DataTypeWriteWebhookRecord | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface DataTypeWriteWebhookDataTypeWriteWebhookRecord { + /** + * The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. + * @type {string} + * @memberof DataTypeWriteWebhookRecord + */ + id?: string; +} + +export interface WriteDataTypeWebhookDataTypeWriteWebhookRecord { + /** + * The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. + * @type {string} + * @memberof DataTypeWriteWebhookRecord + */ + id?: string; } diff --git a/platform/src/sdk/models/shared/errormessage.ts b/platform/src/sdk/models/shared/errormessage.ts deleted file mode 100644 index f052946a0..000000000 --- a/platform/src/sdk/models/shared/errormessage.ts +++ /dev/null @@ -1,71 +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 { - ErrorValidation, - ErrorValidation$inboundSchema, -} from "./errorvalidation.js"; - -/** - * Too many requests were made in a given amount of time. Wait a short period and then try again. - */ -export type ErrorMessage = { - /** - * The HTTP status code returned by the error. - */ - statusCode?: number | undefined; - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; -}; - -/** @internal */ -export const ErrorMessage$inboundSchema: z.ZodType< - ErrorMessage, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - service: z.string().optional(), - error: z.string().optional(), - correlationId: z.string().optional(), - validation: z.nullable(ErrorValidation$inboundSchema).optional(), - canBeRetried: z.string().optional(), - detailedErrorCode: z.number().int().optional(), -}); - -export function errorMessageFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorMessage$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorMessage' from JSON`, - ); -} diff --git a/platform/src/sdk/models/shared/errorvalidation.ts b/platform/src/sdk/models/shared/errorvalidation.ts index dc97b86b1..e8efbfb32 100644 --- a/platform/src/sdk/models/shared/errorvalidation.ts +++ b/platform/src/sdk/models/shared/errorvalidation.ts @@ -1,40 +1,156 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ErrorValidationItem } from './errorvalidationitem'; import { - ErrorValidationItem, - ErrorValidationItem$inboundSchema, -} from "./errorvalidationitem.js"; + ErrorValidationItemFromJSON, + ErrorValidationItemFromJSONTyped, + ErrorValidationItemToJSON, + ErrorValidationItemToJSONTyped, +} from './errorvalidationitem'; /** * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + * @export + * @interface ErrorValidation */ -export type ErrorValidation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const ErrorValidation$inboundSchema: z.ZodType< - ErrorValidation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), -}); - -export function errorValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidation' from JSON`, - ); +export interface ErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the ErrorValidation interface. + */ +export function instanceOfErrorValidation(value: object): value is ErrorValidation { + return true; +} + +export function ErrorValidationFromJSON(json: any): ErrorValidation { + return ErrorValidationFromJSONTyped(json, false); +} + +export function ErrorValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ErrorValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ErrorValidationItemFromJSON)), + }; +} + +export function ErrorValidationToJSON(json: any): ErrorValidation { + return ErrorValidationToJSONTyped(json, false); +} + +export function ErrorValidationToJSONTyped(value?: ErrorValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ErrorValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ErrorValidationItemToJSON)), + }; +} + + +export interface ApiKeyCreateResponseErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +export interface CreateApiKeyResponseErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +export interface ErrorMessageErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +export interface ProductDataRefreshResponseErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +export interface RefreshProductDataResponseErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; } diff --git a/platform/src/sdk/models/shared/errorvalidationitem.ts b/platform/src/sdk/models/shared/errorvalidationitem.ts index cd21ec230..b982429c7 100644 --- a/platform/src/sdk/models/shared/errorvalidationitem.ts +++ b/platform/src/sdk/models/shared/errorvalidationitem.ts @@ -1,44 +1,102 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 ErrorValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ErrorValidationItem$inboundSchema: z.ZodType< - ErrorValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function errorValidationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ErrorValidationItem + */ +export interface ErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ErrorValidationItem interface. + */ +export function instanceOfErrorValidationItem(value: object): value is ErrorValidationItem { + return true; +} + +export function ErrorValidationItemFromJSON(json: any): ErrorValidationItem { + return ErrorValidationItemFromJSONTyped(json, false); +} + +export function ErrorValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidationItem { + if (json == null) { + return json; + } + return { + + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ErrorValidationItemToJSON(json: any): ErrorValidationItem { + return ErrorValidationItemToJSONTyped(json, false); +} + +export function ErrorValidationItemToJSONTyped(value?: ErrorValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface ErrorMessageErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; } diff --git a/platform/src/sdk/models/shared/featurestate.ts b/platform/src/sdk/models/shared/featurestate.ts index 66d26abb5..bcd111ca4 100644 --- a/platform/src/sdk/models/shared/featurestate.ts +++ b/platform/src/sdk/models/shared/featurestate.ts @@ -1,26 +1,57 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current release state of the feature. + * @export */ export const FeatureState = { - Release: "Release", - Alpha: "Alpha", - Beta: "Beta", - Deprecated: "Deprecated", - NotSupported: "NotSupported", - NotImplemented: "NotImplemented", + Release: 'Release', + Alpha: 'Alpha', + Beta: 'Beta', + Deprecated: 'Deprecated', + NotSupported: 'NotSupported', + NotImplemented: 'NotImplemented' } as const; -/** - * The current release state of the feature. - */ -export type FeatureState = ClosedEnum; +export type FeatureState = typeof FeatureState[keyof typeof FeatureState]; + + +export function instanceOfFeatureState(value: any): boolean { + for (const key in FeatureState) { + if (Object.prototype.hasOwnProperty.call(FeatureState, key)) { + if (FeatureState[key as keyof typeof FeatureState] === value) { + return true; + } + } + } + return false; +} + +export function FeatureStateFromJSON(json: any): FeatureState { + return FeatureStateFromJSONTyped(json, false); +} + +export function FeatureStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureState { + return json as FeatureState; +} + +export function FeatureStateToJSON(value?: FeatureState | null): any { + return value as any; +} + +export function FeatureStateToJSONTyped(value: any, ignoreDiscriminator: boolean): FeatureState { + return value as FeatureState; +} -/** @internal */ -export const FeatureState$inboundSchema: z.ZodNativeEnum = - z.nativeEnum(FeatureState); diff --git a/platform/src/sdk/models/shared/featuretype.ts b/platform/src/sdk/models/shared/featuretype.ts index 18b7077bf..d862d115d 100644 --- a/platform/src/sdk/models/shared/featuretype.ts +++ b/platform/src/sdk/models/shared/featuretype.ts @@ -1,30 +1,61 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The type of feature. + * @export */ export const FeatureType = { - Get: "Get", - Post: "Post", - Categorization: "Categorization", - Delete: "Delete", - Put: "Put", - GetAsPdf: "GetAsPdf", - DownloadAttachment: "DownloadAttachment", - GetAttachment: "GetAttachment", - GetAttachments: "GetAttachments", - UploadAttachment: "UploadAttachment", + Get: 'Get', + Post: 'Post', + Categorization: 'Categorization', + Delete: 'Delete', + Put: 'Put', + GetAsPdf: 'GetAsPdf', + DownloadAttachment: 'DownloadAttachment', + GetAttachment: 'GetAttachment', + GetAttachments: 'GetAttachments', + UploadAttachment: 'UploadAttachment' } as const; -/** - * The type of feature. - */ -export type FeatureType = ClosedEnum; +export type FeatureType = typeof FeatureType[keyof typeof FeatureType]; + + +export function instanceOfFeatureType(value: any): boolean { + for (const key in FeatureType) { + if (Object.prototype.hasOwnProperty.call(FeatureType, key)) { + if (FeatureType[key as keyof typeof FeatureType] === value) { + return true; + } + } + } + return false; +} + +export function FeatureTypeFromJSON(json: any): FeatureType { + return FeatureTypeFromJSONTyped(json, false); +} + +export function FeatureTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureType { + return json as FeatureType; +} + +export function FeatureTypeToJSON(value?: FeatureType | null): any { + return value as any; +} + +export function FeatureTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): FeatureType { + return value as FeatureType; +} -/** @internal */ -export const FeatureType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(FeatureType); diff --git a/platform/src/sdk/models/shared/halref.ts b/platform/src/sdk/models/shared/halref.ts index 921d594fb..4b4b5b7c6 100644 --- a/platform/src/sdk/models/shared/halref.ts +++ b/platform/src/sdk/models/shared/halref.ts @@ -1,31 +1,227 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 HalRef = { - /** - * Uri hypertext reference. - */ - href?: string | undefined; -}; - -/** @internal */ -export const HalRef$inboundSchema: z.ZodType = z - .object({ - href: z.string().optional(), - }); - -export function halRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => HalRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'HalRef' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface HalRef + */ +export interface HalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +/** + * Check if a given object implements the HalRef interface. + */ +export function instanceOfHalRef(value: object): value is HalRef { + return true; +} + +export function HalRefFromJSON(json: any): HalRef { + return HalRefFromJSONTyped(json, false); +} + +export function HalRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): HalRef { + if (json == null) { + return json; + } + return { + + 'href': json['href'] == null ? undefined : json['href'], + }; +} + +export function HalRefToJSON(json: any): HalRef { + return HalRefToJSONTyped(json, false); +} + +export function HalRefToJSONTyped(value?: HalRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'href': value['href'], + }; +} + + +export interface CompaniesHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompaniesListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompanyPushHistoryGetResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface GetCompanyPushHistoryResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface IntegrationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface IntegrationsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface LinksHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCompaniesResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListConnectionsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListIntegrationsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListPullOperationsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PaginationInformationHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PagingInfoHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PushOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; } diff --git a/platform/src/sdk/models/shared/imagereference.ts b/platform/src/sdk/models/shared/imagereference.ts index e850fa584..c61aca5bc 100644 --- a/platform/src/sdk/models/shared/imagereference.ts +++ b/platform/src/sdk/models/shared/imagereference.ts @@ -1,42 +1,88 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; /** * Image reference. + * @export + * @interface ImageReference */ -export type ImageReference = { - /** - * Source URL for image. - */ - src?: string | undefined; - /** - * Alternative text when image is not available. - */ - alt?: string | undefined; -}; - -/** @internal */ -export const ImageReference$inboundSchema: z.ZodType< - ImageReference, - z.ZodTypeDef, - unknown -> = z.object({ - src: z.string().optional(), - alt: z.string().optional(), -}); - -export function imageReferenceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ImageReference$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ImageReference' from JSON`, - ); +export interface ImageReference { + /** + * Source URL for image. + * @type {string} + * @memberof ImageReference + */ + src?: string; + /** + * Alternative text when image is not available. + * @type {string} + * @memberof ImageReference + */ + alt?: string; +} + +/** + * Check if a given object implements the ImageReference interface. + */ +export function instanceOfImageReference(value: object): value is ImageReference { + return true; +} + +export function ImageReferenceFromJSON(json: any): ImageReference { + return ImageReferenceFromJSONTyped(json, false); +} + +export function ImageReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImageReference { + if (json == null) { + return json; + } + return { + + 'src': json['src'] == null ? undefined : json['src'], + 'alt': json['alt'] == null ? undefined : json['alt'], + }; +} + +export function ImageReferenceToJSON(json: any): ImageReference { + return ImageReferenceToJSONTyped(json, false); +} + +export function ImageReferenceToJSONTyped(value?: ImageReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'src': value['src'], + 'alt': value['alt'], + }; +} + + +export interface BrandingImageReference { + /** + * Source URL for image. + * @type {string} + * @memberof ImageReference + */ + src?: string; + /** + * Alternative text when image is not available. + * @type {string} + * @memberof ImageReference + */ + alt?: string; } diff --git a/platform/src/sdk/models/shared/index.ts b/platform/src/sdk/models/shared/index.ts index e36e825f7..f68ac1286 100644 --- a/platform/src/sdk/models/shared/index.ts +++ b/platform/src/sdk/models/shared/index.ts @@ -1,87 +1,94 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./apikeydetails.js"; -export * from "./apikeys.js"; -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"; -export * from "./customdatatyperecords.js"; -export * from "./dataconnectionerror.js"; -export * from "./dataconnectionstatus.js"; -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"; -export * from "./featurestate.js"; -export * from "./featuretype.js"; -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"; -export * from "./pulloperations.js"; -export * from "./pushchangetype.js"; -export * from "./pushfieldvalidation.js"; -export * from "./pushoperation.js"; -export * from "./pushoperationchange.js"; -export * from "./pushoperationref.js"; -export * from "./pushoperations.js"; -export * from "./pushoperationstatus.js"; -export * from "./pushoption.js"; -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"; -export * from "./status.js"; -export * from "./supplementaldataconfiguration.js"; -export * from "./supportedfeature.js"; -export * from "./syncsetting.js"; -export * from "./syncsettings.js"; -export * from "./updateconnectionstatus.js"; -export * from "./validation.js"; -export * from "./validationitem.js"; -export * from "./validationitem1.js"; -export * from "./validationresult.js"; -export * from "./webhookconsumer.js"; -export * from "./webhookconsumerprototype.js"; -export * from "./webhookconsumers.js"; -export * from "./writestatus.js"; -export * from "./writetype.js"; +export * from './apikeydetails'; +export * from './apikeys'; +export * from './branding'; +export * from './brandingbutton'; +export * from './brandingimage'; +export * from './brandinglogo'; +export * from './clientratelimitwebhook'; +export * from './clientratelimitwebhookpayload'; +export * from './companies'; +export * from './company'; +export * from './companyaccesstoken'; +export * from './companydetails'; +export * from './companyreference'; +export * from './companyreferencelinks'; +export * from './companyrequestbody'; +export * from './companysyncsettings'; +export * from './companyupdaterequest'; +export * from './companywebhook'; +export * from './connection'; +export * from './connectionmanagementaccesstoken'; +export * from './connectionmanagementallowedorigins'; +export * from './connectionwebhook'; +export * from './connectionwebhookpayload'; +export * from './connections'; +export * from './createapikey'; +export * from './customdatatypeconfiguration'; +export * from './customdatatyperecord'; +export * from './customdatatyperecords'; +export * from './dataconnectionerror'; +export * from './dataconnectionstatus'; +export * from './datastatus'; +export * from './datastatuses'; +export * from './datatypefeature'; +export * from './datatypereadsummary'; +export * from './datatypewritewebhook'; +export * from './datatypewritewebhookpayload'; +export * from './datatypewritewebhookrecord'; +export * from './errorvalidation'; +export * from './errorvalidationitem'; +export * from './featurestate'; +export * from './featuretype'; +export * from './halref'; +export * from './imagereference'; +export * from './integration'; +export * from './integrations'; +export * from './issue'; +export * from './issuelinks'; +export * from './links'; +export * from './modifieddate'; +export * from './profile'; +export * from './pulloperation'; +export * from './pulloperations'; +export * from './pushchangetype'; +export * from './pushfieldvalidation'; +export * from './pushoperation'; +export * from './pushoperationchange'; +export * from './pushoperationref'; +export * from './pushoperationstatus'; +export * from './pushoperations'; +export * from './pushoption'; +export * from './pushoptionchoice'; +export * from './pushoptionproperty'; +export * from './pushoptiontype'; +export * from './pushvalidationinfo'; +export * from './readcompletedwebhook'; +export * from './readcompletedwebhookpayload'; +export * from './sourcetype'; +export * from './status'; +export * from './supplementaldataconfiguration'; +export * from './supplementaldatasourceconfiguration'; +export * from './supportedfeature'; +export * from './syncsetting'; +export * from './syncsettings'; +export * from './updateconnectionstatus'; +export * from './validation'; +export * from './validationitem'; +export * from './validationitem1'; +export * from './validationresult'; +export * from './webhookconsumer'; +export * from './webhookconsumerprototype'; +export * from './webhookconsumers'; +export * from './writestatus'; +export * from './writetype'; +export { Content } from '../_speakeasy_hoisted'; +export { DataType } from '../DataType'; +export { DataTypes } from '../_speakeasy_enums'; +export { DatasetStatus } from '../_speakeasy_enums'; +export { ErrorMessage } from '../ErrorMessage'; +export { ErrorStatus } from '../_speakeasy_enums'; +export { SchemaDataType } from '../_speakeasy_enums'; +export type { Security } from '../../../lib/sdkconfig'; diff --git a/platform/src/sdk/models/shared/integration.ts b/platform/src/sdk/models/shared/integration.ts index 0642629ea..16a1200b3 100644 --- a/platform/src/sdk/models/shared/integration.ts +++ b/platform/src/sdk/models/shared/integration.ts @@ -1,89 +1,511 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { DataTypeFeature } from './datatypefeature'; +import { + DataTypeFeatureFromJSON, + DataTypeFeatureFromJSONTyped, + DataTypeFeatureToJSON, + DataTypeFeatureToJSONTyped, +} from './datatypefeature'; +import type { SourceType } from './sourcetype'; import { - DataTypeFeature, - DataTypeFeature$inboundSchema, -} from "./datatypefeature.js"; -import { SourceType, SourceType$inboundSchema } from "./sourcetype.js"; + SourceTypeFromJSON, + SourceTypeFromJSONTyped, + SourceTypeToJSON, + SourceTypeToJSONTyped, +} from './sourcetype'; /** * An integration that Codat supports + * @export + * @interface Integration + */ +export interface Integration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; +} + + + +/** + * Check if a given object implements the Integration interface. */ -export type Integration = { - /** - * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. - */ - key: string; - /** - * Static url for integration's logo. - */ - logoUrl: string; - /** - * Name of integration. - */ - name: string; - /** - * Whether this integration is enabled for your customers to use. - */ - enabled: boolean; - /** - * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. - */ - sourceId?: string | undefined; - /** - * The type of platform of the connection. - */ - sourceType?: SourceType | undefined; - /** - * A Codat ID representing the integration. - */ - integrationId?: string | undefined; - /** - * `True` if the integration is to an application installed and run locally on an SMBs computer. - */ - isOfflineConnector?: boolean | undefined; - /** - * `True` if the integration is currently in beta release. - */ - isBeta?: boolean | undefined; - /** - * The name of the data provider. - */ - dataProvidedBy?: string | undefined; - datatypeFeatures?: Array | undefined; -}; - -/** @internal */ -export const Integration$inboundSchema: z.ZodType< - Integration, - z.ZodTypeDef, - unknown -> = z.object({ - key: z.string(), - logoUrl: z.string(), - name: z.string(), - enabled: z.boolean(), - sourceId: z.string().optional(), - sourceType: SourceType$inboundSchema.optional(), - integrationId: z.string().optional(), - isOfflineConnector: z.boolean().optional(), - isBeta: z.boolean().optional(), - dataProvidedBy: z.string().optional(), - datatypeFeatures: z.array(DataTypeFeature$inboundSchema).optional(), -}); - -export function integrationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Integration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Integration' from JSON`, - ); +export function instanceOfIntegration(value: object): value is Integration { + if (!('key' in value) || value['key'] === undefined) return false; + if (!('logoUrl' in value) || value['logoUrl'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('enabled' in value) || value['enabled'] === undefined) return false; + return true; +} + +export function IntegrationFromJSON(json: any): Integration { + return IntegrationFromJSONTyped(json, false); +} + +export function IntegrationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Integration { + if (json == null) { + return json; + } + return { + + 'key': json['key'], + 'logoUrl': json['logoUrl'], + 'name': json['name'], + 'enabled': json['enabled'], + 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'], + 'sourceType': json['sourceType'] == null ? undefined : SourceTypeFromJSON(json['sourceType']), + 'integrationId': json['integrationId'] == null ? undefined : json['integrationId'], + 'isOfflineConnector': json['isOfflineConnector'] == null ? undefined : json['isOfflineConnector'], + 'isBeta': json['isBeta'] == null ? undefined : json['isBeta'], + 'dataProvidedBy': json['dataProvidedBy'] == null ? undefined : json['dataProvidedBy'], + 'datatypeFeatures': json['datatypeFeatures'] == null ? undefined : ((json['datatypeFeatures'] as Array).map(DataTypeFeatureFromJSON)), + }; +} + +export function IntegrationToJSON(json: any): Integration { + return IntegrationToJSONTyped(json, false); +} + +export function IntegrationToJSONTyped(value?: Integration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'key': value['key'], + 'logoUrl': value['logoUrl'], + 'name': value['name'], + 'enabled': value['enabled'], + 'sourceId': value['sourceId'], + 'sourceType': SourceTypeToJSON(value['sourceType']), + 'integrationId': value['integrationId'], + 'isOfflineConnector': value['isOfflineConnector'], + 'isBeta': value['isBeta'], + 'dataProvidedBy': value['dataProvidedBy'], + 'datatypeFeatures': value['datatypeFeatures'] == null ? undefined : ((value['datatypeFeatures'] as Array).map(DataTypeFeatureToJSON)), + }; +} + + +export interface GetIntegrationResponseIntegration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; +} + +export interface IntegrationGetResponseIntegration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; +} + +export interface IntegrationsIntegration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; +} + +export interface IntegrationsListResponseIntegration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; +} + +export interface ListIntegrationsResponseIntegration { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof Integration + */ + key: string; + /** + * Static url for integration's logo. + * @type {string} + * @memberof Integration + */ + logoUrl: string; + /** + * Name of integration. + * @type {string} + * @memberof Integration + */ + name: string; + /** + * Whether this integration is enabled for your customers to use. + * @type {boolean} + * @memberof Integration + */ + enabled: boolean; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Integration + */ + sourceId?: string; + /** + * + * @type {SourceType} + * @memberof Integration + */ + sourceType?: SourceType; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Integration + */ + integrationId?: string; + /** + * `True` if the integration is to an application installed and run locally on an SMBs computer. + * @type {boolean} + * @memberof Integration + */ + isOfflineConnector?: boolean; + /** + * `True` if the integration is currently in beta release. + * @type {boolean} + * @memberof Integration + */ + isBeta?: boolean; + /** + * The name of the data provider. + * @type {string} + * @memberof Integration + */ + dataProvidedBy?: string; + /** + * + * @type {Array} + * @memberof Integration + */ + datatypeFeatures?: Array; } diff --git a/platform/src/sdk/models/shared/integrations.ts b/platform/src/sdk/models/shared/integrations.ts index 133f44898..8afdaf4cf 100644 --- a/platform/src/sdk/models/shared/integrations.ts +++ b/platform/src/sdk/models/shared/integrations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Integration, Integration$inboundSchema } from "./integration.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Integrations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Integrations$inboundSchema: z.ZodType< - Integrations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Integration$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function integrationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Integrations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Integrations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Integration } from './integration'; +import { + IntegrationFromJSON, + IntegrationFromJSONTyped, + IntegrationToJSON, + IntegrationToJSONTyped, +} from './integration'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Integrations + */ +export interface Integrations { + /** + * Current page number. + * @type {number} + * @memberof Integrations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Integrations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Integrations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Integrations + */ + links: Links; + /** + * + * @type {Array} + * @memberof Integrations + */ + results?: Array; +} + +/** + * Check if a given object implements the Integrations interface. + */ +export function instanceOfIntegrations(value: object): value is Integrations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function IntegrationsFromJSON(json: any): Integrations { + return IntegrationsFromJSONTyped(json, false); +} + +export function IntegrationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Integrations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(IntegrationFromJSON)), + }; +} + +export function IntegrationsToJSON(json: any): Integrations { + return IntegrationsToJSONTyped(json, false); +} + +export function IntegrationsToJSONTyped(value?: Integrations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(IntegrationToJSON)), + }; +} + + +export interface IntegrationsListResponseIntegrations { + /** + * Current page number. + * @type {number} + * @memberof Integrations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Integrations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Integrations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Integrations + */ + links: Links; + /** + * + * @type {Array} + * @memberof Integrations + */ + results?: Array; +} + +export interface ListIntegrationsResponseIntegrations { + /** + * Current page number. + * @type {number} + * @memberof Integrations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Integrations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Integrations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Integrations + */ + links: Links; + /** + * + * @type {Array} + * @memberof Integrations + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/issue.ts b/platform/src/sdk/models/shared/issue.ts index 802f59bd6..033f69b1d 100644 --- a/platform/src/sdk/models/shared/issue.ts +++ b/platform/src/sdk/models/shared/issue.ts @@ -1,117 +1,89 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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; -}; +import { mapValues } from '../../../runtime'; +import type { IssueLinks } from './issuelinks'; +import { + IssueLinksFromJSON, + IssueLinksFromJSONTyped, + IssueLinksToJSON, + IssueLinksToJSONTyped, +} from './issuelinks'; /** * Details of a problem encountered during a data read. + * @export + * @interface Issue */ -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; -}; +export interface Issue { + /** + * The type of issue. + * @type {string} + * @memberof Issue + */ + type?: string; + /** + * A message describing the issue. + * @type {string} + * @memberof Issue + */ + message?: string; + /** + * + * @type {IssueLinks} + * @memberof Issue + */ + links?: IssueLinks; +} -/** @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(), -}); +/** + * Check if a given object implements the Issue interface. + */ +export function instanceOfIssue(value: object): value is Issue { + return true; +} -export function issueLinksToJSON(issueLinks: IssueLinks): string { - return JSON.stringify(IssueLinks$outboundSchema.parse(issueLinks)); +export function IssueFromJSON(json: any): Issue { + return IssueFromJSONTyped(json, false); } -export function issueLinksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => IssueLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'IssueLinks' from JSON`, - ); + +export function IssueFromJSONTyped(json: any, ignoreDiscriminator: boolean): Issue { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : json['type'], + 'message': json['message'] == null ? undefined : json['message'], + 'links': json['links'] == null ? undefined : IssueLinksFromJSON(json['links']), + }; } -/** @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; -}; +export function IssueToJSON(json: any): Issue { + return IssueToJSONTyped(json, false); +} -/** @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 IssueToJSONTyped(value?: Issue | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -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`, - ); + return { + + 'type': value['type'], + 'message': value['message'], + 'links': IssueLinksToJSON(value['links']), + }; } + diff --git a/platform/src/sdk/models/shared/issuelinks.ts b/platform/src/sdk/models/shared/issuelinks.ts new file mode 100644 index 000000000..16fc026ed --- /dev/null +++ b/platform/src/sdk/models/shared/issuelinks.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface IssueLinks + */ +export interface IssueLinks { + /** + * A link to the validation logs, providing details on any errors or warnings encountered. + * @type {string} + * @memberof IssueLinks + */ + logs?: string; + /** + * A link to the company's past data read history in the Codat portal. + * @type {string} + * @memberof IssueLinks + */ + portal?: string; + /** + * A link to Codat's documentation with additional information on how to troubleshoot this issue. + * @type {string} + * @memberof IssueLinks + */ + readMore?: string; +} + +/** + * Check if a given object implements the IssueLinks interface. + */ +export function instanceOfIssueLinks(value: object): value is IssueLinks { + return true; +} + +export function IssueLinksFromJSON(json: any): IssueLinks { + return IssueLinksFromJSONTyped(json, false); +} + +export function IssueLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): IssueLinks { + if (json == null) { + return json; + } + return { + + 'logs': json['logs'] == null ? undefined : json['logs'], + 'portal': json['portal'] == null ? undefined : json['portal'], + 'readMore': json['readMore'] == null ? undefined : json['readMore'], + }; +} + +export function IssueLinksToJSON(json: any): IssueLinks { + return IssueLinksToJSONTyped(json, false); +} + +export function IssueLinksToJSONTyped(value?: IssueLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'logs': value['logs'], + 'portal': value['portal'], + 'readMore': value['readMore'], + }; +} + diff --git a/platform/src/sdk/models/shared/links.ts b/platform/src/sdk/models/shared/links.ts index 751d7d00e..9678d2975 100644 --- a/platform/src/sdk/models/shared/links.ts +++ b/platform/src/sdk/models/shared/links.ts @@ -1,35 +1,558 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { HalRef, HalRef$inboundSchema } from "./halref.js"; - -export type Links = { - self: HalRef; - current: HalRef; - next?: HalRef | undefined; - previous?: HalRef | undefined; -}; - -/** @internal */ -export const Links$inboundSchema: z.ZodType = z - .object({ - self: HalRef$inboundSchema, - current: HalRef$inboundSchema, - next: HalRef$inboundSchema.optional(), - previous: HalRef$inboundSchema.optional(), - }); - -export function linksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Links$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Links' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { HalRef } from './halref'; +import { + HalRefFromJSON, + HalRefFromJSONTyped, + HalRefToJSON, + HalRefToJSONTyped, +} from './halref'; + +/** + * + * @export + * @interface Links + */ +export interface Links { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +/** + * Check if a given object implements the Links interface. + */ +export function instanceOfLinks(value: object): value is Links { + if (!('self' in value) || value['self'] === undefined) return false; + if (!('current' in value) || value['current'] === undefined) return false; + return true; +} + +export function LinksFromJSON(json: any): Links { + return LinksFromJSONTyped(json, false); +} + +export function LinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Links { + if (json == null) { + return json; + } + return { + + 'self': HalRefFromJSON(json['self']), + 'current': HalRefFromJSON(json['current']), + 'next': json['next'] == null ? undefined : HalRefFromJSON(json['next']), + 'previous': json['previous'] == null ? undefined : HalRefFromJSON(json['previous']), + }; +} + +export function LinksToJSON(json: any): Links { + return LinksToJSONTyped(json, false); +} + +export function LinksToJSONTyped(value?: Links | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'self': HalRefToJSON(value['self']), + 'current': HalRefToJSON(value['current']), + 'next': HalRefToJSON(value['next']), + 'previous': HalRefToJSON(value['previous']), + }; +} + + +export interface CompaniesLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompaniesListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompanyPushHistoryGetResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface GetCompanyPushHistoryResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface IntegrationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface IntegrationsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCompaniesResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListConnectionsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListIntegrationsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListPullOperationsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PaginationInformationLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PagingInfoLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PushOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; } diff --git a/platform/src/sdk/models/shared/modifieddate.ts b/platform/src/sdk/models/shared/modifieddate.ts new file mode 100644 index 000000000..eb143fff1 --- /dev/null +++ b/platform/src/sdk/models/shared/modifieddate.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ModifiedDate + */ +export interface ModifiedDate { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof ModifiedDate + */ + modifiedDate?: string; +} + +/** + * Check if a given object implements the ModifiedDate interface. + */ +export function instanceOfModifiedDate(value: object): value is ModifiedDate { + return true; +} + +export function ModifiedDateFromJSON(json: any): ModifiedDate { + return ModifiedDateFromJSONTyped(json, false); +} + +export function ModifiedDateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModifiedDate { + if (json == null) { + return json; + } + return { + + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + }; +} + +export function ModifiedDateToJSON(json: any): ModifiedDate { + return ModifiedDateToJSONTyped(json, false); +} + +export function ModifiedDateToJSONTyped(value?: ModifiedDate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'modifiedDate': value['modifiedDate'], + }; +} + + +export interface CustomDataTypeRecordsModifiedDate { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof ModifiedDate + */ + modifiedDate?: string; +} diff --git a/platform/src/sdk/models/shared/profile.ts b/platform/src/sdk/models/shared/profile.ts index 661ad0167..097a35683 100644 --- a/platform/src/sdk/models/shared/profile.ts +++ b/platform/src/sdk/models/shared/profile.ts @@ -1,96 +1,446 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; /** * Describes your Codat client instance + * @export + * @interface Profile */ -export type Profile = { - /** - * The name given to the instance. - */ - name: string; - /** - * Static url to your organization's logo. - */ - logoUrl?: string | undefined; - /** - * Static url to your organization's icon. - */ - iconUrl?: string | undefined; - /** - * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. - */ - redirectUrl: string; - /** - * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. - */ - whiteListUrls?: Array | undefined; - /** - * The API key for this Codat instance. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - apiKey?: string | undefined; - /** - * `True` if the company name has been confirmed. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - confirmCompanyName?: boolean | undefined; -}; +export interface Profile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} + +/** + * Check if a given object implements the Profile interface. + */ +export function instanceOfProfile(value: object): value is Profile { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirectUrl' in value) || value['redirectUrl'] === undefined) return false; + return true; +} + +export function ProfileFromJSON(json: any): Profile { + return ProfileFromJSONTyped(json, false); +} + +export function ProfileFromJSONTyped(json: any, ignoreDiscriminator: boolean): Profile { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'logoUrl': json['logoUrl'] == null ? undefined : json['logoUrl'], + 'iconUrl': json['iconUrl'] == null ? undefined : json['iconUrl'], + 'redirectUrl': json['redirectUrl'], + 'whiteListUrls': json['whiteListUrls'] == null ? undefined : json['whiteListUrls'], + 'apiKey': json['apiKey'] == null ? undefined : json['apiKey'], + 'confirmCompanyName': json['confirmCompanyName'] == null ? undefined : json['confirmCompanyName'], + }; +} + +export function ProfileToJSON(json: any): Profile { + return ProfileToJSONTyped(json, false); +} -/** @internal */ -export const Profile$inboundSchema: z.ZodType = - z.object({ - name: z.string(), - logoUrl: z.string().optional(), - iconUrl: z.string().optional(), - redirectUrl: z.string(), - whiteListUrls: z.array(z.string()).optional(), - apiKey: z.string().optional(), - confirmCompanyName: z.boolean().optional(), - }); -/** @internal */ -export type Profile$Outbound = { - name: string; - logoUrl?: string | undefined; - iconUrl?: string | undefined; - redirectUrl: string; - whiteListUrls?: Array | undefined; - apiKey?: string | undefined; - confirmCompanyName?: boolean | undefined; -}; +export function ProfileToJSONTyped(value?: Profile | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const Profile$outboundSchema: z.ZodType< - Profile$Outbound, - z.ZodTypeDef, - Profile -> = z.object({ - name: z.string(), - logoUrl: z.string().optional(), - iconUrl: z.string().optional(), - redirectUrl: z.string(), - whiteListUrls: z.array(z.string()).optional(), - apiKey: z.string().optional(), - confirmCompanyName: z.boolean().optional(), -}); + return { + + 'name': value['name'], + 'logoUrl': value['logoUrl'], + 'iconUrl': value['iconUrl'], + 'redirectUrl': value['redirectUrl'], + 'whiteListUrls': value['whiteListUrls'], + 'apiKey': value['apiKey'], + 'confirmCompanyName': value['confirmCompanyName'], + }; +} + + +export interface GetProfileResponseProfile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} -export function profileToJSON(profile: Profile): string { - return JSON.stringify(Profile$outboundSchema.parse(profile)); +export interface ProfileGetResponseProfile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; } -export function profileFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Profile$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Profile' from JSON`, - ); + +export interface ProfileUpdateRequestBody { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} + +export interface ProfileUpdateResponseProfile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} + +export interface UpdateProfileProfile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} + +export interface UpdateProfileRequestBody { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; +} + +export interface UpdateProfileResponseProfile { + /** + * The name given to the instance. + * @type {string} + * @memberof Profile + */ + name: string; + /** + * Static url to your organization's logo. + * @type {string} + * @memberof Profile + */ + logoUrl?: string; + /** + * Static url to your organization's icon. + * @type {string} + * @memberof Profile + */ + iconUrl?: string; + /** + * The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. + * @type {string} + * @memberof Profile + */ + redirectUrl: string; + /** + * A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. + * @type {Array} + * @memberof Profile + */ + whiteListUrls?: Array; + /** + * The API key for this Codat instance. + * @type {string} + * @memberof Profile + * @deprecated + */ + apiKey?: string; + /** + * `True` if the company name has been confirmed. + * @type {boolean} + * @memberof Profile + * @deprecated + */ + confirmCompanyName?: boolean; } diff --git a/platform/src/sdk/models/shared/pulloperation.ts b/platform/src/sdk/models/shared/pulloperation.ts index 393750368..556b52d3c 100644 --- a/platform/src/sdk/models/shared/pulloperation.ts +++ b/platform/src/sdk/models/shared/pulloperation.ts @@ -1,168 +1,1229 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import type { DatasetStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; /** - * The current status of the dataset. + * Information about a queued, in progress or completed pull operation. + * *Formally called `dataset`* + * @export + * @interface PullOperation */ -export const DatasetStatus = { - Initial: "Initial", - Queued: "Queued", - Fetching: "Fetching", - MapQueued: "MapQueued", - Mapping: "Mapping", - Complete: "Complete", - FetchError: "FetchError", - MapError: "MapError", - InternalError: "InternalError", - ProcessingQueued: "ProcessingQueued", - Processing: "Processing", - ProcessingError: "ProcessingError", - ValidationQueued: "ValidationQueued", - Validating: "Validating", - ValidationError: "ValidationError", - AuthError: "AuthError", - Cancelled: "Cancelled", - NotSupported: "NotSupported", - RateLimitError: "RateLimitError", - PermissionsError: "PermissionsError", - PrerequisiteNotMet: "PrerequisiteNotMet", -} as const; +export interface PullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + + /** - * The current status of the dataset. + * @export */ -export type DatasetStatus = ClosedEnum; +export const PullOperationStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type PullOperationStatusEnum = typeof PullOperationStatusEnum[keyof typeof PullOperationStatusEnum]; + /** - * Information about a queued, in progress or completed pull operation. - * - * @remarks - * *Formally called `dataset`* + * Check if a given object implements the PullOperation interface. */ -export type PullOperation = { - /** - * Unique identifier of the pull operation. - */ - id: string; - /** - * Unique identifier of the company associated to this pull operation. - */ - companyId: string; - /** - * Unique identifier of the connection associated to this pull operation. - */ - connectionId: string; - /** - * The data type you are requesting in a pull operation. - */ - dataType: string; - /** - * The current status of the dataset. - */ - status: DatasetStatus; - /** - * Additional information about the dataset status. - */ - statusDescription?: string | null | undefined; - /** - * A message about a transient or persistent error returned by Codat or the source platform. - */ - errorMessage?: string | null | 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. - */ - requested: 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. - */ - completed?: string | undefined; - /** - * An integer signifying the progress of the pull operation. - */ - progress: number; - /** - * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. - */ - isCompleted: boolean; - /** - * `True` if the pull operation entered an error state. - */ - isErrored: boolean; -}; - -/** @internal */ -export const DatasetStatus$inboundSchema: z.ZodNativeEnum< - typeof DatasetStatus -> = z.nativeEnum(DatasetStatus); - -/** @internal */ -export const PullOperation$inboundSchema: z.ZodType< - PullOperation, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - companyId: z.string(), - connectionId: z.string(), - dataType: z.string(), - status: DatasetStatus$inboundSchema, - statusDescription: z.nullable(z.string()).optional(), - errorMessage: z.nullable(z.string()).optional(), - requested: z.string(), - completed: z.string().optional(), - progress: z.number().int(), - isCompleted: z.boolean(), - isErrored: z.boolean(), -}); - -export function pullOperationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PullOperation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PullOperation' from JSON`, - ); +export function instanceOfPullOperation(value: object): value is PullOperation { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('connectionId' in value) || value['connectionId'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('requested' in value) || value['requested'] === undefined) return false; + if (!('progress' in value) || value['progress'] === undefined) return false; + if (!('isCompleted' in value) || value['isCompleted'] === undefined) return false; + if (!('isErrored' in value) || value['isErrored'] === undefined) return false; + return true; +} + +export function PullOperationFromJSON(json: any): PullOperation { + return PullOperationFromJSONTyped(json, false); +} + +export function PullOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperation { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'companyId': json['companyId'], + 'connectionId': json['connectionId'], + 'dataType': json['dataType'], + 'status': json['status'], + 'statusDescription': json['statusDescription'] == null ? undefined : json['statusDescription'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'requested': json['requested'], + 'completed': json['completed'] == null ? undefined : json['completed'], + 'progress': json['progress'], + 'isCompleted': json['isCompleted'], + 'isErrored': json['isErrored'], + }; +} + +export function PullOperationToJSON(json: any): PullOperation { + return PullOperationToJSONTyped(json, false); +} + +export function PullOperationToJSONTyped(value?: PullOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'dataType': value['dataType'], + 'status': value['status'], + 'statusDescription': value['statusDescription'], + 'errorMessage': value['errorMessage'], + 'requested': value['requested'], + 'completed': value['completed'], + 'progress': value['progress'], + 'isCompleted': value['isCompleted'], + 'isErrored': value['isErrored'], + }; +} + + +export interface CustomDataTypeRefreshResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface DataTypeRefreshResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface GetPullOperationResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface ListPullOperationsResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationGetResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationsListResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationsPullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface RefreshCustomDataTypeResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface RefreshDataTypeResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * 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. + * @type {string} + * @memberof PullOperation + */ + requested: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; } diff --git a/platform/src/sdk/models/shared/pulloperations.ts b/platform/src/sdk/models/shared/pulloperations.ts index 475158a00..addea4cb0 100644 --- a/platform/src/sdk/models/shared/pulloperations.ts +++ b/platform/src/sdk/models/shared/pulloperations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { PullOperation, PullOperation$inboundSchema } from "./pulloperation.js"; - -export type PullOperations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const PullOperations$inboundSchema: z.ZodType< - PullOperations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(PullOperation$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function pullOperationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PullOperations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PullOperations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { PullOperation } from './pulloperation'; +import { + PullOperationFromJSON, + PullOperationFromJSONTyped, + PullOperationToJSON, + PullOperationToJSONTyped, +} from './pulloperation'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface PullOperations + */ +export interface PullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PullOperations interface. + */ +export function instanceOfPullOperations(value: object): value is PullOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PullOperationsFromJSON(json: any): PullOperations { + return PullOperationsFromJSONTyped(json, false); +} + +export function PullOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PullOperationFromJSON)), + }; +} + +export function PullOperationsToJSON(json: any): PullOperations { + return PullOperationsToJSONTyped(json, false); +} + +export function PullOperationsToJSONTyped(value?: PullOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PullOperationToJSON)), + }; +} + + +export interface ListPullOperationsResponsePullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +export interface PullOperationsListResponsePullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/pushchangetype.ts b/platform/src/sdk/models/shared/pushchangetype.ts index 42040ea23..11044ffda 100644 --- a/platform/src/sdk/models/shared/pushchangetype.ts +++ b/platform/src/sdk/models/shared/pushchangetype.ts @@ -1,26 +1,56 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of change being applied to record in third party platform. + * @export */ export const PushChangeType = { - Unknown: "Unknown", - Created: "Created", - Modified: "Modified", - Deleted: "Deleted", - AttachmentUploaded: "AttachmentUploaded", + Unknown: 'Unknown', + Created: 'Created', + Modified: 'Modified', + Deleted: 'Deleted', + AttachmentUploaded: 'AttachmentUploaded' } as const; -/** - * Type of change being applied to record in third party platform. - */ -export type PushChangeType = ClosedEnum; +export type PushChangeType = typeof PushChangeType[keyof typeof PushChangeType]; + + +export function instanceOfPushChangeType(value: any): boolean { + for (const key in PushChangeType) { + if (Object.prototype.hasOwnProperty.call(PushChangeType, key)) { + if (PushChangeType[key as keyof typeof PushChangeType] === value) { + return true; + } + } + } + return false; +} + +export function PushChangeTypeFromJSON(json: any): PushChangeType { + return PushChangeTypeFromJSONTyped(json, false); +} + +export function PushChangeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushChangeType { + return json as PushChangeType; +} + +export function PushChangeTypeToJSON(value?: PushChangeType | null): any { + return value as any; +} + +export function PushChangeTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushChangeType { + return value as PushChangeType; +} -/** @internal */ -export const PushChangeType$inboundSchema: z.ZodNativeEnum< - typeof PushChangeType -> = z.nativeEnum(PushChangeType); diff --git a/platform/src/sdk/models/shared/pushfieldvalidation.ts b/platform/src/sdk/models/shared/pushfieldvalidation.ts index 15fc3a0f5..ae52170f6 100644 --- a/platform/src/sdk/models/shared/pushfieldvalidation.ts +++ b/platform/src/sdk/models/shared/pushfieldvalidation.ts @@ -1,44 +1,107 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 PushFieldValidation = { - /** - * Field name that resulted in the validation issue. - */ - field?: string | undefined; - /** - * Details on the validation issue. - */ - details: string; - /** - * Unique reference identifier for the validation issue. - */ - ref?: string | null | undefined; -}; - -/** @internal */ -export const PushFieldValidation$inboundSchema: z.ZodType< - PushFieldValidation, - z.ZodTypeDef, - unknown -> = z.object({ - field: z.string().optional(), - details: z.string(), - ref: z.nullable(z.string()).optional(), -}); - -export function pushFieldValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushFieldValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushFieldValidation' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PushFieldValidation + */ +export interface PushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; +} + +/** + * Check if a given object implements the PushFieldValidation interface. + */ +export function instanceOfPushFieldValidation(value: object): value is PushFieldValidation { + if (!('details' in value) || value['details'] === undefined) return false; + return true; +} + +export function PushFieldValidationFromJSON(json: any): PushFieldValidation { + return PushFieldValidationFromJSONTyped(json, false); +} + +export function PushFieldValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushFieldValidation { + if (json == null) { + return json; + } + return { + + ...json, + 'field': json['field'] == null ? undefined : json['field'], + 'details': json['details'], + 'ref': json['ref'] == null ? undefined : json['ref'], + }; +} + +export function PushFieldValidationToJSON(json: any): PushFieldValidation { + return PushFieldValidationToJSONTyped(json, false); +} + +export function PushFieldValidationToJSONTyped(value?: PushFieldValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'field': value['field'], + 'details': value['details'], + 'ref': value['ref'], + }; +} + + +export interface PushOptionPushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; } diff --git a/platform/src/sdk/models/shared/pushoperation.ts b/platform/src/sdk/models/shared/pushoperation.ts index 470b4a2d4..950d8234e 100644 --- a/platform/src/sdk/models/shared/pushoperation.ts +++ b/platform/src/sdk/models/shared/pushoperation.ts @@ -1,142 +1,870 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 } from "./datatype.js"; +import type { DataType } from '../DataType'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; - -export type PushOperation = { - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: 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. - */ - requestedOnUtc: 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. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; - -/** @internal */ -export const PushOperation$inboundSchema: z.ZodType< - PushOperation, - z.ZodTypeDef, - unknown -> = z.object({ - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: DataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); - -export function pushOperationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperation' from JSON`, - ); + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { PushOperationChange } from './pushoperationchange'; +import { + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; + +/** + * + * @export + * @interface PushOperation + */ +export interface PushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: DataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + + +/** + * @export + */ +export const PushOperationDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationDataTypeEnum = typeof PushOperationDataTypeEnum[keyof typeof PushOperationDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperation interface. + */ +export function instanceOfPushOperation(value: object): value is PushOperation { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function PushOperationFromJSON(json: any): PushOperation { + return PushOperationFromJSONTyped(json, false); +} + +export function PushOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperation { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + }; +} + +export function PushOperationToJSON(json: any): PushOperation { + return PushOperationToJSONTyped(json, false); +} + +export function PushOperationToJSONTyped(value?: PushOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + }; +} + + +export interface CompanyPushHistoryGetResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface GetCompanyPushHistoryResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface GetPushOperationResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationGetResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationsPushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PushOperationDataTypeEnum; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: 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: + * + * ``` + * 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. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; } diff --git a/platform/src/sdk/models/shared/pushoperationchange.ts b/platform/src/sdk/models/shared/pushoperationchange.ts index 5d771700a..657c9bd3c 100644 --- a/platform/src/sdk/models/shared/pushoperationchange.ts +++ b/platform/src/sdk/models/shared/pushoperationchange.ts @@ -1,49 +1,161 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { PushChangeType } from './pushchangetype'; import { - PushChangeType, - PushChangeType$inboundSchema, -} from "./pushchangetype.js"; + PushChangeTypeFromJSON, + PushChangeTypeFromJSONTyped, + PushChangeTypeToJSON, + PushChangeTypeToJSONTyped, +} from './pushchangetype'; +import type { PushOperationRef } from './pushoperationref'; import { - PushOperationRef, - PushOperationRef$inboundSchema, -} from "./pushoperationref.js"; - -export type PushOperationChange = { - /** - * Type of change being applied to record in third party platform. - */ - type?: PushChangeType | undefined; - recordRef?: PushOperationRef | undefined; - /** - * Unique identifier for the attachment created otherwise null. - */ - attachmentId?: string | null | undefined; -}; - -/** @internal */ -export const PushOperationChange$inboundSchema: z.ZodType< - PushOperationChange, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushChangeType$inboundSchema.optional(), - recordRef: PushOperationRef$inboundSchema.optional(), - attachmentId: z.nullable(z.string()).optional(), -}); - -export function pushOperationChangeFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationChange$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationChange' from JSON`, - ); + PushOperationRefFromJSON, + PushOperationRefFromJSONTyped, + PushOperationRefToJSON, + PushOperationRefToJSONTyped, +} from './pushoperationref'; + +/** + * + * @export + * @interface PushOperationChange + */ +export interface PushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + + + +/** + * Check if a given object implements the PushOperationChange interface. + */ +export function instanceOfPushOperationChange(value: object): value is PushOperationChange { + return true; +} + +export function PushOperationChangeFromJSON(json: any): PushOperationChange { + return PushOperationChangeFromJSONTyped(json, false); +} + +export function PushOperationChangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationChange { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : PushChangeTypeFromJSON(json['type']), + 'recordRef': json['recordRef'] == null ? undefined : PushOperationRefFromJSON(json['recordRef']), + 'attachmentId': json['attachmentId'] == null ? undefined : json['attachmentId'], + }; +} + +export function PushOperationChangeToJSON(json: any): PushOperationChange { + return PushOperationChangeToJSONTyped(json, false); +} + +export function PushOperationChangeToJSONTyped(value?: PushOperationChange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushChangeTypeToJSON(value['type']), + 'recordRef': PushOperationRefToJSON(value['recordRef']), + 'attachmentId': value['attachmentId'], + }; +} + + +export interface GetPushOperationResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface PushOperationGetResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface PushOperationPushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; } diff --git a/platform/src/sdk/models/shared/pushoperationref.ts b/platform/src/sdk/models/shared/pushoperationref.ts index 9f851e4ba..616adefb7 100644 --- a/platform/src/sdk/models/shared/pushoperationref.ts +++ b/platform/src/sdk/models/shared/pushoperationref.ts @@ -1,40 +1,146 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 } from "./datatype.js"; - -export type PushOperationRef = { - /** - * Unique identifier for a push operation. - */ - id?: string | undefined; - /** - * Available data types - */ - dataType?: DataType | undefined; -}; - -/** @internal */ -export const PushOperationRef$inboundSchema: z.ZodType< - PushOperationRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - dataType: DataType$inboundSchema.optional(), -}); - -export function pushOperationRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationRef' from JSON`, - ); +import type { DataType } from '../DataType'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PushOperationRef + */ +export interface PushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: DataType; +} + + +/** + * @export + */ +export const PushOperationRefDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationRefDataTypeEnum = typeof PushOperationRefDataTypeEnum[keyof typeof PushOperationRefDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperationRef interface. + */ +export function instanceOfPushOperationRef(value: object): value is PushOperationRef { + return true; +} + +export function PushOperationRefFromJSON(json: any): PushOperationRef { + return PushOperationRefFromJSONTyped(json, false); +} + +export function PushOperationRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationRef { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + }; +} + +export function PushOperationRefToJSON(json: any): PushOperationRef { + return PushOperationRefToJSONTyped(json, false); +} + +export function PushOperationRefToJSONTyped(value?: PushOperationRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'dataType': value['dataType'], + }; +} + + +export interface PushOperationPushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PushOperationRefDataTypeEnum; } diff --git a/platform/src/sdk/models/shared/pushoperations.ts b/platform/src/sdk/models/shared/pushoperations.ts index 35c08c726..c3c6d9e0b 100644 --- a/platform/src/sdk/models/shared/pushoperations.ts +++ b/platform/src/sdk/models/shared/pushoperations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { PushOperation, PushOperation$inboundSchema } from "./pushoperation.js"; - -export type PushOperations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const PushOperations$inboundSchema: z.ZodType< - PushOperations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(PushOperation$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function pushOperationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; +import type { PushOperation } from './pushoperation'; +import { + PushOperationFromJSON, + PushOperationFromJSONTyped, + PushOperationToJSON, + PushOperationToJSONTyped, +} from './pushoperation'; + +/** + * + * @export + * @interface PushOperations + */ +export interface PushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PushOperations interface. + */ +export function instanceOfPushOperations(value: object): value is PushOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PushOperationsFromJSON(json: any): PushOperations { + return PushOperationsFromJSONTyped(json, false); +} + +export function PushOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PushOperationFromJSON)), + }; +} + +export function PushOperationsToJSON(json: any): PushOperations { + return PushOperationsToJSONTyped(json, false); +} + +export function PushOperationsToJSONTyped(value?: PushOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PushOperationToJSON)), + }; +} + + +export interface CompanyPushHistoryGetResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +export interface GetCompanyPushHistoryResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/pushoperationstatus.ts b/platform/src/sdk/models/shared/pushoperationstatus.ts index 133e3b65f..e2ab10b7d 100644 --- a/platform/src/sdk/models/shared/pushoperationstatus.ts +++ b/platform/src/sdk/models/shared/pushoperationstatus.ts @@ -1,25 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the push operation. + * @export */ export const PushOperationStatus = { - Pending: "Pending", - Failed: "Failed", - Success: "Success", - TimedOut: "TimedOut", + Pending: 'Pending', + Failed: 'Failed', + Success: 'Success', + TimedOut: 'TimedOut' } as const; -/** - * The current status of the push operation. - */ -export type PushOperationStatus = ClosedEnum; +export type PushOperationStatus = typeof PushOperationStatus[keyof typeof PushOperationStatus]; + + +export function instanceOfPushOperationStatus(value: any): boolean { + for (const key in PushOperationStatus) { + if (Object.prototype.hasOwnProperty.call(PushOperationStatus, key)) { + if (PushOperationStatus[key as keyof typeof PushOperationStatus] === value) { + return true; + } + } + } + return false; +} + +export function PushOperationStatusFromJSON(json: any): PushOperationStatus { + return PushOperationStatusFromJSONTyped(json, false); +} + +export function PushOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationStatus { + return json as PushOperationStatus; +} + +export function PushOperationStatusToJSON(value?: PushOperationStatus | null): any { + return value as any; +} + +export function PushOperationStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOperationStatus { + return value as PushOperationStatus; +} -/** @internal */ -export const PushOperationStatus$inboundSchema: z.ZodNativeEnum< - typeof PushOperationStatus -> = z.nativeEnum(PushOperationStatus); diff --git a/platform/src/sdk/models/shared/pushoption.ts b/platform/src/sdk/models/shared/pushoption.ts index af6a0a0a3..db76cbd6f 100644 --- a/platform/src/sdk/models/shared/pushoption.ts +++ b/platform/src/sdk/models/shared/pushoption.ts @@ -1,71 +1,237 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionProperty, - PushOptionProperty$inboundSchema, -} from "./pushoptionproperty.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; +import type { PushOptionProperty } from './pushoptionproperty'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushOptionPropertyFromJSON, + PushOptionPropertyFromJSONTyped, + PushOptionPropertyToJSON, + PushOptionPropertyToJSONTyped, +} from './pushoptionproperty'; -export type PushOption = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOption + */ +export interface PushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOption interface. + */ +export function instanceOfPushOption(value: object): value is PushOption { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} + +export function PushOptionFromJSON(json: any): PushOption { + return PushOptionFromJSONTyped(json, false); +} -/** @internal */ -export const PushOption$inboundSchema: z.ZodType< - PushOption, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string().optional(), - required: z.boolean(), - properties: z.nullable(z.record(PushOptionProperty$inboundSchema)).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOption { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} + +export function PushOptionToJSON(json: any): PushOption { + return PushOptionToJSONTyped(json, false); +} + +export function PushOptionToJSONTyped(value?: PushOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + + +export interface CreateUpdateModelOptionsByDataTypeGetResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} -export function pushOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOption' from JSON`, - ); +export interface GetCreateUpdateModelOptionsByDataTypeResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; } diff --git a/platform/src/sdk/models/shared/pushoptionchoice.ts b/platform/src/sdk/models/shared/pushoptionchoice.ts index 315b39f91..083d36724 100644 --- a/platform/src/sdk/models/shared/pushoptionchoice.ts +++ b/platform/src/sdk/models/shared/pushoptionchoice.ts @@ -1,58 +1,206 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; - -export type PushOptionChoice = { - /** - * Allowed value for field. - */ - value?: string | undefined; - /** - * The option type. - */ - type?: PushOptionType | undefined; - /** - * The property's display name. - */ - displayName?: string | undefined; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required?: boolean | undefined; -}; - -/** @internal */ -export const PushOptionChoice$inboundSchema: z.ZodType< - PushOptionChoice, - z.ZodTypeDef, - unknown -> = z.object({ - value: z.string().optional(), - type: PushOptionType$inboundSchema.optional(), - displayName: z.string().optional(), - description: z.string().optional(), - required: z.boolean().optional(), -}); - -export function pushOptionChoiceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionChoice$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionChoice' from JSON`, - ); + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; + +/** + * + * @export + * @interface PushOptionChoice + */ +export interface PushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + + + +/** + * Check if a given object implements the PushOptionChoice interface. + */ +export function instanceOfPushOptionChoice(value: object): value is PushOptionChoice { + return true; +} + +export function PushOptionChoiceFromJSON(json: any): PushOptionChoice { + return PushOptionChoiceFromJSONTyped(json, false); +} + +export function PushOptionChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionChoice { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : json['value'], + 'type': json['type'] == null ? undefined : PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'] == null ? undefined : json['required'], + }; +} + +export function PushOptionChoiceToJSON(json: any): PushOptionChoice { + return PushOptionChoiceToJSONTyped(json, false); +} + +export function PushOptionChoiceToJSONTyped(value?: PushOptionChoice | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'], + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + }; +} + + +export interface CreateUpdateModelOptionsByDataTypeGetResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface GetCreateUpdateModelOptionsByDataTypeResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface PushOptionPushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; } diff --git a/platform/src/sdk/models/shared/pushoptionproperty.ts b/platform/src/sdk/models/shared/pushoptionproperty.ts index 0100bc7b6..79e146e90 100644 --- a/platform/src/sdk/models/shared/pushoptionproperty.ts +++ b/platform/src/sdk/models/shared/pushoptionproperty.ts @@ -1,69 +1,141 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; -export type PushOptionProperty = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description: string; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOptionProperty + */ +export interface PushOptionProperty { + /** + * + * @type {PushOptionType} + * @memberof PushOptionProperty + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionProperty + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionProperty + */ + description: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionProperty + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOptionProperty + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOptionProperty + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOptionProperty + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOptionProperty interface. + */ +export function instanceOfPushOptionProperty(value: object): value is PushOptionProperty { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} -/** @internal */ -export const PushOptionProperty$inboundSchema: z.ZodType< - PushOptionProperty, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string(), - required: z.boolean(), - properties: z.nullable( - z.record(z.lazy(() => PushOptionProperty$inboundSchema)), - ).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionPropertyFromJSON(json: any): PushOptionProperty { + return PushOptionPropertyFromJSONTyped(json, false); +} + +export function PushOptionPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionProperty { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} -export function pushOptionPropertyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionProperty$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionProperty' from JSON`, - ); +export function PushOptionPropertyToJSON(json: any): PushOptionProperty { + return PushOptionPropertyToJSONTyped(json, false); } + +export function PushOptionPropertyToJSONTyped(value?: PushOptionProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + diff --git a/platform/src/sdk/models/shared/pushoptiontype.ts b/platform/src/sdk/models/shared/pushoptiontype.ts index 298c02e2e..06a02cfd2 100644 --- a/platform/src/sdk/models/shared/pushoptiontype.ts +++ b/platform/src/sdk/models/shared/pushoptiontype.ts @@ -1,29 +1,59 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The option type. + * @export */ export const PushOptionType = { - Array: "Array", - Object: "Object", - String: "String", - Number: "Number", - Boolean: "Boolean", - DateTime: "DateTime", - File: "File", - MultiPart: "MultiPart", + Array: 'Array', + Object: 'Object', + String: 'String', + Number: 'Number', + Boolean: 'Boolean', + DateTime: 'DateTime', + File: 'File', + MultiPart: 'MultiPart' } as const; -/** - * The option type. - */ -export type PushOptionType = ClosedEnum; +export type PushOptionType = typeof PushOptionType[keyof typeof PushOptionType]; + + +export function instanceOfPushOptionType(value: any): boolean { + for (const key in PushOptionType) { + if (Object.prototype.hasOwnProperty.call(PushOptionType, key)) { + if (PushOptionType[key as keyof typeof PushOptionType] === value) { + return true; + } + } + } + return false; +} + +export function PushOptionTypeFromJSON(json: any): PushOptionType { + return PushOptionTypeFromJSONTyped(json, false); +} + +export function PushOptionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionType { + return json as PushOptionType; +} + +export function PushOptionTypeToJSON(value?: PushOptionType | null): any { + return value as any; +} + +export function PushOptionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOptionType { + return value as PushOptionType; +} -/** @internal */ -export const PushOptionType$inboundSchema: z.ZodNativeEnum< - typeof PushOptionType -> = z.nativeEnum(PushOptionType); diff --git a/platform/src/sdk/models/shared/pushvalidationinfo.ts b/platform/src/sdk/models/shared/pushvalidationinfo.ts index 3479adce1..09443127f 100644 --- a/platform/src/sdk/models/shared/pushvalidationinfo.ts +++ b/platform/src/sdk/models/shared/pushvalidationinfo.ts @@ -1,38 +1,132 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { PushFieldValidation } from './pushfieldvalidation'; import { - PushFieldValidation, - PushFieldValidation$inboundSchema, -} from "./pushfieldvalidation.js"; - -export type PushValidationInfo = { - warnings?: Array | null | undefined; - information?: Array | null | undefined; -}; - -/** @internal */ -export const PushValidationInfo$inboundSchema: z.ZodType< - PushValidationInfo, - z.ZodTypeDef, - unknown -> = z.object({ - warnings: z.nullable(z.array(PushFieldValidation$inboundSchema)).optional(), - information: z.nullable(z.array(PushFieldValidation$inboundSchema)) - .optional(), -}); - -export function pushValidationInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushValidationInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushValidationInfo' from JSON`, - ); + PushFieldValidationFromJSON, + PushFieldValidationFromJSONTyped, + PushFieldValidationToJSON, + PushFieldValidationToJSONTyped, +} from './pushfieldvalidation'; + +/** + * + * @export + * @interface PushValidationInfo + */ +export interface PushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +/** + * Check if a given object implements the PushValidationInfo interface. + */ +export function instanceOfPushValidationInfo(value: object): value is PushValidationInfo { + return true; +} + +export function PushValidationInfoFromJSON(json: any): PushValidationInfo { + return PushValidationInfoFromJSONTyped(json, false); +} + +export function PushValidationInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushValidationInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(PushFieldValidationFromJSON)), + 'information': json['information'] == null ? undefined : ((json['information'] as Array).map(PushFieldValidationFromJSON)), + }; +} + +export function PushValidationInfoToJSON(json: any): PushValidationInfo { + return PushValidationInfoToJSONTyped(json, false); +} + +export function PushValidationInfoToJSONTyped(value?: PushValidationInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(PushFieldValidationToJSON)), + 'information': value['information'] == null ? undefined : ((value['information'] as Array).map(PushFieldValidationToJSON)), + }; +} + + +export interface CreateUpdateModelOptionsByDataTypeGetResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface GetCreateUpdateModelOptionsByDataTypeResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface PushOptionPushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; } diff --git a/platform/src/sdk/models/shared/readcompletedwebhook.ts b/platform/src/sdk/models/shared/readcompletedwebhook.ts index 027874fb9..712f722d3 100644 --- a/platform/src/sdk/models/shared/readcompletedwebhook.ts +++ b/platform/src/sdk/models/shared/readcompletedwebhook.ts @@ -1,96 +1,115 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ReadCompletedWebhookPayload } from './readcompletedwebhookpayload'; import { - ReadCompletedWebhookPayload, - ReadCompletedWebhookPayload$inboundSchema, - ReadCompletedWebhookPayload$Outbound, - ReadCompletedWebhookPayload$outboundSchema, -} from "./readcompletedwebhookpayload.js"; + ReadCompletedWebhookPayloadFromJSON, + ReadCompletedWebhookPayloadFromJSONTyped, + ReadCompletedWebhookPayloadToJSON, + ReadCompletedWebhookPayloadToJSONTyped, +} from './readcompletedwebhookpayload'; -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; -}; +/** + * + * @export + * @interface ReadCompletedWebhook + */ +export interface ReadCompletedWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ReadCompletedWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ReadCompletedWebhook + */ + eventType?: 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: + * + * ``` + * 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. + * @type {string} + * @memberof ReadCompletedWebhook + */ + generatedDate?: string; + /** + * + * @type {ReadCompletedWebhookPayload} + * @memberof ReadCompletedWebhook + */ + payload?: ReadCompletedWebhookPayload; +} + +/** + * Check if a given object implements the ReadCompletedWebhook interface. + */ +export function instanceOfReadCompletedWebhook(value: object): value is ReadCompletedWebhook { + return true; +} -/** @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; -}; +export function ReadCompletedWebhookFromJSON(json: any): ReadCompletedWebhook { + return ReadCompletedWebhookFromJSONTyped(json, false); +} -/** @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 ReadCompletedWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReadCompletedWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ReadCompletedWebhookPayloadFromJSON(json['payload']), + }; +} -export function readCompletedWebhookToJSON( - readCompletedWebhook: ReadCompletedWebhook, -): string { - return JSON.stringify( - ReadCompletedWebhook$outboundSchema.parse(readCompletedWebhook), - ); +export function ReadCompletedWebhookToJSON(json: any): ReadCompletedWebhook { + return ReadCompletedWebhookToJSONTyped(json, false); } -export function readCompletedWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReadCompletedWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReadCompletedWebhook' from JSON`, - ); + +export function ReadCompletedWebhookToJSONTyped(value?: ReadCompletedWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ReadCompletedWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts b/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts index 59408a541..dd74b8cd5 100644 --- a/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts +++ b/platform/src/sdk/models/shared/readcompletedwebhookpayload.ts @@ -1,94 +1,153 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { DataTypeReadSummary } from './datatypereadsummary'; import { - DataTypeReadSummary, - DataTypeReadSummary$inboundSchema, - DataTypeReadSummary$Outbound, - DataTypeReadSummary$outboundSchema, -} from "./datatypereadsummary.js"; + DataTypeReadSummaryFromJSON, + DataTypeReadSummaryFromJSONTyped, + DataTypeReadSummaryToJSON, + DataTypeReadSummaryToJSONTyped, +} from './datatypereadsummary'; -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; -}; +/** + * + * @export + * @interface ReadCompletedWebhookPayload + */ +export interface ReadCompletedWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ReadCompletedWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * 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. + * @type {string} + * @memberof ReadCompletedWebhookPayload + */ + modifiedFromDate?: string; + /** + * + * @type {Array} + * @memberof ReadCompletedWebhookPayload + */ + dataTypes?: Array; +} + +/** + * Check if a given object implements the ReadCompletedWebhookPayload interface. + */ +export function instanceOfReadCompletedWebhookPayload(value: object): value is ReadCompletedWebhookPayload { + return true; +} + +export function ReadCompletedWebhookPayloadFromJSON(json: any): ReadCompletedWebhookPayload { + return ReadCompletedWebhookPayloadFromJSONTyped(json, false); +} + +export function ReadCompletedWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReadCompletedWebhookPayload { + if (json == null) { + return json; + } + return { + + 'referenceCompany': json['referenceCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceCompany']), + 'modifiedFromDate': json['modifiedFromDate'] == null ? undefined : json['modifiedFromDate'], + 'dataTypes': json['dataTypes'] == null ? undefined : ((json['dataTypes'] as Array).map(DataTypeReadSummaryFromJSON)), + }; +} -/** @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; -}; +export function ReadCompletedWebhookPayloadToJSON(json: any): ReadCompletedWebhookPayload { + return ReadCompletedWebhookPayloadToJSONTyped(json, false); +} -/** @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 ReadCompletedWebhookPayloadToJSONTyped(value?: ReadCompletedWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function readCompletedWebhookPayloadToJSON( - readCompletedWebhookPayload: ReadCompletedWebhookPayload, -): string { - return JSON.stringify( - ReadCompletedWebhookPayload$outboundSchema.parse( - readCompletedWebhookPayload, - ), - ); + return { + + 'referenceCompany': CompanyReferenceToJSON(value['referenceCompany']), + 'modifiedFromDate': value['modifiedFromDate'], + 'dataTypes': value['dataTypes'] == null ? undefined : ((value['dataTypes'] as Array).map(DataTypeReadSummaryToJSON)), + }; } -export function readCompletedWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReadCompletedWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReadCompletedWebhookPayload' from JSON`, - ); + + +export interface ReadCompletedWebhookReadCompletedWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ReadCompletedWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * 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. + * @type {string} + * @memberof ReadCompletedWebhookPayload + */ + modifiedFromDate?: string; + /** + * + * @type {Array} + * @memberof ReadCompletedWebhookPayload + */ + dataTypes?: Array; } diff --git a/platform/src/sdk/models/shared/schemadatatype.ts b/platform/src/sdk/models/shared/schemadatatype.ts deleted file mode 100644 index 159529f46..000000000 --- a/platform/src/sdk/models/shared/schemadatatype.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * Available data types - */ -export const SchemaDataType = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", -} as const; -/** - * Available data types - */ -export type SchemaDataType = ClosedEnum; - -/** @internal */ -export const SchemaDataType$outboundSchema: z.ZodNativeEnum< - typeof SchemaDataType -> = z.nativeEnum(SchemaDataType); diff --git a/platform/src/sdk/models/shared/security.ts b/platform/src/sdk/models/shared/security.ts deleted file mode 100644 index 675eaa582..000000000 --- a/platform/src/sdk/models/shared/security.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type Security = { - authHeader: string; -}; - -/** @internal */ -export type Security$Outbound = { - auth_header: string; -}; - -/** @internal */ -export const Security$outboundSchema: z.ZodType< - Security$Outbound, - z.ZodTypeDef, - Security -> = z.object({ - authHeader: z.string(), -}).transform((v) => { - return remap$(v, { - authHeader: "auth_header", - }); -}); - -export function securityToJSON(security: Security): string { - return JSON.stringify(Security$outboundSchema.parse(security)); -} diff --git a/platform/src/sdk/models/shared/sourcetype.ts b/platform/src/sdk/models/shared/sourcetype.ts index 4ff7925e4..c43a0b79f 100644 --- a/platform/src/sdk/models/shared/sourcetype.ts +++ b/platform/src/sdk/models/shared/sourcetype.ts @@ -1,30 +1,58 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The type of platform of the connection. + * @export */ export const SourceType = { - Accounting: "Accounting", - Banking: "Banking", - BankFeed: "BankFeed", - Commerce: "Commerce", - Expense: "Expense", - Other: "Other", - Unknown: "Unknown", + Accounting: 'Accounting', + Banking: 'Banking', + BankFeed: 'BankFeed', + Commerce: 'Commerce', + Expense: 'Expense', + Other: 'Other', + Unknown: 'Unknown' } as const; -/** - * The type of platform of the connection. - */ -export type SourceType = ClosedEnum; - -/** @internal */ -export const SourceType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(SourceType); -/** @internal */ -export const SourceType$outboundSchema: z.ZodNativeEnum = - SourceType$inboundSchema; +export type SourceType = typeof SourceType[keyof typeof SourceType]; + + +export function instanceOfSourceType(value: any): boolean { + for (const key in SourceType) { + if (Object.prototype.hasOwnProperty.call(SourceType, key)) { + if (SourceType[key as keyof typeof SourceType] === value) { + return true; + } + } + } + return false; +} + +export function SourceTypeFromJSON(json: any): SourceType { + return SourceTypeFromJSONTyped(json, false); +} + +export function SourceTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceType { + return json as SourceType; +} + +export function SourceTypeToJSON(value?: SourceType | null): any { + return value as any; +} + +export function SourceTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SourceType { + return value as SourceType; +} + diff --git a/platform/src/sdk/models/shared/status.ts b/platform/src/sdk/models/shared/status.ts index 17744c574..55797e722 100644 --- a/platform/src/sdk/models/shared/status.ts +++ b/platform/src/sdk/models/shared/status.ts @@ -1,44 +1,72 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the dataset. + * @export */ export const Status = { - Initial: "Initial", - Queued: "Queued", - Fetching: "Fetching", - MapQueued: "MapQueued", - Mapping: "Mapping", - Complete: "Complete", - FetchError: "FetchError", - MapError: "MapError", - InternalError: "InternalError", - ProcessingQueued: "ProcessingQueued", - Processing: "Processing", - ProcessingError: "ProcessingError", - ValidationQueued: "ValidationQueued", - Validating: "Validating", - ValidationError: "ValidationError", - AuthError: "AuthError", - Cancelled: "Cancelled", - NotSupported: "NotSupported", - RateLimitError: "RateLimitError", - PermissionsError: "PermissionsError", - PrerequisiteNotMet: "PrerequisiteNotMet", + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' } as const; -/** - * The current status of the dataset. - */ -export type Status = ClosedEnum; - -/** @internal */ -export const Status$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Status); -/** @internal */ -export const Status$outboundSchema: z.ZodNativeEnum = - Status$inboundSchema; +export type Status = typeof Status[keyof typeof Status]; + + +export function instanceOfStatus(value: any): boolean { + for (const key in Status) { + if (Object.prototype.hasOwnProperty.call(Status, key)) { + if (Status[key as keyof typeof Status] === value) { + return true; + } + } + } + return false; +} + +export function StatusFromJSON(json: any): Status { + return StatusFromJSONTyped(json, false); +} + +export function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status { + return json as Status; +} + +export function StatusToJSON(value?: Status | null): any { + return value as any; +} + +export function StatusToJSONTyped(value: any, ignoreDiscriminator: boolean): Status { + return value as Status; +} + diff --git a/platform/src/sdk/models/shared/supplementaldataconfiguration.ts b/platform/src/sdk/models/shared/supplementaldataconfiguration.ts index 6fd3b46d0..a15d674d1 100644 --- a/platform/src/sdk/models/shared/supplementaldataconfiguration.ts +++ b/platform/src/sdk/models/shared/supplementaldataconfiguration.ts @@ -1,127 +1,118 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { SupplementalDataSourceConfiguration } from './supplementaldatasourceconfiguration'; +import { + SupplementalDataSourceConfigurationFromJSON, + SupplementalDataSourceConfigurationFromJSONTyped, + SupplementalDataSourceConfigurationToJSON, + SupplementalDataSourceConfigurationToJSONTyped, +} from './supplementaldatasourceconfiguration'; /** - * The client's defined name for the object. + * + * @export + * @interface SupplementalDataConfiguration */ -export type SupplementalDataSourceConfiguration = { - /** - * The underlying endpoint of the source system which the configuration is targeting. - */ - dataSource?: string | undefined; - /** - * The additional properties that are required when pulling records. - */ - pullData?: { [k: string]: string } | undefined; - /** - * The additional properties that are required to create and/or update records. - */ - pushData?: { [k: string]: string } | undefined; -}; +export interface SupplementalDataConfiguration { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; +} -export type SupplementalDataConfiguration = { - supplementalDataConfig?: - | { [k: string]: SupplementalDataSourceConfiguration } - | undefined; -}; +/** + * Check if a given object implements the SupplementalDataConfiguration interface. + */ +export function instanceOfSupplementalDataConfiguration(value: object): value is SupplementalDataConfiguration { + return true; +} -/** @internal */ -export const SupplementalDataSourceConfiguration$inboundSchema: z.ZodType< - SupplementalDataSourceConfiguration, - z.ZodTypeDef, - unknown -> = z.object({ - dataSource: z.string().optional(), - pullData: z.record(z.string()).optional(), - pushData: z.record(z.string()).optional(), -}); -/** @internal */ -export type SupplementalDataSourceConfiguration$Outbound = { - dataSource?: string | undefined; - pullData?: { [k: string]: string } | undefined; - pushData?: { [k: string]: string } | undefined; -}; +export function SupplementalDataConfigurationFromJSON(json: any): SupplementalDataConfiguration { + return SupplementalDataConfigurationFromJSONTyped(json, false); +} -/** @internal */ -export const SupplementalDataSourceConfiguration$outboundSchema: z.ZodType< - SupplementalDataSourceConfiguration$Outbound, - z.ZodTypeDef, - SupplementalDataSourceConfiguration -> = z.object({ - dataSource: z.string().optional(), - pullData: z.record(z.string()).optional(), - pushData: z.record(z.string()).optional(), -}); +export function SupplementalDataConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplementalDataConfiguration { + if (json == null) { + return json; + } + return { + + 'supplementalDataConfig': json['supplementalDataConfig'] == null ? undefined : (mapValues(json['supplementalDataConfig'], SupplementalDataSourceConfigurationFromJSON)), + }; +} -export function supplementalDataSourceConfigurationToJSON( - supplementalDataSourceConfiguration: SupplementalDataSourceConfiguration, -): string { - return JSON.stringify( - SupplementalDataSourceConfiguration$outboundSchema.parse( - supplementalDataSourceConfiguration, - ), - ); +export function SupplementalDataConfigurationToJSON(json: any): SupplementalDataConfiguration { + return SupplementalDataConfigurationToJSONTyped(json, false); } -export function supplementalDataSourceConfigurationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - SupplementalDataSourceConfiguration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplementalDataSourceConfiguration' from JSON`, - ); + +export function SupplementalDataConfigurationToJSONTyped(value?: SupplementalDataConfiguration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'supplementalDataConfig': value['supplementalDataConfig'] == null ? undefined : (mapValues(value['supplementalDataConfig'], SupplementalDataSourceConfigurationToJSON)), + }; } -/** @internal */ -export const SupplementalDataConfiguration$inboundSchema: z.ZodType< - SupplementalDataConfiguration, - z.ZodTypeDef, - unknown -> = z.object({ - supplementalDataConfig: z.record( - z.lazy(() => SupplementalDataSourceConfiguration$inboundSchema), - ).optional(), -}); -/** @internal */ -export type SupplementalDataConfiguration$Outbound = { - supplementalDataConfig?: { - [k: string]: SupplementalDataSourceConfiguration$Outbound; - } | undefined; -}; -/** @internal */ -export const SupplementalDataConfiguration$outboundSchema: z.ZodType< - SupplementalDataConfiguration$Outbound, - z.ZodTypeDef, - SupplementalDataConfiguration -> = z.object({ - supplementalDataConfig: z.record( - z.lazy(() => SupplementalDataSourceConfiguration$outboundSchema), - ).optional(), -}); +export interface ConfigureSupplementalDataRequestBody { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; +} + +export interface ConfigureSupplementalDataSupplementalDataConfiguration { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; +} -export function supplementalDataConfigurationToJSON( - supplementalDataConfiguration: SupplementalDataConfiguration, -): string { - return JSON.stringify( - SupplementalDataConfiguration$outboundSchema.parse( - supplementalDataConfiguration, - ), - ); +export interface GetSupplementalDataConfigurationResponseSupplementalDataConfiguration { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; } -export function supplementalDataConfigurationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupplementalDataConfiguration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplementalDataConfiguration' from JSON`, - ); + +export interface SupplementalDataConfigurationGetResponseSupplementalDataConfiguration { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; +} + +export interface SupplementalDataConfigureRequestBody { + /** + * + * @type {{ [key: string]: SupplementalDataSourceConfiguration; }} + * @memberof SupplementalDataConfiguration + */ + supplementalDataConfig?: { [key: string]: SupplementalDataSourceConfiguration; }; } diff --git a/platform/src/sdk/models/shared/supplementaldatasourceconfiguration.ts b/platform/src/sdk/models/shared/supplementaldatasourceconfiguration.ts new file mode 100644 index 000000000..04ed1ff5d --- /dev/null +++ b/platform/src/sdk/models/shared/supplementaldatasourceconfiguration.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * The client's defined name for the object. + * @export + * @interface SupplementalDataSourceConfiguration + */ +export interface SupplementalDataSourceConfiguration { + /** + * The underlying endpoint of the source system which the configuration is targeting. + * @type {string} + * @memberof SupplementalDataSourceConfiguration + */ + dataSource?: string; + /** + * The additional properties that are required when pulling records. + * @type {{ [key: string]: string; }} + * @memberof SupplementalDataSourceConfiguration + */ + pullData?: { [key: string]: string; }; + /** + * The additional properties that are required to create and/or update records. + * @type {{ [key: string]: string; }} + * @memberof SupplementalDataSourceConfiguration + */ + pushData?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the SupplementalDataSourceConfiguration interface. + */ +export function instanceOfSupplementalDataSourceConfiguration(value: object): value is SupplementalDataSourceConfiguration { + return true; +} + +export function SupplementalDataSourceConfigurationFromJSON(json: any): SupplementalDataSourceConfiguration { + return SupplementalDataSourceConfigurationFromJSONTyped(json, false); +} + +export function SupplementalDataSourceConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplementalDataSourceConfiguration { + if (json == null) { + return json; + } + return { + + 'dataSource': json['dataSource'] == null ? undefined : json['dataSource'], + 'pullData': json['pullData'] == null ? undefined : json['pullData'], + 'pushData': json['pushData'] == null ? undefined : json['pushData'], + }; +} + +export function SupplementalDataSourceConfigurationToJSON(json: any): SupplementalDataSourceConfiguration { + return SupplementalDataSourceConfigurationToJSONTyped(json, false); +} + +export function SupplementalDataSourceConfigurationToJSONTyped(value?: SupplementalDataSourceConfiguration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataSource': value['dataSource'], + 'pullData': value['pullData'], + 'pushData': value['pushData'], + }; +} + diff --git a/platform/src/sdk/models/shared/supportedfeature.ts b/platform/src/sdk/models/shared/supportedfeature.ts index ea7140848..72862a6cf 100644 --- a/platform/src/sdk/models/shared/supportedfeature.ts +++ b/platform/src/sdk/models/shared/supportedfeature.ts @@ -1,41 +1,92 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { FeatureState, FeatureState$inboundSchema } from "./featurestate.js"; -import { FeatureType, FeatureType$inboundSchema } from "./featuretype.js"; - -export type SupportedFeature = { - /** - * The type of feature. - */ - featureType: FeatureType; - /** - * The current release state of the feature. - */ - featureState: FeatureState; -}; - -/** @internal */ -export const SupportedFeature$inboundSchema: z.ZodType< - SupportedFeature, - z.ZodTypeDef, - unknown -> = z.object({ - featureType: FeatureType$inboundSchema, - featureState: FeatureState$inboundSchema, -}); - -export function supportedFeatureFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupportedFeature$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupportedFeature' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { FeatureType } from './featuretype'; +import { + FeatureTypeFromJSON, + FeatureTypeFromJSONTyped, + FeatureTypeToJSON, + FeatureTypeToJSONTyped, +} from './featuretype'; +import type { FeatureState } from './featurestate'; +import { + FeatureStateFromJSON, + FeatureStateFromJSONTyped, + FeatureStateToJSON, + FeatureStateToJSONTyped, +} from './featurestate'; + +/** + * + * @export + * @interface SupportedFeature + */ +export interface SupportedFeature { + /** + * + * @type {FeatureType} + * @memberof SupportedFeature + */ + featureType: FeatureType; + /** + * + * @type {FeatureState} + * @memberof SupportedFeature + */ + featureState: FeatureState; +} + + + +/** + * Check if a given object implements the SupportedFeature interface. + */ +export function instanceOfSupportedFeature(value: object): value is SupportedFeature { + if (!('featureType' in value) || value['featureType'] === undefined) return false; + if (!('featureState' in value) || value['featureState'] === undefined) return false; + return true; +} + +export function SupportedFeatureFromJSON(json: any): SupportedFeature { + return SupportedFeatureFromJSONTyped(json, false); } + +export function SupportedFeatureFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupportedFeature { + if (json == null) { + return json; + } + return { + + 'featureType': FeatureTypeFromJSON(json['featureType']), + 'featureState': FeatureStateFromJSON(json['featureState']), + }; +} + +export function SupportedFeatureToJSON(json: any): SupportedFeature { + return SupportedFeatureToJSONTyped(json, false); +} + +export function SupportedFeatureToJSONTyped(value?: SupportedFeature | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'featureType': FeatureTypeToJSON(value['featureType']), + 'featureState': FeatureStateToJSON(value['featureState']), + }; +} + diff --git a/platform/src/sdk/models/shared/syncsetting.ts b/platform/src/sdk/models/shared/syncsetting.ts index 614d3c459..804ce0ec0 100644 --- a/platform/src/sdk/models/shared/syncsetting.ts +++ b/platform/src/sdk/models/shared/syncsetting.ts @@ -1,125 +1,749 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 type { DataType } from '../DataType'; +import type { Company } from './company'; +import { mapValues } from '../../../runtime'; /** * Describes how often, and how much history, should be fetched for the given data type when a pull operation is queued. + * @export + * @interface SyncSetting + */ +export interface SyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: DataType; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + + +/** + * @export + */ +export const SyncSettingDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type SyncSettingDataTypeEnum = typeof SyncSettingDataTypeEnum[keyof typeof SyncSettingDataTypeEnum]; + + +/** + * Check if a given object implements the SyncSetting interface. */ -export type SyncSetting = { - /** - * Available data types - */ - dataType: DataType; - /** - * Whether this data type should be queued after a company has authorized a connection. - */ - fetchOnFirstLink: boolean; - /** - * Number of hours after which this data type should be refreshed. - */ - syncSchedule: number; - /** - * The sync in which data types are queued for a sync. - */ - syncOrder: number; - /** - * 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. - */ - syncFromUtc?: string | undefined; - /** - * Number of months of data to be fetched. Set this *or* `syncFromUTC`. - */ - syncFromWindow?: number | undefined; - /** - * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. - */ - monthsToSync?: number | undefined; - /** - * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. - */ - isLocked?: boolean | undefined; -}; - -/** @internal */ -export const SyncSetting$inboundSchema: z.ZodType< - SyncSetting, - z.ZodTypeDef, - unknown -> = z.object({ - dataType: DataType$inboundSchema, - fetchOnFirstLink: z.boolean(), - syncSchedule: z.number().int(), - syncOrder: z.number().int(), - syncFromUtc: z.string().optional(), - syncFromWindow: z.number().int().optional(), - monthsToSync: z.number().int().optional(), - isLocked: z.boolean().optional(), -}); -/** @internal */ -export type SyncSetting$Outbound = { - dataType: string; - fetchOnFirstLink: boolean; - syncSchedule: number; - syncOrder: number; - syncFromUtc?: string | undefined; - syncFromWindow?: number | undefined; - monthsToSync?: number | undefined; - isLocked?: boolean | undefined; -}; - -/** @internal */ -export const SyncSetting$outboundSchema: z.ZodType< - SyncSetting$Outbound, - z.ZodTypeDef, - SyncSetting -> = z.object({ - dataType: DataType$outboundSchema, - fetchOnFirstLink: z.boolean(), - syncSchedule: z.number().int(), - syncOrder: z.number().int(), - syncFromUtc: z.string().optional(), - syncFromWindow: z.number().int().optional(), - monthsToSync: z.number().int().optional(), - isLocked: z.boolean().optional(), -}); - -export function syncSettingToJSON(syncSetting: SyncSetting): string { - return JSON.stringify(SyncSetting$outboundSchema.parse(syncSetting)); +export function instanceOfSyncSetting(value: object): value is SyncSetting { + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('fetchOnFirstLink' in value) || value['fetchOnFirstLink'] === undefined) return false; + if (!('syncSchedule' in value) || value['syncSchedule'] === undefined) return false; + if (!('syncOrder' in value) || value['syncOrder'] === undefined) return false; + return true; +} + +export function SyncSettingFromJSON(json: any): SyncSetting { + return SyncSettingFromJSONTyped(json, false); +} + +export function SyncSettingFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncSetting { + if (json == null) { + return json; + } + return { + + 'dataType': json['dataType'], + 'fetchOnFirstLink': json['fetchOnFirstLink'], + 'syncSchedule': json['syncSchedule'], + 'syncOrder': json['syncOrder'], + 'syncFromUtc': json['syncFromUtc'] == null ? undefined : json['syncFromUtc'], + 'syncFromWindow': json['syncFromWindow'] == null ? undefined : json['syncFromWindow'], + 'monthsToSync': json['monthsToSync'] == null ? undefined : json['monthsToSync'], + 'isLocked': json['isLocked'] == null ? undefined : json['isLocked'], + }; +} + +export function SyncSettingToJSON(json: any): SyncSetting { + return SyncSettingToJSONTyped(json, false); +} + +export function SyncSettingToJSONTyped(value?: SyncSetting | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataType': value['dataType'], + 'fetchOnFirstLink': value['fetchOnFirstLink'], + 'syncSchedule': value['syncSchedule'], + 'syncOrder': value['syncOrder'], + 'syncFromUtc': value['syncFromUtc'], + 'syncFromWindow': value['syncFromWindow'], + 'monthsToSync': value['monthsToSync'], + 'isLocked': value['isLocked'], + }; +} + + +export interface CompanySyncSettingsGetResponseSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface CompanySyncSettingsSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface GetCompanySyncSettingsResponseSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; } -export function syncSettingFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SyncSetting$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SyncSetting' from JSON`, - ); + +export interface GetProfileSyncSettingsResponseSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface ProfileSyncSettingsGetResponseSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface SetCompanySyncSettingsRequestBodySyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface SyncSettingsSyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; +} + +export interface UpdateProfileSyncSettingsRequestBodySyncSetting { + /** + * Available data types + * @type {string} + * @memberof SyncSetting + */ + dataType: SyncSettingDataTypeEnum; + /** + * Whether this data type should be queued after a company has authorized a connection. + * @type {boolean} + * @memberof SyncSetting + */ + fetchOnFirstLink: boolean; + /** + * Number of hours after which this data type should be refreshed. + * @type {number} + * @memberof SyncSetting + */ + syncSchedule: number; + /** + * The sync in which data types are queued for a sync. + * @type {number} + * @memberof SyncSetting + */ + syncOrder: number; + /** + * 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. + * @type {string} + * @memberof SyncSetting + */ + syncFromUtc?: string; + /** + * Number of months of data to be fetched. Set this *or* `syncFromUTC`. + * @type {number} + * @memberof SyncSetting + */ + syncFromWindow?: number; + /** + * Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only. + * @type {number} + * @memberof SyncSetting + */ + monthsToSync?: number; + /** + * `True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked. + * @type {boolean} + * @memberof SyncSetting + */ + isLocked?: boolean; } diff --git a/platform/src/sdk/models/shared/syncsettings.ts b/platform/src/sdk/models/shared/syncsettings.ts index f7c1a35d2..9c66cf968 100644 --- a/platform/src/sdk/models/shared/syncsettings.ts +++ b/platform/src/sdk/models/shared/syncsettings.ts @@ -1,42 +1,131 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { SyncSetting, SyncSetting$inboundSchema } from "./syncsetting.js"; - -export type SyncSettings = { - /** - * Unique identifier for your client in Codat. - */ - clientId?: string | undefined; - settings?: Array | undefined; - /** - * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). - */ - overridesDefaults?: boolean | undefined; -}; - -/** @internal */ -export const SyncSettings$inboundSchema: z.ZodType< - SyncSettings, - z.ZodTypeDef, - unknown -> = z.object({ - clientId: z.string().optional(), - settings: z.array(SyncSetting$inboundSchema).optional(), - overridesDefaults: z.boolean().optional(), -}); - -export function syncSettingsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SyncSettings$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SyncSettings' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { SyncSetting } from './syncsetting'; +import { + SyncSettingFromJSON, + SyncSettingFromJSONTyped, + SyncSettingToJSON, + SyncSettingToJSONTyped, +} from './syncsetting'; + +/** + * + * @export + * @interface SyncSettings + */ +export interface SyncSettings { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof SyncSettings + */ + clientId?: string; + /** + * + * @type {Array} + * @memberof SyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SyncSettings + */ + overridesDefaults?: boolean; +} + +/** + * Check if a given object implements the SyncSettings interface. + */ +export function instanceOfSyncSettings(value: object): value is SyncSettings { + return true; +} + +export function SyncSettingsFromJSON(json: any): SyncSettings { + return SyncSettingsFromJSONTyped(json, false); +} + +export function SyncSettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncSettings { + if (json == null) { + return json; + } + return { + + 'clientId': json['clientId'] == null ? undefined : json['clientId'], + 'settings': json['settings'] == null ? undefined : ((json['settings'] as Array).map(SyncSettingFromJSON)), + 'overridesDefaults': json['overridesDefaults'] == null ? undefined : json['overridesDefaults'], + }; +} + +export function SyncSettingsToJSON(json: any): SyncSettings { + return SyncSettingsToJSONTyped(json, false); +} + +export function SyncSettingsToJSONTyped(value?: SyncSettings | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'clientId': value['clientId'], + 'settings': value['settings'] == null ? undefined : ((value['settings'] as Array).map(SyncSettingToJSON)), + 'overridesDefaults': value['overridesDefaults'], + }; +} + + +export interface GetProfileSyncSettingsResponseSyncSettings { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof SyncSettings + */ + clientId?: string; + /** + * + * @type {Array} + * @memberof SyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SyncSettings + */ + overridesDefaults?: boolean; +} + +export interface ProfileSyncSettingsGetResponseSyncSettings { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof SyncSettings + */ + clientId?: string; + /** + * + * @type {Array} + * @memberof SyncSettings + */ + settings?: Array; + /** + * Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings). + * @type {boolean} + * @memberof SyncSettings + */ + overridesDefaults?: boolean; } diff --git a/platform/src/sdk/models/shared/updateconnectionstatus.ts b/platform/src/sdk/models/shared/updateconnectionstatus.ts index e66d22eb4..e1e9988b2 100644 --- a/platform/src/sdk/models/shared/updateconnectionstatus.ts +++ b/platform/src/sdk/models/shared/updateconnectionstatus.ts @@ -1,38 +1,128 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; +import { mapValues } from '../../../runtime'; +import type { DataConnectionStatus } from './dataconnectionstatus'; import { - DataConnectionStatus, - DataConnectionStatus$outboundSchema, -} from "./dataconnectionstatus.js"; - -export type UpdateConnectionStatus = { - /** - * The current authorization status of the data connection. - */ - status?: DataConnectionStatus | undefined; -}; - -/** @internal */ -export type UpdateConnectionStatus$Outbound = { - status?: string | undefined; -}; - -/** @internal */ -export const UpdateConnectionStatus$outboundSchema: z.ZodType< - UpdateConnectionStatus$Outbound, - z.ZodTypeDef, - UpdateConnectionStatus -> = z.object({ - status: DataConnectionStatus$outboundSchema.optional(), -}); - -export function updateConnectionStatusToJSON( - updateConnectionStatus: UpdateConnectionStatus, -): string { - return JSON.stringify( - UpdateConnectionStatus$outboundSchema.parse(updateConnectionStatus), - ); + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './dataconnectionstatus'; + +/** + * + * @export + * @interface UpdateConnectionStatus + */ +export interface UpdateConnectionStatus { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; +} + + + +/** + * Check if a given object implements the UpdateConnectionStatus interface. + */ +export function instanceOfUpdateConnectionStatus(value: object): value is UpdateConnectionStatus { + return true; +} + +export function UpdateConnectionStatusFromJSON(json: any): UpdateConnectionStatus { + return UpdateConnectionStatusFromJSONTyped(json, false); +} + +export function UpdateConnectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateConnectionStatus { + if (json == null) { + return json; + } + return { + + ...json, + 'status': json['status'] == null ? undefined : DataConnectionStatusFromJSON(json['status']), + }; +} + +export function UpdateConnectionStatusToJSON(json: any): UpdateConnectionStatus { + return UpdateConnectionStatusToJSONTyped(json, false); +} + +export function UpdateConnectionStatusToJSONTyped(value?: UpdateConnectionStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'status': DataConnectionStatusToJSON(value['status']), + }; +} + + +export interface ConnectionUnlinkRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionUpdateConnectionStatus { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; +} + +export interface UpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; +} + +export interface UpdateConnectionStatusUpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnectionStatus + */ + status?: DataConnectionStatus; } diff --git a/platform/src/sdk/models/shared/validation.ts b/platform/src/sdk/models/shared/validation.ts index 809d8b74c..aa8d0b3fa 100644 --- a/platform/src/sdk/models/shared/validation.ts +++ b/platform/src/sdk/models/shared/validation.ts @@ -1,40 +1,141 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ValidationItem1 } from './validationitem1'; import { - ValidationItem1, - ValidationItem1$inboundSchema, -} from "./validationitem1.js"; + ValidationItem1FromJSON, + ValidationItem1FromJSONTyped, + ValidationItem1ToJSON, + ValidationItem1ToJSONTyped, +} from './validationitem1'; /** * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + * @export + * @interface Validation + */ +export interface Validation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the Validation interface. */ -export type Validation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const Validation$inboundSchema: z.ZodType< - Validation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ValidationItem1$inboundSchema)).optional(), - warnings: z.nullable(z.array(ValidationItem1$inboundSchema)).optional(), -}); - -export function validationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Validation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Validation' from JSON`, - ); +export function instanceOfValidation(value: object): value is Validation { + return true; +} + +export function ValidationFromJSON(json: any): Validation { + return ValidationFromJSONTyped(json, false); +} + +export function ValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ValidationItem1FromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ValidationItem1FromJSON)), + }; +} + +export function ValidationToJSON(json: any): Validation { + return ValidationToJSONTyped(json, false); +} + +export function ValidationToJSONTyped(value?: Validation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ValidationItem1ToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ValidationItem1ToJSON)), + }; +} + + +export interface GetPushOperationResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationGetResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationsValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; } diff --git a/platform/src/sdk/models/shared/validationitem.ts b/platform/src/sdk/models/shared/validationitem.ts index 09e03fea6..761120c58 100644 --- a/platform/src/sdk/models/shared/validationitem.ts +++ b/platform/src/sdk/models/shared/validationitem.ts @@ -1,49 +1,170 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 ValidationItem = { - /** - * The unique identifier of the rule that wasn't met. - */ - ruleId?: string | undefined; - /** - * The unique identifier of the item that was validated. - */ - itemId?: string | undefined; - /** - * The message that describes the validation warning or error. - */ - message?: string | undefined; - /** - * The name of the validator that was used to validate the item. - */ - validatorName?: string | undefined; -}; - -/** @internal */ -export const ValidationItem$inboundSchema: z.ZodType< - ValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - ruleId: z.string().optional(), - itemId: z.string().optional(), - message: z.string().optional(), - validatorName: z.string().optional(), -}); - -export function validationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ValidationItem + */ +export interface ValidationItem { + /** + * The unique identifier of the rule that wasn't met. + * @type {string} + * @memberof ValidationItem + */ + ruleId?: string; + /** + * The unique identifier of the item that was validated. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string; + /** + * The message that describes the validation warning or error. + * @type {string} + * @memberof ValidationItem + */ + message?: string; + /** + * The name of the validator that was used to validate the item. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string; +} + +/** + * Check if a given object implements the ValidationItem interface. + */ +export function instanceOfValidationItem(value: object): value is ValidationItem { + return true; +} + +export function ValidationItemFromJSON(json: any): ValidationItem { + return ValidationItemFromJSONTyped(json, false); +} + +export function ValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationItem { + if (json == null) { + return json; + } + return { + + 'ruleId': json['ruleId'] == null ? undefined : json['ruleId'], + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ValidationItemToJSON(json: any): ValidationItem { + return ValidationItemToJSONTyped(json, false); +} + +export function ValidationItemToJSONTyped(value?: ValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ruleId': value['ruleId'], + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface GetReadValidationResultsResponseValidationItem { + /** + * The unique identifier of the rule that wasn't met. + * @type {string} + * @memberof ValidationItem + */ + ruleId?: string; + /** + * The unique identifier of the item that was validated. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string; + /** + * The message that describes the validation warning or error. + * @type {string} + * @memberof ValidationItem + */ + message?: string; + /** + * The name of the validator that was used to validate the item. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string; +} + +export interface ReadValidationResultsGetResponseValidationItem { + /** + * The unique identifier of the rule that wasn't met. + * @type {string} + * @memberof ValidationItem + */ + ruleId?: string; + /** + * The unique identifier of the item that was validated. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string; + /** + * The message that describes the validation warning or error. + * @type {string} + * @memberof ValidationItem + */ + message?: string; + /** + * The name of the validator that was used to validate the item. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string; +} + +export interface ValidationResultValidationItem { + /** + * The unique identifier of the rule that wasn't met. + * @type {string} + * @memberof ValidationItem + */ + ruleId?: string; + /** + * The unique identifier of the item that was validated. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string; + /** + * The message that describes the validation warning or error. + * @type {string} + * @memberof ValidationItem + */ + message?: string; + /** + * The name of the validator that was used to validate the item. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string; } diff --git a/platform/src/sdk/models/shared/validationitem1.ts b/platform/src/sdk/models/shared/validationitem1.ts index f500a4164..f6055c7c6 100644 --- a/platform/src/sdk/models/shared/validationitem1.ts +++ b/platform/src/sdk/models/shared/validationitem1.ts @@ -1,44 +1,106 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 ValidationItem1 = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ValidationItem1$inboundSchema: z.ZodType< - ValidationItem1, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function validationItem1FromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ValidationItem1$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ValidationItem1' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ValidationItem1 + */ +export interface ValidationItem1 { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem1 + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem1 + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem1 + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ValidationItem1 interface. + */ +export function instanceOfValidationItem1(value: object): value is ValidationItem1 { + return true; +} + +export function ValidationItem1FromJSON(json: any): ValidationItem1 { + return ValidationItem1FromJSONTyped(json, false); +} + +export function ValidationItem1FromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationItem1 { + if (json == null) { + return json; + } + return { + + ...json, + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ValidationItem1ToJSON(json: any): ValidationItem1 { + return ValidationItem1ToJSONTyped(json, false); +} + +export function ValidationItem1ToJSONTyped(value?: ValidationItem1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface PushOperationValidationItem1 { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem1 + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem1 + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem1 + */ + validatorName?: string | null; } diff --git a/platform/src/sdk/models/shared/validationresult.ts b/platform/src/sdk/models/shared/validationresult.ts index 87fbfde5b..663714f44 100644 --- a/platform/src/sdk/models/shared/validationresult.ts +++ b/platform/src/sdk/models/shared/validationresult.ts @@ -1,37 +1,111 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { ValidationItem } from './validationitem'; import { - ValidationItem, - ValidationItem$inboundSchema, -} from "./validationitem.js"; - -export type ValidationResult = { - errors?: Array | undefined; - warnings?: Array | undefined; -}; - -/** @internal */ -export const ValidationResult$inboundSchema: z.ZodType< - ValidationResult, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.array(ValidationItem$inboundSchema).optional(), - warnings: z.array(ValidationItem$inboundSchema).optional(), -}); - -export function validationResultFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ValidationResult$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ValidationResult' from JSON`, - ); + ValidationItemFromJSON, + ValidationItemFromJSONTyped, + ValidationItemToJSON, + ValidationItemToJSONTyped, +} from './validationitem'; + +/** + * + * @export + * @interface ValidationResult + */ +export interface ValidationResult { + /** + * + * @type {Array} + * @memberof ValidationResult + */ + errors?: Array; + /** + * + * @type {Array} + * @memberof ValidationResult + */ + warnings?: Array; +} + +/** + * Check if a given object implements the ValidationResult interface. + */ +export function instanceOfValidationResult(value: object): value is ValidationResult { + return true; +} + +export function ValidationResultFromJSON(json: any): ValidationResult { + return ValidationResultFromJSONTyped(json, false); +} + +export function ValidationResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationResult { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ValidationItemFromJSON)), + }; +} + +export function ValidationResultToJSON(json: any): ValidationResult { + return ValidationResultToJSONTyped(json, false); +} + +export function ValidationResultToJSONTyped(value?: ValidationResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ValidationItemToJSON)), + }; +} + + +export interface GetReadValidationResultsResponseValidationResult { + /** + * + * @type {Array} + * @memberof ValidationResult + */ + errors?: Array; + /** + * + * @type {Array} + * @memberof ValidationResult + */ + warnings?: Array; +} + +export interface ReadValidationResultsGetResponseValidationResult { + /** + * + * @type {Array} + * @memberof ValidationResult + */ + errors?: Array; + /** + * + * @type {Array} + * @memberof ValidationResult + */ + warnings?: Array; } diff --git a/platform/src/sdk/models/shared/webhookconsumer.ts b/platform/src/sdk/models/shared/webhookconsumer.ts index 518c26d46..7476f4d32 100644 --- a/platform/src/sdk/models/shared/webhookconsumer.ts +++ b/platform/src/sdk/models/shared/webhookconsumer.ts @@ -1,61 +1,232 @@ -/* - * 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"; - +/* tslint:disable */ +/* eslint-disable */ /** - * A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | * - * @remarks + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. + * * See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + * + * @export + * @interface WebhookConsumer + */ +export interface WebhookConsumer { + /** + * Unique identifier for the webhook consumer. + * @type {string} + * @memberof WebhookConsumer + */ + id?: string; + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumer + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumer + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumer + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumer + */ + companyTags?: Array | null; +} + +/** + * Check if a given object implements the WebhookConsumer interface. */ -export type WebhookConsumer = { - /** - * Unique identifier for the webhook consumer. - */ - id?: string | undefined; - /** - * The URL that will consume webhook events dispatched by Codat. - */ - url?: string | undefined; - /** - * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. - */ - disabled: boolean | null; - /** - * An array of event types the webhook consumer subscribes to. - */ - eventTypes?: Array | undefined; - /** - * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. - */ - companyTags?: Array | null | undefined; -}; - -/** @internal */ -export const WebhookConsumer$inboundSchema: z.ZodType< - WebhookConsumer, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - url: z.string().optional(), - disabled: z.nullable(z.boolean().default(false)), - eventTypes: z.array(z.string()).optional(), - companyTags: z.nullable(z.array(z.string())).optional(), -}); - -export function webhookConsumerFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => WebhookConsumer$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'WebhookConsumer' from JSON`, - ); +export function instanceOfWebhookConsumer(value: object): value is WebhookConsumer { + return true; +} + +export function WebhookConsumerFromJSON(json: any): WebhookConsumer { + return WebhookConsumerFromJSONTyped(json, false); +} + +export function WebhookConsumerFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookConsumer { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'url': json['url'] == null ? undefined : json['url'], + 'disabled': json['disabled'] == null ? undefined : json['disabled'], + 'eventTypes': json['eventTypes'] == null ? undefined : json['eventTypes'], + 'companyTags': json['companyTags'] == null ? undefined : json['companyTags'], + }; +} + +export function WebhookConsumerToJSON(json: any): WebhookConsumer { + return WebhookConsumerToJSONTyped(json, false); +} + +export function WebhookConsumerToJSONTyped(value?: WebhookConsumer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'url': value['url'], + 'disabled': value['disabled'], + 'eventTypes': value['eventTypes'], + 'companyTags': value['companyTags'], + }; +} + + +export interface CreateWebhookConsumerResponseWebhookConsumer { + /** + * Unique identifier for the webhook consumer. + * @type {string} + * @memberof WebhookConsumer + */ + id?: string; + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumer + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumer + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumer + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumer + */ + companyTags?: Array | null; +} + +export interface ListWebhookConsumersResponseWebhookConsumer { + /** + * Unique identifier for the webhook consumer. + * @type {string} + * @memberof WebhookConsumer + */ + id?: string; + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumer + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumer + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumer + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumer + */ + companyTags?: Array | null; +} + +export interface WebhookConsumerCreateResponseWebhookConsumer { + /** + * Unique identifier for the webhook consumer. + * @type {string} + * @memberof WebhookConsumer + */ + id?: string; + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumer + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumer + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumer + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumer + */ + companyTags?: Array | null; +} + +export interface WebhookConsumersListResponseWebhookConsumer { + /** + * Unique identifier for the webhook consumer. + * @type {string} + * @memberof WebhookConsumer + */ + id?: string; + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumer + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumer + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumer + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumer + */ + companyTags?: Array | null; } diff --git a/platform/src/sdk/models/shared/webhookconsumerprototype.ts b/platform/src/sdk/models/shared/webhookconsumerprototype.ts index 3eab8c6dc..93c729c1e 100644 --- a/platform/src/sdk/models/shared/webhookconsumerprototype.ts +++ b/platform/src/sdk/models/shared/webhookconsumerprototype.ts @@ -1,52 +1,170 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type WebhookConsumerPrototype = { - /** - * The URL that will consume webhook events dispatched by Codat. - */ - url?: string | undefined; - /** - * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. - */ - disabled?: boolean | null | undefined; - /** - * An array of event types the webhook consumer subscribes to. - */ - eventTypes?: Array | undefined; - /** - * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. - */ - companyTags?: Array | null | undefined; -}; - -/** @internal */ -export type WebhookConsumerPrototype$Outbound = { - url?: string | undefined; - disabled: boolean | null; - eventTypes?: Array | undefined; - companyTags?: Array | null | undefined; -}; - -/** @internal */ -export const WebhookConsumerPrototype$outboundSchema: z.ZodType< - WebhookConsumerPrototype$Outbound, - z.ZodTypeDef, - WebhookConsumerPrototype -> = z.object({ - url: z.string().optional(), - disabled: z.nullable(z.boolean().default(false)), - eventTypes: z.array(z.string()).optional(), - companyTags: z.nullable(z.array(z.string())).optional(), -}); - -export function webhookConsumerPrototypeToJSON( - webhookConsumerPrototype: WebhookConsumerPrototype, -): string { - return JSON.stringify( - WebhookConsumerPrototype$outboundSchema.parse(webhookConsumerPrototype), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface WebhookConsumerPrototype + */ +export interface WebhookConsumerPrototype { + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumerPrototype + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumerPrototype + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + companyTags?: Array | null; +} + +/** + * Check if a given object implements the WebhookConsumerPrototype interface. + */ +export function instanceOfWebhookConsumerPrototype(value: object): value is WebhookConsumerPrototype { + return true; +} + +export function WebhookConsumerPrototypeFromJSON(json: any): WebhookConsumerPrototype { + return WebhookConsumerPrototypeFromJSONTyped(json, false); +} + +export function WebhookConsumerPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookConsumerPrototype { + if (json == null) { + return json; + } + return { + + 'url': json['url'] == null ? undefined : json['url'], + 'disabled': json['disabled'] == null ? undefined : json['disabled'], + 'eventTypes': json['eventTypes'] == null ? undefined : json['eventTypes'], + 'companyTags': json['companyTags'] == null ? undefined : json['companyTags'], + }; +} + +export function WebhookConsumerPrototypeToJSON(json: any): WebhookConsumerPrototype { + return WebhookConsumerPrototypeToJSONTyped(json, false); +} + +export function WebhookConsumerPrototypeToJSONTyped(value?: WebhookConsumerPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'url': value['url'], + 'disabled': value['disabled'], + 'eventTypes': value['eventTypes'], + 'companyTags': value['companyTags'], + }; +} + + +export interface CreateWebhookConsumerRequestBody { + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumerPrototype + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumerPrototype + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + companyTags?: Array | null; +} + +export interface CreateWebhookConsumerWebhookConsumerPrototype { + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumerPrototype + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumerPrototype + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + companyTags?: Array | null; +} + +export interface WebhookConsumerCreateRequestBody { + /** + * The URL that will consume webhook events dispatched by Codat. + * @type {string} + * @memberof WebhookConsumerPrototype + */ + url?: string; + /** + * Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. + * @type {boolean} + * @memberof WebhookConsumerPrototype + */ + disabled?: boolean | null; + /** + * An array of event types the webhook consumer subscribes to. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + eventTypes?: Array; + /** + * Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. + * @type {Array} + * @memberof WebhookConsumerPrototype + */ + companyTags?: Array | null; } diff --git a/platform/src/sdk/models/shared/webhookconsumers.ts b/platform/src/sdk/models/shared/webhookconsumers.ts index 33ccbcc26..5a729b969 100644 --- a/platform/src/sdk/models/shared/webhookconsumers.ts +++ b/platform/src/sdk/models/shared/webhookconsumers.ts @@ -1,35 +1,91 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 { mapValues } from '../../../runtime'; +import type { WebhookConsumer } from './webhookconsumer'; import { - WebhookConsumer, - WebhookConsumer$inboundSchema, -} from "./webhookconsumer.js"; - -export type WebhookConsumers = { - results?: Array | undefined; -}; - -/** @internal */ -export const WebhookConsumers$inboundSchema: z.ZodType< - WebhookConsumers, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(WebhookConsumer$inboundSchema).optional(), -}); - -export function webhookConsumersFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => WebhookConsumers$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'WebhookConsumers' from JSON`, - ); + WebhookConsumerFromJSON, + WebhookConsumerFromJSONTyped, + WebhookConsumerToJSON, + WebhookConsumerToJSONTyped, +} from './webhookconsumer'; + +/** + * + * @export + * @interface WebhookConsumers + */ +export interface WebhookConsumers { + /** + * + * @type {Array} + * @memberof WebhookConsumers + */ + results?: Array; +} + +/** + * Check if a given object implements the WebhookConsumers interface. + */ +export function instanceOfWebhookConsumers(value: object): value is WebhookConsumers { + return true; +} + +export function WebhookConsumersFromJSON(json: any): WebhookConsumers { + return WebhookConsumersFromJSONTyped(json, false); +} + +export function WebhookConsumersFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookConsumers { + if (json == null) { + return json; + } + return { + + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(WebhookConsumerFromJSON)), + }; +} + +export function WebhookConsumersToJSON(json: any): WebhookConsumers { + return WebhookConsumersToJSONTyped(json, false); +} + +export function WebhookConsumersToJSONTyped(value?: WebhookConsumers | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(WebhookConsumerToJSON)), + }; +} + + +export interface ListWebhookConsumersResponseWebhookConsumers { + /** + * + * @type {Array} + * @memberof WebhookConsumers + */ + results?: Array; +} + +export interface WebhookConsumersListResponseWebhookConsumers { + /** + * + * @type {Array} + * @memberof WebhookConsumers + */ + results?: Array; } diff --git a/platform/src/sdk/models/shared/writestatus.ts b/platform/src/sdk/models/shared/writestatus.ts index cc22560ab..4416d94ae 100644 --- a/platform/src/sdk/models/shared/writestatus.ts +++ b/platform/src/sdk/models/shared/writestatus.ts @@ -1,27 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -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 */ export const WriteStatus = { - Pending: "Pending", - Failed: "Failed", - Success: "Success", - TimedOut: "TimedOut", + 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; +export type WriteStatus = typeof WriteStatus[keyof typeof WriteStatus]; + + +export function instanceOfWriteStatus(value: any): boolean { + for (const key in WriteStatus) { + if (Object.prototype.hasOwnProperty.call(WriteStatus, key)) { + if (WriteStatus[key as keyof typeof WriteStatus] === value) { + return true; + } + } + } + return false; +} + +export function WriteStatusFromJSON(json: any): WriteStatus { + return WriteStatusFromJSONTyped(json, false); +} + +export function WriteStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): WriteStatus { + return json as WriteStatus; +} + +export function WriteStatusToJSON(value?: WriteStatus | null): any { + return value as any; +} + +export function WriteStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): WriteStatus { + return value as WriteStatus; +} + diff --git a/platform/src/sdk/models/shared/writetype.ts b/platform/src/sdk/models/shared/writetype.ts index 3a434bc59..cd54e9b44 100644 --- a/platform/src/sdk/models/shared/writetype.ts +++ b/platform/src/sdk/models/shared/writetype.ts @@ -1,27 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Platform API + * An API for the common components of all of Codat\'s products. These end points cover creating and managing your companies, data connections, and integrations. [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | | Webhooks | Create and manage webhooks that listen to Codat\'s events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | | Settings | Manage company profile configuration, sync settings, and API keys. | | Push data | Initiate and monitor Create, Update, and Delete operations. | | Supplemental data | Configure and pull additional data you can include in Codat\'s standard data types. | | Custom data type | Configure and pull additional data types that are not included in Codat\'s standardized data model. | + * + * The version of the OpenAPI document: 3.0.0 + * Contact: support@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of write request. + * @export */ export const WriteType = { - Create: "Create", - Update: "Update", - Delete: "Delete", - UploadAttachment: "UploadAttachment", + 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; +export type WriteType = typeof WriteType[keyof typeof WriteType]; + + +export function instanceOfWriteType(value: any): boolean { + for (const key in WriteType) { + if (Object.prototype.hasOwnProperty.call(WriteType, key)) { + if (WriteType[key as keyof typeof WriteType] === value) { + return true; + } + } + } + return false; +} + +export function WriteTypeFromJSON(json: any): WriteType { + return WriteTypeFromJSONTyped(json, false); +} + +export function WriteTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): WriteType { + return json as WriteType; +} + +export function WriteTypeToJSON(value?: WriteType | null): any { + return value as any; +} + +export function WriteTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): WriteType { + return value as WriteType; +} + diff --git a/platform/src/sdk/pushdata.ts b/platform/src/sdk/pushdata.ts index 834136f0f..e56c62bcf 100644 --- a/platform/src/sdk/pushdata.ts +++ b/platform/src/sdk/pushdata.ts @@ -1,72 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { pushDataGetModelOptions } from "../funcs/pushDataGetModelOptions.js"; -import { pushDataGetOperation } from "../funcs/pushDataGetOperation.js"; -import { pushDataListOperations } from "../funcs/pushDataListOperations.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class PushData extends ClientSDK { - /** - * Get push options - * - * @remarks - * This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. - * - * Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. - * - * Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. - */ - async getModelOptions( - request: operations.GetCreateUpdateModelOptionsByDataTypeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(pushDataGetModelOptions( - this, - request, - options, - )); - } - - /** - * List push operations - * - * @remarks - * The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - */ - async listOperations( - request: operations.GetCompanyPushHistoryRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(pushDataListOperations( - this, - request, - options, - )); - } - - /** - * Get push operation - * - * @remarks - * The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. - * - * Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. - */ - async getOperation( - request: operations.GetPushOperationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(pushDataGetOperation( - this, - request, - options, - )); - } -} +export { PushData } from "../apis/PushData"; diff --git a/platform/src/sdk/readdata.ts b/platform/src/sdk/readdata.ts index 40b4bdc56..0ee336eb3 100644 --- a/platform/src/sdk/readdata.ts +++ b/platform/src/sdk/readdata.ts @@ -1,33 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { readDataGetValidationResults } from "../funcs/readDataGetValidationResults.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class ReadData extends ClientSDK { - /** - * Get validation results - * - * @remarks - * Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. - * - * The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - * - * - **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. - * - **`errors`** array contains critical issues that must be resolved before the data type can be used. - */ - async getValidationResults( - request: operations.GetReadValidationResultsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(readDataGetValidationResults( - this, - request, - options, - )); - } -} +export { ReadData } from "../apis/ReadData"; diff --git a/platform/src/sdk/refreshdata.ts b/platform/src/sdk/refreshdata.ts index a660ec4b2..863b82d94 100644 --- a/platform/src/sdk/refreshdata.ts +++ b/platform/src/sdk/refreshdata.ts @@ -1,106 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { refreshDataAll } from "../funcs/refreshDataAll.js"; -import { refreshDataByDataType } from "../funcs/refreshDataByDataType.js"; -import { refreshDataGet } from "../funcs/refreshDataGet.js"; -import { refreshDataGetPullOperation } from "../funcs/refreshDataGetPullOperation.js"; -import { refreshDataListPullOperations } from "../funcs/refreshDataListPullOperations.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class RefreshData extends ClientSDK { - /** - * Refresh all data - * - * @remarks - * Refreshes all data types with `fetch on first link` set to `true` for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - * - * [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - */ - async all( - request: operations.RefreshCompanyDataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(refreshDataAll( - this, - request, - options, - )); - } - - /** - * Refresh data type - * - * @remarks - * Refreshes a given data type for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - */ - async byDataType( - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(refreshDataByDataType( - this, - request, - options, - )); - } - - /** - * Get data status - * - * @remarks - * Get the state of each data type for a company - */ - async get( - request: operations.GetCompanyDataStatusRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(refreshDataGet( - this, - request, - options, - )); - } - - /** - * List pull operations - * - * @remarks - * Gets the pull operation history (datasets) for a given company. - */ - async listPullOperations( - request: operations.ListPullOperationsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(refreshDataListPullOperations( - this, - request, - options, - )); - } - - /** - * Get pull operation - * - * @remarks - * Retrieve information about a single dataset or pull operation. - */ - async getPullOperation( - request: operations.GetPullOperationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(refreshDataGetPullOperation( - this, - request, - options, - )); - } -} +export { RefreshData } from "../apis/RefreshData"; diff --git a/platform/src/sdk/sdk.ts b/platform/src/sdk/sdk.ts index a10fea4aa..aac59d827 100644 --- a/platform/src/sdk/sdk.ts +++ b/platform/src/sdk/sdk.ts @@ -1,107 +1 @@ -/* - * 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"; -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 { - private _companies?: Companies; - get companies(): Companies { - return (this._companies ??= new Companies(this._options)); - } - - private _connections?: Connections; - get connections(): Connections { - return (this._connections ??= new Connections(this._options)); - } - - private _connectionManagement?: ConnectionManagement; - get connectionManagement(): ConnectionManagement { - return (this._connectionManagement ??= new ConnectionManagement( - this._options, - )); - } - - private _cors?: Cors; - get cors(): Cors { - return (this._cors ??= new Cors(this._options)); - } - - private _settings?: Settings; - get settings(): Settings { - return (this._settings ??= new Settings(this._options)); - } - - private _refreshData?: RefreshData; - get refreshData(): RefreshData { - return (this._refreshData ??= new RefreshData(this._options)); - } - - private _webhooks?: Webhooks; - get webhooks(): Webhooks { - return (this._webhooks ??= new Webhooks(this._options)); - } - - private _integrations?: Integrations; - get integrations(): Integrations { - return (this._integrations ??= new Integrations(this._options)); - } - - private _readData?: ReadData; - get readData(): ReadData { - return (this._readData ??= new ReadData(this._options)); - } - - private _pushData?: PushData; - get pushData(): PushData { - return (this._pushData ??= new PushData(this._options)); - } - - private _supplementalData?: SupplementalData; - get supplementalData(): SupplementalData { - return (this._supplementalData ??= new SupplementalData(this._options)); - } - - private _customDataType?: CustomDataType; - 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 }, - )); - } -} +export * from "../sdk"; diff --git a/platform/src/sdk/settings.ts b/platform/src/sdk/settings.ts index 0619d4433..f0d32f724 100644 --- a/platform/src/sdk/settings.ts +++ b/platform/src/sdk/settings.ts @@ -1,191 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { settingsCreateApiKey } from "../funcs/settingsCreateApiKey.js"; -import { settingsDeleteApiKey } from "../funcs/settingsDeleteApiKey.js"; -import { settingsGet } from "../funcs/settingsGet.js"; -import { settingsGetProfile } from "../funcs/settingsGetProfile.js"; -import { settingsGetSyncSettings } from "../funcs/settingsGetSyncSettings.js"; -import { settingsListApiKeys } from "../funcs/settingsListApiKeys.js"; -import { settingsSet } from "../funcs/settingsSet.js"; -import { settingsUpdateProfile } from "../funcs/settingsUpdateProfile.js"; -import { settingsUpdateSyncSettings } from "../funcs/settingsUpdateSyncSettings.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Settings extends ClientSDK { - /** - * Get CORS settings - * - * @remarks - * The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - */ - async get( - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsGet( - this, - options, - )); - } - - /** - * Set CORS settings - * - * @remarks - * The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - * - * Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. - */ - async set( - request?: shared.ConnectionManagementAllowedOrigins | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsSet( - this, - request, - options, - )); - } - - /** - * Get profile - * - * @remarks - * Fetch your Codat profile. - */ - async getProfile( - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsGetProfile( - this, - options, - )); - } - - /** - * Update profile - * - * @remarks - * Update your Codat profile - */ - async updateProfile( - request?: shared.Profile | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsUpdateProfile( - this, - request, - options, - )); - } - - /** - * Get sync settings - * - * @remarks - * Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. - */ - async getSyncSettings( - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsGetSyncSettings( - this, - options, - )); - } - - /** - * Update all sync settings - * - * @remarks - * Update sync settings for all data types. - */ - async updateSyncSettings( - request?: operations.UpdateProfileSyncSettingsRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsUpdateSyncSettings( - this, - request, - options, - )); - } - - /** - * List API keys - * - * @remarks - * Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - */ - async listApiKeys( - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsListApiKeys( - this, - options, - )); - } - - /** - * Create API key - * - * @remarks - * Use the *Create API keys* endpoint to generate a new API key for your client. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - * - * ### Tips and pitfalls - * - * * Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). - * * If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. - * * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. - */ - async createApiKey( - request?: shared.CreateApiKey | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsCreateApiKey( - this, - request, - options, - )); - } - - /** - * Delete API key - * - * @remarks - * Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. - * - * [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word "Basic" and a space with your API key. - * - * You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. - * - * ### Tips and pitfalls - * - * * It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. - * * It is possible to delete the API key used to authenticate the *Delete API key* request. - */ - async deleteApiKey( - request: operations.DeleteApiKeyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(settingsDeleteApiKey( - this, - request, - options, - )); - } -} +export { Settings } from "../apis/Settings"; diff --git a/platform/src/sdk/supplementaldata.ts b/platform/src/sdk/supplementaldata.ts index 71664963a..9c5b33572 100644 --- a/platform/src/sdk/supplementaldata.ts +++ b/platform/src/sdk/supplementaldata.ts @@ -1,53 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { supplementalDataConfigure } from "../funcs/supplementalDataConfigure.js"; -import { supplementalDataGetConfiguration } from "../funcs/supplementalDataGetConfiguration.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class SupplementalData extends ClientSDK { - /** - * Configure - * - * @remarks - * The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. - * - * [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - * - * **Integration-specific behavior** - * See the *examples* for integration-specific frequently requested properties. - */ - async configure( - request: operations.ConfigureSupplementalDataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(supplementalDataConfigure( - this, - request, - options, - )); - } - - /** - * Get configuration - * - * @remarks - * The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. - * - * [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. - */ - async getConfiguration( - request: operations.GetSupplementalDataConfigurationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(supplementalDataGetConfiguration( - this, - request, - options, - )); - } -} +export { SupplementalData } from "../apis/SupplementalData"; diff --git a/platform/src/sdk/types/async.ts b/platform/src/sdk/types/async.ts index 689dba5de..208661e87 100644 --- a/platform/src/sdk/types/async.ts +++ b/platform/src/sdk/types/async.ts @@ -1,68 +1,51 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; + | { status: "complete"; request: Request; response: Response } + | { status: "request-error"; request: Request; response?: undefined } + | { status: "invalid"; request?: undefined; response?: undefined }; -export class APIPromise implements Promise { - readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; +export class APIPromise { + private readonly inner: Promise; - readonly [Symbol.toStringTag] = "APIPromise"; + constructor(inner: Promise) { + this.inner = inner; + } - 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]); - } + then( + onfulfilled?: ((value: T) => R1 | PromiseLike) | null, + onrejected?: ((reason: unknown) => R2 | PromiseLike) | null, + ): Promise { + return this.inner.then(onfulfilled, onrejected); + } - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this.#promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } + catch(onrejected?: ((reason: unknown) => R | PromiseLike) | null): Promise { + return this.inner.catch(onrejected); + } - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this.#unwrapped.catch(onrejected); - } + finally(onfinally?: (() => void) | null): Promise { + return this.inner.then( + (value) => { + if (onfinally) { + onfinally(); + } + return value; + }, + (reason) => { + if (onfinally) { + onfinally(); + } + throw reason; + }, + ); + } - finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); - } + $inspect(): Promise { + return this.inner; + } - $inspect(): Promise<[T, APICall]> { - return this.#promise; - } + get [Symbol.toStringTag](): string { + return "APIPromise"; + } } diff --git a/platform/src/sdk/types/blobs.ts b/platform/src/sdk/types/blobs.ts deleted file mode 100644 index cce2892d4..000000000 --- a/platform/src/sdk/types/blobs.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export const blobLikeSchema: z.ZodType = z.custom< - Blob ->(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, -}); - -export function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const name = val[Symbol.toStringTag]; - if (typeof name !== "string") { - return false; - } - if (name !== "Blob" && name !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} diff --git a/platform/src/sdk/types/constdatetime.ts b/platform/src/sdk/types/constdatetime.ts deleted file mode 100644 index fe62144ea..000000000 --- a/platform/src/sdk/types/constdatetime.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function constDateTime( - val: string, -): z.ZodType { - return z.custom((v) => { - return ( - typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() - ); - }, `Value must be equivalent to ${val}`); -} diff --git a/platform/src/sdk/types/enums.ts b/platform/src/sdk/types/enums.ts deleted file mode 100644 index aba0ffd2a..000000000 --- a/platform/src/sdk/types/enums.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { Unrecognized, unrecognized } from "./unrecognized.js"; - -export type ClosedEnum>> = - T[keyof T]; -export type OpenEnum>> = - | T[keyof T] - | Unrecognized; - -export function inboundSchema>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - const options = Object.values(enumObj); - return z.union([ - ...options.map(x => z.literal(x)), - z.string().transform(x => unrecognized(x)), - ] as any); -} - -export function inboundSchemaInt>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - // For numeric enums, Object.values returns both numbers and string keys - const options = Object.values(enumObj).filter(v => typeof v === "number"); - return z.union([ - ...options.map(x => z.literal(x)), - z.number().int().transform(x => unrecognized(x)), - ] as any); -} - -export function outboundSchema>( - _: T, -): z.ZodType> { - return z.string() as any; -} - -export function outboundSchemaInt>( - _: T, -): z.ZodType> { - return z.number().int() as any; -} diff --git a/platform/src/sdk/types/fp.ts b/platform/src/sdk/types/fp.ts index ccbe51eac..84eb7e4f3 100644 --- a/platform/src/sdk/types/fp.ts +++ b/platform/src/sdk/types/fp.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * A monad that captures the result of a function call or an error if it was not - * successful. Railway programming, enabled by this type, can be a nicer - * alternative to traditional exception throwing because it allows functions to - * declare all _known_ errors with static types and then check for them - * exhaustively in application code. Thrown exception have a type of `unknown` - * and break out of regular control flow of programs making them harder to - * inspect and more verbose work with due to try-catch blocks. - */ -export type Result = - | { ok: true; value: T; error?: never } - | { ok: false; value?: never; error: E }; +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; -export function OK(value: V): Result { - return { ok: true, value }; +export function OK(value: T): Result { + return { ok: true, value }; } export function ERR(error: E): Result { - return { ok: false, error }; + return { ok: false, error }; } -/** - * unwrap is a convenience function for extracting a value from a result or - * throwing if there was an error. - */ export function unwrap(r: Result): T { - if (!r.ok) { + if (r.ok) { + return r.value; + } throw r.error; - } - return r.value; } -/** - * unwrapAsync is a convenience function for resolving a value from a Promise - * of a result or rejecting if an error occurred. - */ -export async function unwrapAsync( - pr: Promise>, -): Promise { - const r = await pr; - if (!r.ok) { - throw r.error; - } - - return r.value; +export async function unwrapAsync(pr: Promise>): Promise { + return unwrap(await pr); } diff --git a/platform/src/sdk/types/index.ts b/platform/src/sdk/types/index.ts index 8249564b4..2c21135cc 100644 --- a/platform/src/sdk/types/index.ts +++ b/platform/src/sdk/types/index.ts @@ -1,12 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export type { ClosedEnum, OpenEnum } from "./enums.js"; -export type { Result } from "./fp.js"; -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"; +export * from './rfcdate'; +export * from './async'; +export * from './fp'; +export * from './operations'; diff --git a/platform/src/sdk/types/operations.ts b/platform/src/sdk/types/operations.ts index beb81e10f..b6d42c45c 100644 --- a/platform/src/sdk/types/operations.ts +++ b/platform/src/sdk/types/operations.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ import { Result } from "./fp.js"; @@ -101,5 +100,3 @@ function unwrapPaginator( }); }; } - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/platform/src/sdk/types/rfcdate.ts b/platform/src/sdk/types/rfcdate.ts index c79b3f53a..03939e51e 100644 --- a/platform/src/sdk/types/rfcdate.ts +++ b/platform/src/sdk/types/rfcdate.ts @@ -1,54 +1,22 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; +/* tslint:disable */ +/* eslint-disable */ export class RFCDate { - private serialized: string; - - /** - * Creates a new RFCDate instance using today's date. - */ - static today(): RFCDate { - return new RFCDate(new Date()); - } + private date: string; - /** - * Creates a new RFCDate instance using the provided input. - * If a string is used then in must be in the format YYYY-MM-DD. - * - * @param date A Date object or a date string in YYYY-MM-DD format - * @example - * new RFCDate("2022-01-01") - * @example - * new RFCDate(new Date()) - */ - constructor(date: Date | string) { - if (typeof date === "string" && !dateRE.test(date)) { - throw new RangeError( - "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, - ); + constructor(date: Date | string) { + this.date = date instanceof Date ? date.toISOString().slice(0, 10) : date; } - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + date); + static today(): RFCDate { + return new RFCDate(new Date()); } - this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); - if (!dateRE.test(this.serialized)) { - throw new TypeError( - `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, - ); + toJSON(): string { + return this.date; } - } - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } + toString(): string { + return this.date; + } } diff --git a/platform/src/sdk/types/streams.ts b/platform/src/sdk/types/streams.ts deleted file mode 100644 index a0163e7a9..000000000 --- a/platform/src/sdk/types/streams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -} diff --git a/platform/src/sdk/types/unrecognized.ts b/platform/src/sdk/types/unrecognized.ts deleted file mode 100644 index b7a2a13f3..000000000 --- a/platform/src/sdk/types/unrecognized.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -declare const __brand: unique symbol; -export type Unrecognized = T & { [__brand]: "unrecognized" }; - -function unrecognized(value: T): Unrecognized { - globalCount++; - return value as Unrecognized; -} - -let globalCount = 0; -let refCount = 0; -export function startCountingUnrecognized() { - refCount++; - const start = globalCount; - return { - /** - * Ends counting and returns the delta. - * @param delta - If provided, only this amount is added to the parent counter - * (used for nested unions where we only want to record the winning option's count). - * If not provided, records all counts since start(). - */ - end: (delta?: number) => { - const count = globalCount - start; - // Reset globalCount back to start, then add only the specified delta - globalCount = start + (delta ?? count); - if (--refCount === 0) globalCount = 0; - return count; - }, - }; -} - -export { unrecognized }; 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; -}; diff --git a/platform/src/sdk/webhooks.ts b/platform/src/sdk/webhooks.ts index ec04917d0..432797e2f 100644 --- a/platform/src/sdk/webhooks.ts +++ b/platform/src/sdk/webhooks.ts @@ -1,71 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { webhooksCreateConsumer } from "../funcs/webhooksCreateConsumer.js"; -import { webhooksDeleteConsumer } from "../funcs/webhooksDeleteConsumer.js"; -import { webhooksListConsumers } from "../funcs/webhooksListConsumers.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Webhooks extends ClientSDK { - /** - * List webhook consumers - * - * @remarks - * Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - */ - async listConsumers( - options?: RequestOptions, - ): Promise { - return unwrapAsync(webhooksListConsumers( - this, - options, - )); - } - - /** - * Create webhook consumer - * - * @remarks - * Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - * - * ### Tips and traps - * - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. - */ - async createConsumer( - request?: shared.WebhookConsumerPrototype | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(webhooksCreateConsumer( - this, - request, - options, - )); - } - - /** - * Delete webhook consumer - * - * @remarks - * Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. - * - * [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). - */ - async deleteConsumer( - request: operations.DeleteWebhookConsumerRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(webhooksDeleteConsumer( - this, - request, - options, - )); - } -} +export { Webhooks } from "../apis/Webhooks"; diff --git a/platform/tsconfig.esm.json b/platform/tsconfig.esm.json new file mode 100644 index 000000000..b98a6d38d --- /dev/null +++ b/platform/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "include": ["src"], + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/platform/tsconfig.json b/platform/tsconfig.json index 76110f883..ffd54239f 100644 --- a/platform/tsconfig.json +++ b/platform/tsconfig.json @@ -1,41 +1,17 @@ { + "include": ["src"], "compilerOptions": { - "incremental": false, - "target": "ES2020", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "jsx": "react-jsx", - - "module": "Node16", - "moduleResolution": "Node16", - - "allowJs": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "rootDir": "src", - "outDir": ".", - - - // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json - "strict": true, - "allowUnusedLabels": false, - "allowUnreachableCode": false, - "exactOptionalPropertyTypes": true, - "useUnknownInCatchVariables": true, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": true, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "isolatedModules": true, - "checkJs": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "target": "es2018", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, - "include": ["src"], - "exclude": ["node_modules", "src/__tests__"] + "exclude": [ + "dist", + "node_modules" + ] }