@orq-ai/node 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +556 -0
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/contacts/README.md +84 -0
- package/docs/sdks/deployments/README.md +314 -0
- package/docs/sdks/feedback/README.md +92 -0
- package/docs/sdks/files/README.md +171 -0
- package/docs/sdks/metrics/README.md +86 -0
- package/docs/sdks/orq/README.md +10 -0
- package/docs/sdks/prompt/README.md +6 -0
- package/docs/sdks/prompts/README.md +533 -0
- package/docs/sdks/remoteconfig/README.md +80 -0
- package/docs/sdks/snippets/README.md +84 -0
- package/docs/sdks/templates/README.md +80 -0
- package/funcs/contactsCreate.d.ts +15 -0
- package/funcs/contactsCreate.d.ts.map +1 -0
- package/funcs/contactsCreate.js +105 -0
- package/funcs/contactsCreate.js.map +1 -0
- package/funcs/deploymentsAll.d.ts +16 -0
- package/funcs/deploymentsAll.d.ts.map +1 -0
- package/funcs/deploymentsAll.js +113 -0
- package/funcs/deploymentsAll.js.map +1 -0
- package/funcs/deploymentsGetConfig.d.ts +15 -0
- package/funcs/deploymentsGetConfig.d.ts.map +1 -0
- package/funcs/deploymentsGetConfig.js +105 -0
- package/funcs/deploymentsGetConfig.js.map +1 -0
- package/funcs/deploymentsInvalidate.d.ts +15 -0
- package/funcs/deploymentsInvalidate.d.ts.map +1 -0
- package/funcs/deploymentsInvalidate.js +111 -0
- package/funcs/deploymentsInvalidate.js.map +1 -0
- package/funcs/deploymentsInvoke.d.ts +22 -0
- package/funcs/deploymentsInvoke.d.ts.map +1 -0
- package/funcs/deploymentsInvoke.js +115 -0
- package/funcs/deploymentsInvoke.js.map +1 -0
- package/funcs/deploymentsMetricsCreate.d.ts +15 -0
- package/funcs/deploymentsMetricsCreate.d.ts.map +1 -0
- package/funcs/deploymentsMetricsCreate.js +111 -0
- package/funcs/deploymentsMetricsCreate.js.map +1 -0
- package/funcs/feedbackCreate.d.ts +15 -0
- package/funcs/feedbackCreate.d.ts.map +1 -0
- package/funcs/feedbackCreate.js +105 -0
- package/funcs/feedbackCreate.js.map +1 -0
- package/funcs/filesBulkUpload.d.ts +15 -0
- package/funcs/filesBulkUpload.d.ts.map +1 -0
- package/funcs/filesBulkUpload.js +106 -0
- package/funcs/filesBulkUpload.js.map +1 -0
- package/funcs/filesUpload.d.ts +15 -0
- package/funcs/filesUpload.d.ts.map +1 -0
- package/funcs/filesUpload.js +122 -0
- package/funcs/filesUpload.js.map +1 -0
- package/funcs/promptSnippetsFindOne.d.ts +12 -0
- package/funcs/promptSnippetsFindOne.d.ts.map +1 -0
- package/funcs/promptSnippetsFindOne.js +107 -0
- package/funcs/promptSnippetsFindOne.js.map +1 -0
- package/funcs/promptTemplatesGetAll.d.ts +12 -0
- package/funcs/promptTemplatesGetAll.d.ts.map +1 -0
- package/funcs/promptTemplatesGetAll.js +107 -0
- package/funcs/promptTemplatesGetAll.js.map +1 -0
- package/funcs/promptsCreate.d.ts +12 -0
- package/funcs/promptsCreate.d.ts.map +1 -0
- package/funcs/promptsCreate.js +104 -0
- package/funcs/promptsCreate.js.map +1 -0
- package/funcs/promptsCreateVersion.d.ts +12 -0
- package/funcs/promptsCreateVersion.d.ts.map +1 -0
- package/funcs/promptsCreateVersion.js +108 -0
- package/funcs/promptsCreateVersion.js.map +1 -0
- package/funcs/promptsDelete.d.ts +12 -0
- package/funcs/promptsDelete.d.ts.map +1 -0
- package/funcs/promptsDelete.js +108 -0
- package/funcs/promptsDelete.js.map +1 -0
- package/funcs/promptsDuplicate.d.ts +12 -0
- package/funcs/promptsDuplicate.d.ts.map +1 -0
- package/funcs/promptsDuplicate.js +108 -0
- package/funcs/promptsDuplicate.js.map +1 -0
- package/funcs/promptsGetAll.d.ts +12 -0
- package/funcs/promptsGetAll.d.ts.map +1 -0
- package/funcs/promptsGetAll.js +107 -0
- package/funcs/promptsGetAll.js.map +1 -0
- package/funcs/promptsGetOne.d.ts +12 -0
- package/funcs/promptsGetOne.d.ts.map +1 -0
- package/funcs/promptsGetOne.js +108 -0
- package/funcs/promptsGetOne.js.map +1 -0
- package/funcs/promptsUpdate.d.ts +13 -0
- package/funcs/promptsUpdate.d.ts.map +1 -0
- package/funcs/promptsUpdate.js +112 -0
- package/funcs/promptsUpdate.js.map +1 -0
- package/funcs/remoteconfigGetConfig.d.ts +12 -0
- package/funcs/remoteconfigGetConfig.d.ts.map +1 -0
- package/funcs/remoteconfigGetConfig.js +105 -0
- package/funcs/remoteconfigGetConfig.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +68 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/registration.d.ts +3 -0
- package/hooks/registration.d.ts.map +1 -0
- package/hooks/registration.js +15 -0
- package/hooks/registration.js.map +1 -0
- package/hooks/types.d.ts +76 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +46 -0
- package/index.js.map +1 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +71 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +34 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +36 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +51 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +343 -0
- package/lib/encodings.js.map +1 -0
- package/lib/env.d.ts +15 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +66 -0
- package/lib/env.js.map +1 -0
- package/lib/event-streams.d.ts +17 -0
- package/lib/event-streams.d.ts.map +1 -0
- package/lib/event-streams.js +221 -0
- package/lib/event-streams.js.map +1 -0
- package/lib/files.d.ts +8 -0
- package/lib/files.d.ts.map +1 -0
- package/lib/files.js +36 -0
- package/lib/files.js.map +1 -0
- package/lib/http.d.ts +67 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +218 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/logger.d.ts +6 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +6 -0
- package/lib/logger.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +208 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +22 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +94 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +38 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +155 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +19 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +59 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +56 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +277 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +82 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +140 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/deployments.d.ts +890 -0
- package/models/components/deployments.d.ts.map +1 -0
- package/models/components/deployments.js +918 -0
- package/models/components/deployments.js.map +1 -0
- package/models/components/index.d.ts +3 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +22 -0
- package/models/components/index.js.map +1 -0
- package/models/components/security.d.ts +29 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +78 -0
- package/models/components/security.js.map +1 -0
- package/models/errors/apierror.d.ts +8 -0
- package/models/errors/apierror.d.ts.map +1 -0
- package/models/errors/apierror.js +21 -0
- package/models/errors/apierror.js.map +1 -0
- package/models/errors/honoapierror.d.ts +42 -0
- package/models/errors/honoapierror.d.ts.map +1 -0
- package/models/errors/honoapierror.js +80 -0
- package/models/errors/honoapierror.js.map +1 -0
- package/models/errors/httpclienterrors.d.ts +44 -0
- package/models/errors/httpclienterrors.d.ts.map +1 -0
- package/models/errors/httpclienterrors.js +78 -0
- package/models/errors/httpclienterrors.js.map +1 -0
- package/models/errors/index.d.ts +6 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +25 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +20 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +115 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/models/errors/updateprompt.d.ts +36 -0
- package/models/errors/updateprompt.d.ts.map +1 -0
- package/models/errors/updateprompt.js +79 -0
- package/models/errors/updateprompt.js.map +1 -0
- package/models/operations/bulkfileupload.d.ts +162 -0
- package/models/operations/bulkfileupload.d.ts.map +1 -0
- package/models/operations/bulkfileupload.js +204 -0
- package/models/operations/bulkfileupload.js.map +1 -0
- package/models/operations/createcontact.d.ts +139 -0
- package/models/operations/createcontact.d.ts.map +1 -0
- package/models/operations/createcontact.js +149 -0
- package/models/operations/createcontact.js.map +1 -0
- package/models/operations/createfeedback.d.ts +136 -0
- package/models/operations/createfeedback.d.ts.map +1 -0
- package/models/operations/createfeedback.js +172 -0
- package/models/operations/createfeedback.js.map +1 -0
- package/models/operations/createprompt.d.ts +2023 -0
- package/models/operations/createprompt.d.ts.map +1 -0
- package/models/operations/createprompt.js +1849 -0
- package/models/operations/createprompt.js.map +1 -0
- package/models/operations/createpromptversion.d.ts +1989 -0
- package/models/operations/createpromptversion.d.ts.map +1 -0
- package/models/operations/createpromptversion.js +1844 -0
- package/models/operations/createpromptversion.js.map +1 -0
- package/models/operations/deleteprompt.d.ts +32 -0
- package/models/operations/deleteprompt.d.ts.map +1 -0
- package/models/operations/deleteprompt.js +69 -0
- package/models/operations/deleteprompt.js.map +1 -0
- package/models/operations/deploymentcreatemetric.d.ts +957 -0
- package/models/operations/deploymentcreatemetric.d.ts.map +1 -0
- package/models/operations/deploymentcreatemetric.js +954 -0
- package/models/operations/deploymentcreatemetric.js.map +1 -0
- package/models/operations/deploymentgetconfig.d.ts +1852 -0
- package/models/operations/deploymentgetconfig.d.ts.map +1 -0
- package/models/operations/deploymentgetconfig.js +1751 -0
- package/models/operations/deploymentgetconfig.js.map +1 -0
- package/models/operations/deploymentinvoke.d.ts +1344 -0
- package/models/operations/deploymentinvoke.d.ts.map +1 -0
- package/models/operations/deploymentinvoke.js +1208 -0
- package/models/operations/deploymentinvoke.js.map +1 -0
- package/models/operations/deployments.d.ts +1223 -0
- package/models/operations/deployments.d.ts.map +1 -0
- package/models/operations/deployments.js +1101 -0
- package/models/operations/deployments.js.map +1 -0
- package/models/operations/duplicateprompt.d.ts +32 -0
- package/models/operations/duplicateprompt.d.ts.map +1 -0
- package/models/operations/duplicateprompt.js +69 -0
- package/models/operations/duplicateprompt.js.map +1 -0
- package/models/operations/fileupload.d.ts +168 -0
- package/models/operations/fileupload.d.ts.map +1 -0
- package/models/operations/fileupload.js +206 -0
- package/models/operations/fileupload.js.map +1 -0
- package/models/operations/findonepromptsnippet.d.ts +6242 -0
- package/models/operations/findonepromptsnippet.d.ts.map +1 -0
- package/models/operations/findonepromptsnippet.js +5879 -0
- package/models/operations/findonepromptsnippet.js.map +1 -0
- package/models/operations/getallprompts.d.ts +6577 -0
- package/models/operations/getallprompts.d.ts.map +1 -0
- package/models/operations/getallprompts.js +6149 -0
- package/models/operations/getallprompts.js.map +1 -0
- package/models/operations/getallprompttemplates.d.ts +6571 -0
- package/models/operations/getallprompttemplates.d.ts.map +1 -0
- package/models/operations/getallprompttemplates.js +6213 -0
- package/models/operations/getallprompttemplates.js.map +1 -0
- package/models/operations/getoneprompt.d.ts +32 -0
- package/models/operations/getoneprompt.d.ts.map +1 -0
- package/models/operations/getoneprompt.js +69 -0
- package/models/operations/getoneprompt.js.map +1 -0
- package/models/operations/index.d.ts +20 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +39 -0
- package/models/operations/index.js.map +1 -0
- package/models/operations/invaliddeployment.d.ts +29 -0
- package/models/operations/invaliddeployment.d.ts.map +1 -0
- package/models/operations/invaliddeployment.js +78 -0
- package/models/operations/invaliddeployment.js.map +1 -0
- package/models/operations/remoteconfigsgetconfig.d.ts +121 -0
- package/models/operations/remoteconfigsgetconfig.d.ts.map +1 -0
- package/models/operations/remoteconfigsgetconfig.js +126 -0
- package/models/operations/remoteconfigsgetconfig.js.map +1 -0
- package/models/operations/updateprompt.d.ts +7209 -0
- package/models/operations/updateprompt.d.ts.map +1 -0
- package/models/operations/updateprompt.js +6664 -0
- package/models/operations/updateprompt.js.map +1 -0
- package/package.json +33 -0
- package/sdk/contacts.d.ts +12 -0
- package/sdk/contacts.d.ts.map +1 -0
- package/sdk/contacts.js +22 -0
- package/sdk/contacts.js.map +1 -0
- package/sdk/deployments.d.ts +41 -0
- package/sdk/deployments.d.ts.map +1 -0
- package/sdk/deployments.js +59 -0
- package/sdk/deployments.js.map +1 -0
- package/sdk/feedback.d.ts +12 -0
- package/sdk/feedback.d.ts.map +1 -0
- package/sdk/feedback.js +22 -0
- package/sdk/feedback.js.map +1 -0
- package/sdk/files.d.ts +19 -0
- package/sdk/files.d.ts.map +1 -0
- package/sdk/files.js +32 -0
- package/sdk/files.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/metrics.d.ts +12 -0
- package/sdk/metrics.d.ts.map +1 -0
- package/sdk/metrics.js +22 -0
- package/sdk/metrics.js.map +1 -0
- package/sdk/prompt.d.ts +10 -0
- package/sdk/prompt.d.ts.map +1 -0
- package/sdk/prompt.js +21 -0
- package/sdk/prompt.js.map +1 -0
- package/sdk/prompts.d.ts +33 -0
- package/sdk/prompts.d.ts.map +1 -0
- package/sdk/prompts.js +61 -0
- package/sdk/prompts.js.map +1 -0
- package/sdk/remoteconfig.d.ts +9 -0
- package/sdk/remoteconfig.d.ts.map +1 -0
- package/sdk/remoteconfig.js +19 -0
- package/sdk/remoteconfig.js.map +1 -0
- package/sdk/sdk.d.ts +25 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +46 -0
- package/sdk/sdk.js.map +1 -0
- package/sdk/snippets.d.ts +9 -0
- package/sdk/snippets.d.ts.map +1 -0
- package/sdk/snippets.js +19 -0
- package/sdk/snippets.js.map +1 -0
- package/sdk/templates.d.ts +9 -0
- package/sdk/templates.d.ts.map +1 -0
- package/sdk/templates.js +19 -0
- package/sdk/templates.js.map +1 -0
- package/src/core.ts +13 -0
- package/src/funcs/contactsCreate.ts +123 -0
- package/src/funcs/deploymentsAll.ts +137 -0
- package/src/funcs/deploymentsGetConfig.ts +131 -0
- package/src/funcs/deploymentsInvalidate.ts +132 -0
- package/src/funcs/deploymentsInvoke.ts +134 -0
- package/src/funcs/deploymentsMetricsCreate.ts +131 -0
- package/src/funcs/feedbackCreate.ts +123 -0
- package/src/funcs/filesBulkUpload.ts +125 -0
- package/src/funcs/filesUpload.ts +144 -0
- package/src/funcs/promptSnippetsFindOne.ts +127 -0
- package/src/funcs/promptTemplatesGetAll.ts +129 -0
- package/src/funcs/promptsCreate.ts +123 -0
- package/src/funcs/promptsCreateVersion.ts +128 -0
- package/src/funcs/promptsDelete.ts +127 -0
- package/src/funcs/promptsDuplicate.ts +127 -0
- package/src/funcs/promptsGetAll.ts +127 -0
- package/src/funcs/promptsGetOne.ts +127 -0
- package/src/funcs/promptsUpdate.ts +135 -0
- package/src/funcs/remoteconfigGetConfig.ts +124 -0
- package/src/hooks/hooks.ts +112 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +102 -0
- package/src/index.ts +7 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +60 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +449 -0
- package/src/lib/env.ts +41 -0
- package/src/lib/event-streams.ts +264 -0
- package/src/lib/files.ts +40 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +325 -0
- package/src/lib/primitives.ts +122 -0
- package/src/lib/retries.ts +219 -0
- package/src/lib/schemas.ts +86 -0
- package/src/lib/sdks.ts +392 -0
- package/src/lib/security.ts +254 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/deployments.ts +1607 -0
- package/src/models/components/index.ts +6 -0
- package/src/models/components/security.ts +71 -0
- package/src/models/errors/apierror.ts +27 -0
- package/src/models/errors/honoapierror.ts +82 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +9 -0
- package/src/models/errors/sdkvalidationerror.ts +97 -0
- package/src/models/errors/updateprompt.ts +71 -0
- package/src/models/operations/bulkfileupload.ts +304 -0
- package/src/models/operations/createcontact.ts +256 -0
- package/src/models/operations/createfeedback.ts +286 -0
- package/src/models/operations/createprompt.ts +3451 -0
- package/src/models/operations/createpromptversion.ts +3693 -0
- package/src/models/operations/deleteprompt.ts +69 -0
- package/src/models/operations/deploymentcreatemetric.ts +1790 -0
- package/src/models/operations/deploymentgetconfig.ts +3416 -0
- package/src/models/operations/deploymentinvoke.ts +2383 -0
- package/src/models/operations/deployments.ts +2084 -0
- package/src/models/operations/duplicateprompt.ts +69 -0
- package/src/models/operations/fileupload.ts +311 -0
- package/src/models/operations/findonepromptsnippet.ts +13617 -0
- package/src/models/operations/getallprompts.ts +13378 -0
- package/src/models/operations/getallprompttemplates.ts +13678 -0
- package/src/models/operations/getoneprompt.ts +69 -0
- package/src/models/operations/index.ts +23 -0
- package/src/models/operations/invaliddeployment.ts +75 -0
- package/src/models/operations/remoteconfigsgetconfig.ts +190 -0
- package/src/models/operations/updateprompt.ts +14393 -0
- package/src/sdk/contacts.ts +27 -0
- package/src/sdk/deployments.ts +93 -0
- package/src/sdk/feedback.ts +27 -0
- package/src/sdk/files.ts +45 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/metrics.ts +27 -0
- package/src/sdk/prompt.ts +19 -0
- package/src/sdk/prompts.ts +114 -0
- package/src/sdk/remoteconfig.ts +24 -0
- package/src/sdk/sdk.ts +49 -0
- package/src/sdk/snippets.ts +24 -0
- package/src/sdk/templates.ts +24 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/constdatetime.ts +15 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +105 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/streams.ts +21 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +62 -0
- package/types/blobs.js.map +1 -0
- package/types/constdatetime.d.ts +3 -0
- package/types/constdatetime.d.ts.map +1 -0
- package/types/constdatetime.js +46 -0
- package/types/constdatetime.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/fp.d.ts +31 -0
- package/types/fp.d.ts.map +1 -0
- package/types/fp.js +37 -0
- package/types/fp.js.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +27 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +83 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
- package/types/streams.d.ts +2 -0
- package/types/streams.d.ts.map +1 -0
- package/types/streams.js +18 -0
- package/types/streams.js.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
# @orq-ai/node
|
|
2
|
+
|
|
3
|
+
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@orq-ai/node* API.
|
|
4
|
+
|
|
5
|
+
<div align="left">
|
|
6
|
+
<a href="https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
|
|
7
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
8
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
|
|
9
|
+
</a>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<br /><br />
|
|
14
|
+
> [!IMPORTANT]
|
|
15
|
+
> This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/orq/orq). Delete this section before > publishing to a package manager.
|
|
16
|
+
|
|
17
|
+
<!-- Start Summary [summary] -->
|
|
18
|
+
## Summary
|
|
19
|
+
|
|
20
|
+
[Dev] orq.ai API: The Orquesta API
|
|
21
|
+
|
|
22
|
+
For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
|
|
23
|
+
<!-- End Summary [summary] -->
|
|
24
|
+
|
|
25
|
+
<!-- Start Table of Contents [toc] -->
|
|
26
|
+
## Table of Contents
|
|
27
|
+
<!-- $toc-max-depth=2 -->
|
|
28
|
+
* [@orq-ai/node](#orq-ainode)
|
|
29
|
+
* [SDK Installation](#sdk-installation)
|
|
30
|
+
* [Requirements](#requirements)
|
|
31
|
+
* [SDK Example Usage](#sdk-example-usage)
|
|
32
|
+
* [Authentication](#authentication)
|
|
33
|
+
* [Available Resources and Operations](#available-resources-and-operations)
|
|
34
|
+
* [Standalone functions](#standalone-functions)
|
|
35
|
+
* [Server-sent event streaming](#server-sent-event-streaming)
|
|
36
|
+
* [File uploads](#file-uploads)
|
|
37
|
+
* [Retries](#retries)
|
|
38
|
+
* [Error Handling](#error-handling)
|
|
39
|
+
* [Server Selection](#server-selection)
|
|
40
|
+
* [Custom HTTP Client](#custom-http-client)
|
|
41
|
+
* [Debugging](#debugging)
|
|
42
|
+
* [Development](#development)
|
|
43
|
+
* [Maturity](#maturity)
|
|
44
|
+
* [Contributions](#contributions)
|
|
45
|
+
|
|
46
|
+
<!-- End Table of Contents [toc] -->
|
|
47
|
+
|
|
48
|
+
<!-- Start SDK Installation [installation] -->
|
|
49
|
+
## SDK Installation
|
|
50
|
+
|
|
51
|
+
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
52
|
+
|
|
53
|
+
### NPM
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm add @orq-ai/node
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### PNPM
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm add @orq-ai/node
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Bun
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bun add @orq-ai/node
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Yarn
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
yarn add @orq-ai/node zod
|
|
75
|
+
|
|
76
|
+
# Note that Yarn does not install peer dependencies automatically. You will need
|
|
77
|
+
# to install zod as shown above.
|
|
78
|
+
```
|
|
79
|
+
<!-- End SDK Installation [installation] -->
|
|
80
|
+
|
|
81
|
+
<!-- Start Requirements [requirements] -->
|
|
82
|
+
## Requirements
|
|
83
|
+
|
|
84
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
85
|
+
<!-- End Requirements [requirements] -->
|
|
86
|
+
|
|
87
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
88
|
+
## SDK Example Usage
|
|
89
|
+
|
|
90
|
+
### Example
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { Orq } from "@orq-ai/node";
|
|
94
|
+
|
|
95
|
+
const orq = new Orq({
|
|
96
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
async function run() {
|
|
100
|
+
const result = await orq.contacts.create({
|
|
101
|
+
externalId: "<id>",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Handle the result
|
|
105
|
+
console.log(result);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
run();
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
<!-- End SDK Example Usage [usage] -->
|
|
112
|
+
|
|
113
|
+
<!-- Start Authentication [security] -->
|
|
114
|
+
## Authentication
|
|
115
|
+
|
|
116
|
+
### Per-Client Security Schemes
|
|
117
|
+
|
|
118
|
+
This SDK supports the following security scheme globally:
|
|
119
|
+
|
|
120
|
+
| Name | Type | Scheme | Environment Variable |
|
|
121
|
+
| -------- | ---- | ----------- | -------------------- |
|
|
122
|
+
| `apiKey` | http | HTTP Bearer | `ORQ_API_KEY` |
|
|
123
|
+
|
|
124
|
+
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
|
|
125
|
+
```typescript
|
|
126
|
+
import { Orq } from "@orq-ai/node";
|
|
127
|
+
|
|
128
|
+
const orq = new Orq({
|
|
129
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
async function run() {
|
|
133
|
+
const result = await orq.contacts.create({
|
|
134
|
+
externalId: "<id>",
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Handle the result
|
|
138
|
+
console.log(result);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
run();
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
<!-- End Authentication [security] -->
|
|
145
|
+
|
|
146
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
147
|
+
## Available Resources and Operations
|
|
148
|
+
|
|
149
|
+
<details open>
|
|
150
|
+
<summary>Available methods</summary>
|
|
151
|
+
|
|
152
|
+
### [contacts](docs/sdks/contacts/README.md)
|
|
153
|
+
|
|
154
|
+
* [create](docs/sdks/contacts/README.md#create) - Update user information
|
|
155
|
+
|
|
156
|
+
### [deployments](docs/sdks/deployments/README.md)
|
|
157
|
+
|
|
158
|
+
* [all](docs/sdks/deployments/README.md#all) - List all deployments
|
|
159
|
+
* [invalidate](docs/sdks/deployments/README.md#invalidate) - Invalidates cache
|
|
160
|
+
* [getConfig](docs/sdks/deployments/README.md#getconfig) - Get config
|
|
161
|
+
* [invoke](docs/sdks/deployments/README.md#invoke) - Invoke
|
|
162
|
+
|
|
163
|
+
#### [deployments.metrics](docs/sdks/metrics/README.md)
|
|
164
|
+
|
|
165
|
+
* [create](docs/sdks/metrics/README.md#create) - Add metrics
|
|
166
|
+
|
|
167
|
+
### [feedback](docs/sdks/feedback/README.md)
|
|
168
|
+
|
|
169
|
+
* [create](docs/sdks/feedback/README.md#create) - Submit feedback
|
|
170
|
+
|
|
171
|
+
### [files](docs/sdks/files/README.md)
|
|
172
|
+
|
|
173
|
+
* [upload](docs/sdks/files/README.md#upload) - Upload file
|
|
174
|
+
* [bulkUpload](docs/sdks/files/README.md#bulkupload) - Bulk upload file
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
### [prompt](docs/sdks/prompt/README.md)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
#### [prompt.snippets](docs/sdks/snippets/README.md)
|
|
181
|
+
|
|
182
|
+
* [findOne](docs/sdks/snippets/README.md#findone) - Get one prompt snippet
|
|
183
|
+
|
|
184
|
+
#### [prompt.templates](docs/sdks/templates/README.md)
|
|
185
|
+
|
|
186
|
+
* [getAll](docs/sdks/templates/README.md#getall) - Get all prompt templates
|
|
187
|
+
|
|
188
|
+
### [prompts](docs/sdks/prompts/README.md)
|
|
189
|
+
|
|
190
|
+
* [create](docs/sdks/prompts/README.md#create) - Create a new prompt
|
|
191
|
+
* [createVersion](docs/sdks/prompts/README.md#createversion) - Create a new prompt version
|
|
192
|
+
* [delete](docs/sdks/prompts/README.md#delete) - Delete a prompt
|
|
193
|
+
* [getOne](docs/sdks/prompts/README.md#getone) - Get one prompt
|
|
194
|
+
* [update](docs/sdks/prompts/README.md#update) - Update a prompt
|
|
195
|
+
* [duplicate](docs/sdks/prompts/README.md#duplicate) - Duplicate a prompt
|
|
196
|
+
* [getAll](docs/sdks/prompts/README.md#getall) - Get all prompts
|
|
197
|
+
|
|
198
|
+
### [remoteconfig](docs/sdks/remoteconfig/README.md)
|
|
199
|
+
|
|
200
|
+
* [getConfig](docs/sdks/remoteconfig/README.md#getconfig) - Get Configurations
|
|
201
|
+
|
|
202
|
+
</details>
|
|
203
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
204
|
+
|
|
205
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
206
|
+
## Standalone functions
|
|
207
|
+
|
|
208
|
+
All the methods listed above are available as standalone functions. These
|
|
209
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
210
|
+
runtimes or other environments where application bundle size is a primary
|
|
211
|
+
concern. When using a bundler to build your application, all unused
|
|
212
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
213
|
+
|
|
214
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
215
|
+
|
|
216
|
+
<details>
|
|
217
|
+
|
|
218
|
+
<summary>Available standalone functions</summary>
|
|
219
|
+
|
|
220
|
+
- [`contactsCreate`](docs/sdks/contacts/README.md#create) - Update user information
|
|
221
|
+
- [`deploymentsAll`](docs/sdks/deployments/README.md#all) - List all deployments
|
|
222
|
+
- [`deploymentsGetConfig`](docs/sdks/deployments/README.md#getconfig) - Get config
|
|
223
|
+
- [`deploymentsInvalidate`](docs/sdks/deployments/README.md#invalidate) - Invalidates cache
|
|
224
|
+
- [`deploymentsInvoke`](docs/sdks/deployments/README.md#invoke) - Invoke
|
|
225
|
+
- [`deploymentsMetricsCreate`](docs/sdks/metrics/README.md#create) - Add metrics
|
|
226
|
+
- [`feedbackCreate`](docs/sdks/feedback/README.md#create) - Submit feedback
|
|
227
|
+
- [`filesBulkUpload`](docs/sdks/files/README.md#bulkupload) - Bulk upload file
|
|
228
|
+
- [`filesUpload`](docs/sdks/files/README.md#upload) - Upload file
|
|
229
|
+
- [`promptsCreate`](docs/sdks/prompts/README.md#create) - Create a new prompt
|
|
230
|
+
- [`promptsCreateVersion`](docs/sdks/prompts/README.md#createversion) - Create a new prompt version
|
|
231
|
+
- [`promptsDelete`](docs/sdks/prompts/README.md#delete) - Delete a prompt
|
|
232
|
+
- [`promptsDuplicate`](docs/sdks/prompts/README.md#duplicate) - Duplicate a prompt
|
|
233
|
+
- [`promptsGetAll`](docs/sdks/prompts/README.md#getall) - Get all prompts
|
|
234
|
+
- [`promptsGetOne`](docs/sdks/prompts/README.md#getone) - Get one prompt
|
|
235
|
+
- [`promptSnippetsFindOne`](docs/sdks/snippets/README.md#findone) - Get one prompt snippet
|
|
236
|
+
- [`promptsUpdate`](docs/sdks/prompts/README.md#update) - Update a prompt
|
|
237
|
+
- [`promptTemplatesGetAll`](docs/sdks/templates/README.md#getall) - Get all prompt templates
|
|
238
|
+
- [`remoteconfigGetConfig`](docs/sdks/remoteconfig/README.md#getconfig) - Get Configurations
|
|
239
|
+
|
|
240
|
+
</details>
|
|
241
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
242
|
+
|
|
243
|
+
<!-- Start Server-sent event streaming [eventstream] -->
|
|
244
|
+
## Server-sent event streaming
|
|
245
|
+
|
|
246
|
+
[Server-sent events][mdn-sse] are used to stream content from certain
|
|
247
|
+
operations. These operations will expose the stream as an async iterable that
|
|
248
|
+
can be consumed using a [`for await...of`][mdn-for-await-of] loop. The loop will
|
|
249
|
+
terminate when the server no longer has any events to send and closes the
|
|
250
|
+
underlying connection.
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
import { Orq } from "@orq-ai/node";
|
|
254
|
+
|
|
255
|
+
const orq = new Orq({
|
|
256
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
async function run() {
|
|
260
|
+
const result = await orq.deployments.invoke({
|
|
261
|
+
key: "<key>",
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
for await (const event of result) {
|
|
265
|
+
// Handle the event
|
|
266
|
+
console.log(event);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
run();
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
|
|
275
|
+
[mdn-for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
276
|
+
<!-- End Server-sent event streaming [eventstream] -->
|
|
277
|
+
|
|
278
|
+
<!-- Start File uploads [file-upload] -->
|
|
279
|
+
## File uploads
|
|
280
|
+
|
|
281
|
+
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
|
282
|
+
|
|
283
|
+
> [!TIP]
|
|
284
|
+
>
|
|
285
|
+
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
|
|
286
|
+
>
|
|
287
|
+
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
|
|
288
|
+
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
|
|
289
|
+
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
|
|
290
|
+
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import { Orq } from "@orq-ai/node";
|
|
294
|
+
|
|
295
|
+
const orq = new Orq({
|
|
296
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
async function run() {
|
|
300
|
+
const result = await orq.files.upload();
|
|
301
|
+
|
|
302
|
+
// Handle the result
|
|
303
|
+
console.log(result);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
run();
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
<!-- End File uploads [file-upload] -->
|
|
310
|
+
|
|
311
|
+
<!-- Start Retries [retries] -->
|
|
312
|
+
## Retries
|
|
313
|
+
|
|
314
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
315
|
+
|
|
316
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
317
|
+
```typescript
|
|
318
|
+
import { Orq } from "@orq-ai/node";
|
|
319
|
+
|
|
320
|
+
const orq = new Orq({
|
|
321
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
async function run() {
|
|
325
|
+
const result = await orq.contacts.create({
|
|
326
|
+
externalId: "<id>",
|
|
327
|
+
}, {
|
|
328
|
+
retries: {
|
|
329
|
+
strategy: "backoff",
|
|
330
|
+
backoff: {
|
|
331
|
+
initialInterval: 1,
|
|
332
|
+
maxInterval: 50,
|
|
333
|
+
exponent: 1.1,
|
|
334
|
+
maxElapsedTime: 100,
|
|
335
|
+
},
|
|
336
|
+
retryConnectionErrors: false,
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
// Handle the result
|
|
341
|
+
console.log(result);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
run();
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
349
|
+
```typescript
|
|
350
|
+
import { Orq } from "@orq-ai/node";
|
|
351
|
+
|
|
352
|
+
const orq = new Orq({
|
|
353
|
+
retryConfig: {
|
|
354
|
+
strategy: "backoff",
|
|
355
|
+
backoff: {
|
|
356
|
+
initialInterval: 1,
|
|
357
|
+
maxInterval: 50,
|
|
358
|
+
exponent: 1.1,
|
|
359
|
+
maxElapsedTime: 100,
|
|
360
|
+
},
|
|
361
|
+
retryConnectionErrors: false,
|
|
362
|
+
},
|
|
363
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
async function run() {
|
|
367
|
+
const result = await orq.contacts.create({
|
|
368
|
+
externalId: "<id>",
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// Handle the result
|
|
372
|
+
console.log(result);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
run();
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
<!-- End Retries [retries] -->
|
|
379
|
+
|
|
380
|
+
<!-- Start Error Handling [errors] -->
|
|
381
|
+
## Error Handling
|
|
382
|
+
|
|
383
|
+
All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.APIError`.
|
|
384
|
+
|
|
385
|
+
If a HTTP request fails, an operation my also throw an error from the `models/errors/httpclienterrors.ts` module:
|
|
386
|
+
|
|
387
|
+
| HTTP Client Error | Description |
|
|
388
|
+
| ---------------------------------------------------- | ---------------------------------------------------- |
|
|
389
|
+
| RequestAbortedError | HTTP request was aborted by the client |
|
|
390
|
+
| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal |
|
|
391
|
+
| ConnectionError | HTTP client was unable to make a request to a server |
|
|
392
|
+
| InvalidRequestError | Any input used to create a request is invalid |
|
|
393
|
+
| UnexpectedClientError | Unrecognised or unexpected error |
|
|
394
|
+
|
|
395
|
+
In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `all` method may throw the following errors:
|
|
396
|
+
|
|
397
|
+
| Error Type | Status Code | Content Type |
|
|
398
|
+
| ------------------- | ----------- | ---------------- |
|
|
399
|
+
| errors.HonoApiError | 500 | application/json |
|
|
400
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
import { Orq } from "@orq-ai/node";
|
|
404
|
+
import { HonoApiError, SDKValidationError } from "@orq-ai/node/models/errors";
|
|
405
|
+
|
|
406
|
+
const orq = new Orq({
|
|
407
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
async function run() {
|
|
411
|
+
let result;
|
|
412
|
+
try {
|
|
413
|
+
result = await orq.deployments.all();
|
|
414
|
+
|
|
415
|
+
// Handle the result
|
|
416
|
+
console.log(result);
|
|
417
|
+
} catch (err) {
|
|
418
|
+
switch (true) {
|
|
419
|
+
case (err instanceof SDKValidationError): {
|
|
420
|
+
// Validation errors can be pretty-printed
|
|
421
|
+
console.error(err.pretty());
|
|
422
|
+
// Raw value may also be inspected
|
|
423
|
+
console.error(err.rawValue);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
case (err instanceof HonoApiError): {
|
|
427
|
+
// Handle err.data$: HonoApiErrorData
|
|
428
|
+
console.error(err);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
default: {
|
|
432
|
+
throw err;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
run();
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
|
|
443
|
+
<!-- End Error Handling [errors] -->
|
|
444
|
+
|
|
445
|
+
<!-- Start Server Selection [server] -->
|
|
446
|
+
## Server Selection
|
|
447
|
+
|
|
448
|
+
### Override Server URL Per-Client
|
|
449
|
+
|
|
450
|
+
The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
|
|
451
|
+
```typescript
|
|
452
|
+
import { Orq } from "@orq-ai/node";
|
|
453
|
+
|
|
454
|
+
const orq = new Orq({
|
|
455
|
+
serverURL: "https://my.staging.orq.ai",
|
|
456
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
async function run() {
|
|
460
|
+
const result = await orq.contacts.create({
|
|
461
|
+
externalId: "<id>",
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
// Handle the result
|
|
465
|
+
console.log(result);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
run();
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
<!-- End Server Selection [server] -->
|
|
472
|
+
|
|
473
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
474
|
+
## Custom HTTP Client
|
|
475
|
+
|
|
476
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
477
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
478
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
479
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
480
|
+
errors and response.
|
|
481
|
+
|
|
482
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
483
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
484
|
+
the HTTP client and feed in fixtures.
|
|
485
|
+
|
|
486
|
+
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
487
|
+
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
488
|
+
to log errors:
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
import { Orq } from "@orq-ai/node";
|
|
492
|
+
import { HTTPClient } from "@orq-ai/node/lib/http";
|
|
493
|
+
|
|
494
|
+
const httpClient = new HTTPClient({
|
|
495
|
+
// fetcher takes a function that has the same signature as native `fetch`.
|
|
496
|
+
fetcher: (request) => {
|
|
497
|
+
return fetch(request);
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
502
|
+
const nextRequest = new Request(request, {
|
|
503
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
507
|
+
|
|
508
|
+
return nextRequest;
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
512
|
+
console.group("Request Error");
|
|
513
|
+
console.log("Reason:", `${error}`);
|
|
514
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
515
|
+
console.groupEnd();
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
const sdk = new Orq({ httpClient });
|
|
519
|
+
```
|
|
520
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
521
|
+
|
|
522
|
+
<!-- Start Debugging [debug] -->
|
|
523
|
+
## Debugging
|
|
524
|
+
|
|
525
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
526
|
+
|
|
527
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
528
|
+
|
|
529
|
+
> [!WARNING]
|
|
530
|
+
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
531
|
+
|
|
532
|
+
```typescript
|
|
533
|
+
import { Orq } from "@orq-ai/node";
|
|
534
|
+
|
|
535
|
+
const sdk = new Orq({ debugLogger: console });
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
You can also enable a default debug logger by setting an environment variable `ORQ_DEBUG` to true.
|
|
539
|
+
<!-- End Debugging [debug] -->
|
|
540
|
+
|
|
541
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
542
|
+
|
|
543
|
+
# Development
|
|
544
|
+
|
|
545
|
+
## Maturity
|
|
546
|
+
|
|
547
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
548
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
549
|
+
looking for the latest version.
|
|
550
|
+
|
|
551
|
+
## Contributions
|
|
552
|
+
|
|
553
|
+
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
|
|
554
|
+
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
|
|
555
|
+
|
|
556
|
+
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript)
|
package/core.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
2
|
+
/**
|
|
3
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
4
|
+
* instance of this class would be instantiated once at the start of an
|
|
5
|
+
* application and passed around through some dependency injection mechanism to
|
|
6
|
+
* parts of an application that need to make SDK calls.
|
|
7
|
+
*/
|
|
8
|
+
export declare class OrqCore extends ClientSDK {
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=core.d.ts.map
|
package/core.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,SAAS;CAAG"}
|
package/core.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OrqCore = void 0;
|
|
7
|
+
const sdks_js_1 = require("./lib/sdks.js");
|
|
8
|
+
/**
|
|
9
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
10
|
+
* instance of this class would be instantiated once at the start of an
|
|
11
|
+
* application and passed around through some dependency injection mechanism to
|
|
12
|
+
* parts of an application that need to make SDK calls.
|
|
13
|
+
*/
|
|
14
|
+
class OrqCore extends sdks_js_1.ClientSDK {
|
|
15
|
+
}
|
|
16
|
+
exports.OrqCore = OrqCore;
|
|
17
|
+
//# sourceMappingURL=core.js.map
|
package/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["src/core.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2CAA0C;AAE1C;;;;;GAKG;AACH,MAAa,OAAQ,SAAQ,mBAAS;CAAG;AAAzC,0BAAyC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contacts
|
|
2
|
+
(*contacts*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [create](#create) - Update user information
|
|
9
|
+
|
|
10
|
+
## create
|
|
11
|
+
|
|
12
|
+
Update or add user information to workspace
|
|
13
|
+
|
|
14
|
+
### Example Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { Orq } from "@orq-ai/node";
|
|
18
|
+
|
|
19
|
+
const orq = new Orq({
|
|
20
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
async function run() {
|
|
24
|
+
const result = await orq.contacts.create({
|
|
25
|
+
externalId: "<id>",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Handle the result
|
|
29
|
+
console.log(result);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
run();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Standalone function
|
|
36
|
+
|
|
37
|
+
The standalone function version of this method:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
41
|
+
import { contactsCreate } from "@orq-ai/node/funcs/contactsCreate.js";
|
|
42
|
+
|
|
43
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
44
|
+
// You can create one instance of it to use across an application.
|
|
45
|
+
const orq = new OrqCore({
|
|
46
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
async function run() {
|
|
50
|
+
const res = await contactsCreate(orq, {
|
|
51
|
+
externalId: "<id>",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
throw res.error;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const { value: result } = res;
|
|
59
|
+
|
|
60
|
+
// Handle the result
|
|
61
|
+
console.log(result);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
run();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Parameters
|
|
68
|
+
|
|
69
|
+
| Parameter | Type | Required | Description |
|
|
70
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
71
|
+
| `request` | [operations.CreateContactRequestBody](../../models/operations/createcontactrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
72
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
73
|
+
| `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. |
|
|
74
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
75
|
+
|
|
76
|
+
### Response
|
|
77
|
+
|
|
78
|
+
**Promise\<[operations.CreateContactResponseBody](../../models/operations/createcontactresponsebody.md)\>**
|
|
79
|
+
|
|
80
|
+
### Errors
|
|
81
|
+
|
|
82
|
+
| Error Type | Status Code | Content Type |
|
|
83
|
+
| --------------- | --------------- | --------------- |
|
|
84
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|