@orq-ai/node 2.14.6 → 3.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/FUNCTIONS.md +106 -0
- package/README.md +495 -172
- package/RUNTIMES.md +48 -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 +239 -0
- package/docs/sdks/feedback/README.md +92 -0
- package/docs/sdks/files/README.md +473 -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 +107 -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 +115 -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 +107 -0
- package/funcs/deploymentsGetConfig.js.map +1 -0
- package/funcs/deploymentsInvoke.d.ts +22 -0
- package/funcs/deploymentsInvoke.d.ts.map +1 -0
- package/funcs/deploymentsInvoke.js +117 -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 +113 -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 +107 -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 +109 -0
- package/funcs/filesBulkUpload.js.map +1 -0
- package/funcs/filesDelete.d.ts +12 -0
- package/funcs/filesDelete.d.ts.map +1 -0
- package/funcs/filesDelete.js +110 -0
- package/funcs/filesDelete.js.map +1 -0
- package/funcs/filesGet.d.ts +12 -0
- package/funcs/filesGet.d.ts.map +1 -0
- package/funcs/filesGet.js +109 -0
- package/funcs/filesGet.js.map +1 -0
- package/funcs/filesList.d.ts +12 -0
- package/funcs/filesList.d.ts.map +1 -0
- package/funcs/filesList.js +110 -0
- package/funcs/filesList.js.map +1 -0
- package/funcs/filesUpdate.d.ts +12 -0
- package/funcs/filesUpdate.d.ts.map +1 -0
- package/funcs/filesUpdate.js +110 -0
- package/funcs/filesUpdate.js.map +1 -0
- package/funcs/filesUpload.d.ts +15 -0
- package/funcs/filesUpload.d.ts.map +1 -0
- package/funcs/filesUpload.js +125 -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 +109 -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 +109 -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 +106 -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 +110 -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 +110 -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 +110 -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 +106 -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 +110 -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 +114 -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 +107 -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 +86 -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 +77 -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 +35 -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 +52 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +368 -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 +65 -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 +220 -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 +217 -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 +207 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +23 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +104 -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 +154 -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 +60 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +280 -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 +139 -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 +920 -0
- package/models/components/deployments.d.ts.map +1 -0
- package/models/components/deployments.js +948 -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 +173 -0
- package/models/operations/bulkfileupload.d.ts.map +1 -0
- package/models/operations/bulkfileupload.js +210 -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 +2035 -0
- package/models/operations/createprompt.d.ts.map +1 -0
- package/models/operations/createprompt.js +1853 -0
- package/models/operations/createprompt.js.map +1 -0
- package/models/operations/createpromptversion.d.ts +2003 -0
- package/models/operations/createpromptversion.d.ts.map +1 -0
- package/models/operations/createpromptversion.js +1852 -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 +1885 -0
- package/models/operations/deploymentgetconfig.d.ts.map +1 -0
- package/models/operations/deploymentgetconfig.js +1782 -0
- package/models/operations/deploymentgetconfig.js.map +1 -0
- package/models/operations/deploymentinvoke.d.ts +1350 -0
- package/models/operations/deploymentinvoke.d.ts.map +1 -0
- package/models/operations/deploymentinvoke.js +1210 -0
- package/models/operations/deploymentinvoke.js.map +1 -0
- package/models/operations/deployments.d.ts +1233 -0
- package/models/operations/deployments.d.ts.map +1 -0
- package/models/operations/deployments.js +1111 -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/filedelete.d.ts +32 -0
- package/models/operations/filedelete.d.ts.map +1 -0
- package/models/operations/filedelete.js +78 -0
- package/models/operations/filedelete.js.map +1 -0
- package/models/operations/fileget.d.ts +116 -0
- package/models/operations/fileget.d.ts.map +1 -0
- package/models/operations/fileget.js +154 -0
- package/models/operations/fileget.js.map +1 -0
- package/models/operations/filelist.d.ts +174 -0
- package/models/operations/filelist.d.ts.map +1 -0
- package/models/operations/filelist.js +217 -0
- package/models/operations/filelist.js.map +1 -0
- package/models/operations/fileupdate.d.ts +143 -0
- package/models/operations/fileupdate.d.ts.map +1 -0
- package/models/operations/fileupdate.js +193 -0
- package/models/operations/fileupdate.js.map +1 -0
- package/models/operations/fileupload.d.ts +179 -0
- package/models/operations/fileupload.d.ts.map +1 -0
- package/models/operations/fileupload.js +212 -0
- package/models/operations/fileupload.js.map +1 -0
- package/models/operations/findonepromptsnippet.d.ts +6278 -0
- package/models/operations/findonepromptsnippet.d.ts.map +1 -0
- package/models/operations/findonepromptsnippet.js +5891 -0
- package/models/operations/findonepromptsnippet.js.map +1 -0
- package/models/operations/getallprompts.d.ts +10675 -0
- package/models/operations/getallprompts.d.ts.map +1 -0
- package/models/operations/getallprompts.js +9398 -0
- package/models/operations/getallprompts.js.map +1 -0
- package/models/operations/getallprompttemplates.d.ts +6607 -0
- package/models/operations/getallprompttemplates.d.ts.map +1 -0
- package/models/operations/getallprompttemplates.js +6225 -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 +23 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +42 -0
- package/models/operations/index.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 +7251 -0
- package/models/operations/updateprompt.d.ts.map +1 -0
- package/models/operations/updateprompt.js +6678 -0
- package/models/operations/updateprompt.js.map +1 -0
- package/package.json +25 -24
- package/packages/orq-rc/FUNCTIONS.md +106 -0
- package/packages/orq-rc/README.md +564 -0
- package/packages/orq-rc/RUNTIMES.md +22 -0
- package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
- package/packages/orq-rc/docs/sdks/deployments/README.md +239 -0
- package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
- package/packages/orq-rc/docs/sdks/files/README.md +473 -0
- package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
- package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
- package/packages/orq-rc/docs/sdks/prompt/README.md +6 -0
- package/packages/orq-rc/docs/sdks/prompts/README.md +533 -0
- package/packages/orq-rc/docs/sdks/remoteconfig/README.md +80 -0
- package/packages/orq-rc/docs/sdks/snippets/README.md +84 -0
- package/packages/orq-rc/docs/sdks/templates/README.md +80 -0
- package/packages/orq-rc/src/core.ts +13 -0
- package/packages/orq-rc/src/funcs/contactsCreate.ts +124 -0
- package/packages/orq-rc/src/funcs/deploymentsAll.ts +138 -0
- package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +132 -0
- package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +135 -0
- package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +132 -0
- package/packages/orq-rc/src/funcs/feedbackCreate.ts +124 -0
- package/packages/orq-rc/src/funcs/filesBulkUpload.ts +126 -0
- package/packages/orq-rc/src/funcs/filesDelete.ts +128 -0
- package/packages/orq-rc/src/funcs/filesGet.ts +127 -0
- package/packages/orq-rc/src/funcs/filesList.ts +129 -0
- package/packages/orq-rc/src/funcs/filesUpdate.ts +128 -0
- package/packages/orq-rc/src/funcs/filesUpload.ts +145 -0
- package/packages/orq-rc/src/funcs/promptSnippetsFindOne.ts +128 -0
- package/packages/orq-rc/src/funcs/promptTemplatesGetAll.ts +130 -0
- package/packages/orq-rc/src/funcs/promptsCreate.ts +124 -0
- package/packages/orq-rc/src/funcs/promptsCreateVersion.ts +129 -0
- package/packages/orq-rc/src/funcs/promptsDelete.ts +128 -0
- package/packages/orq-rc/src/funcs/promptsDuplicate.ts +128 -0
- package/packages/orq-rc/src/funcs/promptsGetAll.ts +126 -0
- package/packages/orq-rc/src/funcs/promptsGetOne.ts +128 -0
- package/packages/orq-rc/src/funcs/promptsUpdate.ts +136 -0
- package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +125 -0
- package/packages/orq-rc/src/hooks/hooks.ts +132 -0
- package/packages/orq-rc/src/hooks/index.ts +6 -0
- package/packages/orq-rc/src/hooks/registration.ts +14 -0
- package/packages/orq-rc/src/hooks/types.ts +109 -0
- package/packages/orq-rc/src/index.ts +7 -0
- package/packages/orq-rc/src/lib/base64.ts +37 -0
- package/packages/orq-rc/src/lib/config.ts +60 -0
- package/packages/orq-rc/src/lib/dlv.ts +53 -0
- package/packages/orq-rc/src/lib/encodings.ts +449 -0
- package/packages/orq-rc/src/lib/env.ts +41 -0
- package/packages/orq-rc/src/lib/event-streams.ts +264 -0
- package/packages/orq-rc/src/lib/files.ts +40 -0
- package/packages/orq-rc/src/lib/http.ts +323 -0
- package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
- package/packages/orq-rc/src/lib/logger.ts +9 -0
- package/packages/orq-rc/src/lib/matchers.ts +325 -0
- package/packages/orq-rc/src/lib/primitives.ts +122 -0
- package/packages/orq-rc/src/lib/retries.ts +219 -0
- package/packages/orq-rc/src/lib/schemas.ts +86 -0
- package/packages/orq-rc/src/lib/sdks.ts +397 -0
- package/packages/orq-rc/src/lib/security.ts +254 -0
- package/packages/orq-rc/src/lib/url.ts +33 -0
- package/packages/orq-rc/src/models/components/deployments.ts +1673 -0
- package/packages/orq-rc/src/models/components/index.ts +6 -0
- package/packages/orq-rc/src/models/components/security.ts +71 -0
- package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
- package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
- package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
- package/packages/orq-rc/src/models/errors/index.ts +9 -0
- package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
- package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
- package/packages/orq-rc/src/models/operations/bulkfileupload.ts +315 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
- package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
- package/packages/orq-rc/src/models/operations/createprompt.ts +3461 -0
- package/packages/orq-rc/src/models/operations/createpromptversion.ts +3703 -0
- package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
- package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +1790 -0
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +3483 -0
- package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +2385 -0
- package/packages/orq-rc/src/models/operations/deployments.ts +2098 -0
- package/packages/orq-rc/src/models/operations/duplicateprompt.ts +69 -0
- package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +222 -0
- package/packages/orq-rc/src/models/operations/filelist.ts +333 -0
- package/packages/orq-rc/src/models/operations/fileupdate.ts +298 -0
- package/packages/orq-rc/src/models/operations/fileupload.ts +322 -0
- package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +13629 -0
- package/packages/orq-rc/src/models/operations/getallprompts.ts +18640 -0
- package/packages/orq-rc/src/models/operations/getallprompttemplates.ts +13690 -0
- package/packages/orq-rc/src/models/operations/getoneprompt.ts +69 -0
- package/packages/orq-rc/src/models/operations/index.ts +26 -0
- package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
- package/packages/orq-rc/src/models/operations/updateprompt.ts +14407 -0
- package/packages/orq-rc/src/sdk/contacts.ts +27 -0
- package/packages/orq-rc/src/sdk/deployments.ts +75 -0
- package/packages/orq-rc/src/sdk/feedback.ts +27 -0
- package/packages/orq-rc/src/sdk/files.ts +105 -0
- package/packages/orq-rc/src/sdk/index.ts +5 -0
- package/packages/orq-rc/src/sdk/metrics.ts +27 -0
- package/packages/orq-rc/src/sdk/prompt.ts +19 -0
- package/packages/orq-rc/src/sdk/prompts.ts +114 -0
- package/packages/orq-rc/src/sdk/remoteconfig.ts +24 -0
- package/packages/orq-rc/src/sdk/sdk.ts +49 -0
- package/packages/orq-rc/src/sdk/snippets.ts +24 -0
- package/packages/orq-rc/src/sdk/templates.ts +24 -0
- package/packages/orq-rc/src/types/blobs.ts +31 -0
- package/packages/orq-rc/src/types/constdatetime.ts +15 -0
- package/packages/orq-rc/src/types/enums.ts +16 -0
- package/packages/orq-rc/src/types/fp.ts +50 -0
- package/packages/orq-rc/src/types/index.ts +11 -0
- package/packages/orq-rc/src/types/operations.ts +105 -0
- package/packages/orq-rc/src/types/rfcdate.ts +54 -0
- package/packages/orq-rc/src/types/streams.ts +21 -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 +34 -0
- package/sdk/deployments.d.ts.map +1 -0
- package/sdk/deployments.js +48 -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 +35 -0
- package/sdk/files.d.ts.map +1 -0
- package/sdk/files.js +60 -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 +19 -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 +39 -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 +125 -0
- package/src/funcs/deploymentsAll.ts +139 -0
- package/src/funcs/deploymentsGetConfig.ts +133 -0
- package/src/funcs/deploymentsInvoke.ts +136 -0
- package/src/funcs/deploymentsMetricsCreate.ts +133 -0
- package/src/funcs/feedbackCreate.ts +125 -0
- package/src/funcs/filesBulkUpload.ts +128 -0
- package/src/funcs/filesDelete.ts +129 -0
- package/src/funcs/filesGet.ts +128 -0
- package/src/funcs/filesList.ts +130 -0
- package/src/funcs/filesUpdate.ts +129 -0
- package/src/funcs/filesUpload.ts +148 -0
- package/src/funcs/promptSnippetsFindOne.ts +129 -0
- package/src/funcs/promptTemplatesGetAll.ts +131 -0
- package/src/funcs/promptsCreate.ts +125 -0
- package/src/funcs/promptsCreateVersion.ts +130 -0
- package/src/funcs/promptsDelete.ts +129 -0
- package/src/funcs/promptsDuplicate.ts +129 -0
- package/src/funcs/promptsGetAll.ts +127 -0
- package/src/funcs/promptsGetOne.ts +129 -0
- package/src/funcs/promptsUpdate.ts +137 -0
- package/src/funcs/remoteconfigGetConfig.ts +126 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +109 -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 +483 -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 +136 -0
- package/src/lib/retries.ts +219 -0
- package/src/lib/schemas.ts +86 -0
- package/src/lib/sdks.ts +400 -0
- package/src/lib/security.ts +254 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/deployments.ts +1673 -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 +315 -0
- package/src/models/operations/createcontact.ts +256 -0
- package/src/models/operations/createfeedback.ts +286 -0
- package/src/models/operations/createprompt.ts +3461 -0
- package/src/models/operations/createpromptversion.ts +3703 -0
- package/src/models/operations/deleteprompt.ts +69 -0
- package/src/models/operations/deploymentcreatemetric.ts +1790 -0
- package/src/models/operations/deploymentgetconfig.ts +3483 -0
- package/src/models/operations/deploymentinvoke.ts +2385 -0
- package/src/models/operations/deployments.ts +2098 -0
- package/src/models/operations/duplicateprompt.ts +69 -0
- package/src/models/operations/filedelete.ts +78 -0
- package/src/models/operations/fileget.ts +222 -0
- package/src/models/operations/filelist.ts +333 -0
- package/src/models/operations/fileupdate.ts +298 -0
- package/src/models/operations/fileupload.ts +322 -0
- package/src/models/operations/findonepromptsnippet.ts +13629 -0
- package/src/models/operations/getallprompts.ts +18640 -0
- package/src/models/operations/getallprompttemplates.ts +13690 -0
- package/src/models/operations/getoneprompt.ts +69 -0
- package/src/models/operations/index.ts +26 -0
- package/src/models/operations/remoteconfigsgetconfig.ts +190 -0
- package/src/models/operations/updateprompt.ts +14407 -0
- package/src/sdk/contacts.ts +27 -0
- package/src/sdk/deployments.ts +75 -0
- package/src/sdk/feedback.ts +27 -0
- package/src/sdk/files.ts +105 -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/src/index.d.ts +0 -3
- package/src/index.js +0 -7
- package/src/index.js.map +0 -1
- package/src/lib/api/contacts/index.d.ts +0 -9
- package/src/lib/api/contacts/index.js +0 -25
- package/src/lib/api/contacts/index.js.map +0 -1
- package/src/lib/api/deployments.d.ts +0 -45
- package/src/lib/api/deployments.js +0 -166
- package/src/lib/api/deployments.js.map +0 -1
- package/src/lib/api/feedback/feedback.d.ts +0 -20
- package/src/lib/api/feedback/feedback.js +0 -51
- package/src/lib/api/feedback/feedback.js.map +0 -1
- package/src/lib/api/feedback/index.d.ts +0 -1
- package/src/lib/api/feedback/index.js +0 -5
- package/src/lib/api/feedback/index.js.map +0 -1
- package/src/lib/api/index.d.ts +0 -1
- package/src/lib/api/index.js +0 -5
- package/src/lib/api/index.js.map +0 -1
- package/src/lib/api/webhooks/index.d.ts +0 -1
- package/src/lib/api/webhooks/index.js +0 -5
- package/src/lib/api/webhooks/index.js.map +0 -1
- package/src/lib/api/webhooks/webhooks.d.ts +0 -14
- package/src/lib/api/webhooks/webhooks.js +0 -40
- package/src/lib/api/webhooks/webhooks.js.map +0 -1
- package/src/lib/client.d.ts +0 -17
- package/src/lib/client.js +0 -47
- package/src/lib/client.js.map +0 -1
- package/src/lib/exceptions/index.d.ts +0 -9
- package/src/lib/exceptions/index.js +0 -31
- package/src/lib/exceptions/index.js.map +0 -1
- package/src/lib/http/index.d.ts +0 -7
- package/src/lib/http/index.js +0 -15
- package/src/lib/http/index.js.map +0 -1
- package/src/lib/models/contacts.d.ts +0 -8
- package/src/lib/models/contacts.js +0 -3
- package/src/lib/models/contacts.js.map +0 -1
- package/src/lib/models/deployments.d.ts +0 -167
- package/src/lib/models/deployments.js +0 -40
- package/src/lib/models/deployments.js.map +0 -1
- package/src/lib/models/feedback.models.d.ts +0 -23
- package/src/lib/models/feedback.models.js +0 -3
- package/src/lib/models/feedback.models.js.map +0 -1
- package/src/lib/models/index.d.ts +0 -6
- package/src/lib/models/index.js +0 -10
- package/src/lib/models/index.js.map +0 -1
- package/src/lib/models/options.d.ts +0 -13
- package/src/lib/models/options.js +0 -3
- package/src/lib/models/options.js.map +0 -1
- package/src/lib/models/user-info.d.ts +0 -3
- package/src/lib/models/user-info.js +0 -3
- package/src/lib/models/user-info.js.map +0 -1
- package/src/lib/models/webhooks.d.ts +0 -83
- package/src/lib/models/webhooks.js +0 -8
- package/src/lib/models/webhooks.js.map +0 -1
- package/src/lib/utils/index.d.ts +0 -6
- package/src/lib/utils/index.js +0 -51
- package/src/lib/utils/index.js.map +0 -1
- package/src/lib/version.d.ts +0 -1
- package/src/lib/version.js +0 -5
- package/src/lib/version.js.map +0 -1
package/lib/base64.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.zodInbound = exports.zodOutbound = void 0;
|
|
40
|
+
exports.bytesToBase64 = bytesToBase64;
|
|
41
|
+
exports.bytesFromBase64 = bytesFromBase64;
|
|
42
|
+
exports.stringToBytes = stringToBytes;
|
|
43
|
+
exports.stringFromBytes = stringFromBytes;
|
|
44
|
+
exports.stringToBase64 = stringToBase64;
|
|
45
|
+
exports.stringFromBase64 = stringFromBase64;
|
|
46
|
+
const z = __importStar(require("zod"));
|
|
47
|
+
function bytesToBase64(u8arr) {
|
|
48
|
+
return btoa(String.fromCodePoint(...u8arr));
|
|
49
|
+
}
|
|
50
|
+
function bytesFromBase64(encoded) {
|
|
51
|
+
return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
|
|
52
|
+
}
|
|
53
|
+
function stringToBytes(str) {
|
|
54
|
+
return new TextEncoder().encode(str);
|
|
55
|
+
}
|
|
56
|
+
function stringFromBytes(u8arr) {
|
|
57
|
+
return new TextDecoder().decode(u8arr);
|
|
58
|
+
}
|
|
59
|
+
function stringToBase64(str) {
|
|
60
|
+
return bytesToBase64(stringToBytes(str));
|
|
61
|
+
}
|
|
62
|
+
function stringFromBase64(b64str) {
|
|
63
|
+
return stringFromBytes(bytesFromBase64(b64str));
|
|
64
|
+
}
|
|
65
|
+
exports.zodOutbound = z
|
|
66
|
+
.instanceof(Uint8Array)
|
|
67
|
+
.or(z.string().transform(stringToBytes));
|
|
68
|
+
exports.zodInbound = z
|
|
69
|
+
.instanceof(Uint8Array)
|
|
70
|
+
.or(z.string().transform(bytesFromBase64));
|
|
71
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../src/lib/base64.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,sCAEC;AAED,0CAEC;AAED,sCAEC;AAED,0CAEC;AAED,wCAEC;AAED,4CAEC;AAxBD,uCAAyB;AAEzB,SAAgB,aAAa,CAAC,KAAiB;IAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,eAAe,CAAC,OAAe;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAgB,aAAa,CAAC,GAAW;IACvC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED,SAAgB,eAAe,CAAC,KAAiB;IAC/C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,OAAO,eAAe,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAEY,QAAA,WAAW,GAAG,CAAC;KACzB,UAAU,CAAC,UAAU,CAAC;KACtB,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9B,QAAA,UAAU,GAAG,CAAC;KACxB,UAAU,CAAC,UAAU,CAAC;KACtB,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTTPClient } from "./http.js";
|
|
2
|
+
import { Logger } from "./logger.js";
|
|
3
|
+
import { RetryConfig } from "./retries.js";
|
|
4
|
+
/**
|
|
5
|
+
* Contains the list of servers available to the SDK
|
|
6
|
+
*/
|
|
7
|
+
export declare const ServerList: readonly ["https://my.orq.ai"];
|
|
8
|
+
export type SDKOptions = {
|
|
9
|
+
apiKey?: string | (() => Promise<string>);
|
|
10
|
+
httpClient?: HTTPClient;
|
|
11
|
+
/**
|
|
12
|
+
* Allows overriding the default server used by the SDK
|
|
13
|
+
*/
|
|
14
|
+
serverIdx?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Allows overriding the default server URL used by the SDK
|
|
17
|
+
*/
|
|
18
|
+
serverURL?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Allows overriding the default retry config used by the SDK
|
|
21
|
+
*/
|
|
22
|
+
retryConfig?: RetryConfig;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
debugLogger?: Logger;
|
|
25
|
+
};
|
|
26
|
+
export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
27
|
+
export declare const SDK_METADATA: {
|
|
28
|
+
readonly language: "typescript";
|
|
29
|
+
readonly openapiDocVersion: "2.0";
|
|
30
|
+
readonly sdkVersion: "3.0.1";
|
|
31
|
+
readonly genVersion: "2.493.15";
|
|
32
|
+
readonly userAgent: "speakeasy-sdk/typescript 3.0.1 2.493.15 2.0 @orq-ai/node";
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;GAEG;AACH,eAAO,MAAM,UAAU,gCAEb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,GAAG,IAAI,CAepE;AAED,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC"}
|
package/lib/config.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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.SDK_METADATA = exports.ServerList = void 0;
|
|
7
|
+
exports.serverURLFromOptions = serverURLFromOptions;
|
|
8
|
+
const url_js_1 = require("./url.js");
|
|
9
|
+
/**
|
|
10
|
+
* Contains the list of servers available to the SDK
|
|
11
|
+
*/
|
|
12
|
+
exports.ServerList = [
|
|
13
|
+
"https://my.orq.ai",
|
|
14
|
+
];
|
|
15
|
+
function serverURLFromOptions(options) {
|
|
16
|
+
let serverURL = options.serverURL;
|
|
17
|
+
const params = {};
|
|
18
|
+
if (!serverURL) {
|
|
19
|
+
const serverIdx = options.serverIdx ?? 0;
|
|
20
|
+
if (serverIdx < 0 || serverIdx >= exports.ServerList.length) {
|
|
21
|
+
throw new Error(`Invalid server index ${serverIdx}`);
|
|
22
|
+
}
|
|
23
|
+
serverURL = exports.ServerList[serverIdx] || "";
|
|
24
|
+
}
|
|
25
|
+
const u = (0, url_js_1.pathToFunc)(serverURL)(params);
|
|
26
|
+
return new URL(u);
|
|
27
|
+
}
|
|
28
|
+
exports.SDK_METADATA = {
|
|
29
|
+
language: "typescript",
|
|
30
|
+
openapiDocVersion: "2.0",
|
|
31
|
+
sdkVersion: "3.0.1",
|
|
32
|
+
genVersion: "2.493.15",
|
|
33
|
+
userAgent: "speakeasy-sdk/typescript 3.0.1 2.493.15 2.0 @orq-ai/node",
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkCH,oDAeC;AA5CD,qCAA8C;AAE9C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,mBAAmB;CACX,CAAC;AAsBX,SAAgB,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,MAAM,GAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI,kBAAU,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,SAAS,GAAG,kBAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAEY,QAAA,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,KAAK;IACxB,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,0DAA0D;CAC7D,CAAC"}
|
package/lib/dlv.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param obj The object to walk
|
|
3
|
+
* @param key The key path to walk the object with
|
|
4
|
+
* @param def A default value to return if the result is undefined
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* dlv(obj, "a.b.c.d")
|
|
8
|
+
* @example
|
|
9
|
+
* dlv(object, ["a", "b", "c", "d"])
|
|
10
|
+
* @example
|
|
11
|
+
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
12
|
+
*/
|
|
13
|
+
export declare function dlv<T = any>(obj: any, key: string | string[], def?: T, p?: number, undef?: never): T | undefined;
|
|
14
|
+
//# sourceMappingURL=dlv.d.ts.map
|
package/lib/dlv.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dlv.d.ts","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,GAAG,CAAC,EAAE,CAAC,EACP,CAAC,CAAC,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC,GAAG,SAAS,CAOf"}
|
package/lib/dlv.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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.dlv = dlv;
|
|
7
|
+
/*
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
+
the Software without restriction, including without limitation the rights to
|
|
15
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
24
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
25
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @param obj The object to walk
|
|
31
|
+
* @param key The key path to walk the object with
|
|
32
|
+
* @param def A default value to return if the result is undefined
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* dlv(obj, "a.b.c.d")
|
|
36
|
+
* @example
|
|
37
|
+
* dlv(object, ["a", "b", "c", "d"])
|
|
38
|
+
* @example
|
|
39
|
+
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
40
|
+
*/
|
|
41
|
+
function dlv(obj, key, def, p, undef) {
|
|
42
|
+
key = Array.isArray(key) ? key : key.split(".");
|
|
43
|
+
for (p = 0; p < key.length; p++) {
|
|
44
|
+
const k = key[p];
|
|
45
|
+
obj = k != null && obj ? obj[k] : undef;
|
|
46
|
+
}
|
|
47
|
+
return obj === undef ? def : obj;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=dlv.js.map
|
package/lib/dlv.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dlv.js","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqCH,kBAaC;AAhDD;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF;;;;;;;;;;;GAWG;AACH,SAAgB,GAAG,CACjB,GAAQ,EACR,GAAsB,EACtB,GAAO,EACP,CAAU,EACV,KAAa;IAEb,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare class EncodingError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare function encodeMatrix(key: string, value: unknown, options?: {
|
|
5
|
+
explode?: boolean;
|
|
6
|
+
charEncoding?: "percent" | "none";
|
|
7
|
+
}): string | undefined;
|
|
8
|
+
export declare function encodeLabel(key: string, value: unknown, options?: {
|
|
9
|
+
explode?: boolean;
|
|
10
|
+
charEncoding?: "percent" | "none";
|
|
11
|
+
}): string | undefined;
|
|
12
|
+
type FormEncoder = (key: string, value: unknown, options?: {
|
|
13
|
+
explode?: boolean;
|
|
14
|
+
charEncoding?: "percent" | "none";
|
|
15
|
+
}) => string | undefined;
|
|
16
|
+
export declare const encodeForm: FormEncoder;
|
|
17
|
+
export declare const encodeSpaceDelimited: FormEncoder;
|
|
18
|
+
export declare const encodePipeDelimited: FormEncoder;
|
|
19
|
+
export declare function encodeBodyForm(key: string, value: unknown, options?: {
|
|
20
|
+
explode?: boolean;
|
|
21
|
+
charEncoding?: "percent" | "none";
|
|
22
|
+
}): string;
|
|
23
|
+
export declare function encodeDeepObject(key: string, value: unknown, options?: {
|
|
24
|
+
charEncoding?: "percent" | "none";
|
|
25
|
+
}): string | undefined;
|
|
26
|
+
export declare function encodeDeepObjectObject(key: string, value: unknown, options?: {
|
|
27
|
+
charEncoding?: "percent" | "none";
|
|
28
|
+
}): string | undefined;
|
|
29
|
+
export declare function encodeJSON(key: string, value: unknown, options?: {
|
|
30
|
+
explode?: boolean;
|
|
31
|
+
charEncoding?: "percent" | "none";
|
|
32
|
+
}): string | undefined;
|
|
33
|
+
export declare const encodeSimple: (key: string, value: unknown, options?: {
|
|
34
|
+
explode?: boolean;
|
|
35
|
+
charEncoding?: "percent" | "none";
|
|
36
|
+
}) => string | undefined;
|
|
37
|
+
export declare function queryJoin(...args: (string | undefined)[]): string;
|
|
38
|
+
type QueryEncoderOptions = {
|
|
39
|
+
explode?: boolean;
|
|
40
|
+
charEncoding?: "percent" | "none";
|
|
41
|
+
};
|
|
42
|
+
type QueryEncoder = (key: string, value: unknown, options?: QueryEncoderOptions) => string | undefined;
|
|
43
|
+
type BulkQueryEncoder = (values: Record<string, unknown>, options?: QueryEncoderOptions) => string;
|
|
44
|
+
export declare function queryEncoder(f: QueryEncoder): BulkQueryEncoder;
|
|
45
|
+
export declare const encodeJSONQuery: BulkQueryEncoder;
|
|
46
|
+
export declare const encodeFormQuery: BulkQueryEncoder;
|
|
47
|
+
export declare const encodeSpaceDelimitedQuery: BulkQueryEncoder;
|
|
48
|
+
export declare const encodePipeDelimitedQuery: BulkQueryEncoder;
|
|
49
|
+
export declare const encodeDeepObjectQuery: BulkQueryEncoder;
|
|
50
|
+
export declare function appendForm(fd: FormData, key: string, value: unknown, fileName?: string): void;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=encodings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodings.d.ts","sourceRoot":"","sources":["../src/lib/encodings.ts"],"names":[],"mappings":"AAOA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GACjE,MAAM,GAAG,SAAS,CAoDpB;AAED,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GACjE,MAAM,GAAG,SAAS,CAqCpB;AAED,KAAK,WAAW,GAAG,CACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,KAC/D,MAAM,GAAG,SAAS,CAAC;AA2DxB,eAAO,MAAM,UAAU,aAAmB,CAAC;AAC3C,eAAO,MAAM,oBAAoB,aAAmB,CAAC;AACrD,eAAO,MAAM,mBAAmB,aAAmB,CAAC;AAEpD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GACjE,MAAM,CAqCR;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GAC9C,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GAC9C,MAAM,GAAG,SAAS,CAuCpB;AAED,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GACjE,MAAM,GAAG,SAAS,CAYpB;AAED,eAAO,MAAM,YAAY,QAClB,MAAM,SACJ,OAAO,YACJ;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,KACjE,MAAM,GAAG,SAoCX,CAAC;AA2EF,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAEjE;AAED,KAAK,mBAAmB,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CACnC,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,mBAAmB,KAC1B,MAAM,GAAG,SAAS,CAAC;AAExB,KAAK,gBAAgB,GAAG,CACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,mBAAmB,KAC1B,MAAM,CAAC;AAEZ,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAkB9D;AAED,eAAO,MAAM,eAAe,kBAA2B,CAAC;AACxD,eAAO,MAAM,eAAe,kBAA2B,CAAC;AACxD,eAAO,MAAM,yBAAyB,kBAAqC,CAAC;AAC5E,eAAO,MAAM,wBAAwB,kBAAoC,CAAC;AAC1E,eAAO,MAAM,qBAAqB,kBAAiC,CAAC;AAEpE,wBAAgB,UAAU,CACxB,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAUN"}
|
package/lib/encodings.js
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
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.encodeDeepObjectQuery = exports.encodePipeDelimitedQuery = exports.encodeSpaceDelimitedQuery = exports.encodeFormQuery = exports.encodeJSONQuery = exports.encodeSimple = exports.encodePipeDelimited = exports.encodeSpaceDelimited = exports.encodeForm = exports.EncodingError = void 0;
|
|
7
|
+
exports.encodeMatrix = encodeMatrix;
|
|
8
|
+
exports.encodeLabel = encodeLabel;
|
|
9
|
+
exports.encodeBodyForm = encodeBodyForm;
|
|
10
|
+
exports.encodeDeepObject = encodeDeepObject;
|
|
11
|
+
exports.encodeDeepObjectObject = encodeDeepObjectObject;
|
|
12
|
+
exports.encodeJSON = encodeJSON;
|
|
13
|
+
exports.queryJoin = queryJoin;
|
|
14
|
+
exports.queryEncoder = queryEncoder;
|
|
15
|
+
exports.appendForm = appendForm;
|
|
16
|
+
const base64_js_1 = require("./base64.js");
|
|
17
|
+
const is_plain_object_js_1 = require("./is-plain-object.js");
|
|
18
|
+
class EncodingError extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "EncodingError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.EncodingError = EncodingError;
|
|
25
|
+
function encodeMatrix(key, value, options) {
|
|
26
|
+
let out = "";
|
|
27
|
+
const pairs = options?.explode
|
|
28
|
+
? explode(key, value)
|
|
29
|
+
: [[key, value]];
|
|
30
|
+
if (pairs.every(([_, v]) => v == null)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const encodeString = (v) => {
|
|
34
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
35
|
+
};
|
|
36
|
+
const encodeValue = (v) => encodeString(serializeValue(v));
|
|
37
|
+
pairs.forEach(([pk, pv]) => {
|
|
38
|
+
let tmp = "";
|
|
39
|
+
let encValue = null;
|
|
40
|
+
if (pv == null) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
else if (Array.isArray(pv)) {
|
|
44
|
+
encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
|
|
45
|
+
}
|
|
46
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(pv)) {
|
|
47
|
+
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
|
|
48
|
+
return `,${encodeString(k)},${encodeValue(v)}`;
|
|
49
|
+
});
|
|
50
|
+
encValue = mapped?.join("").slice(1);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
encValue = `${encodeValue(pv)}`;
|
|
54
|
+
}
|
|
55
|
+
if (encValue == null) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const keyPrefix = encodeString(pk);
|
|
59
|
+
tmp = `${keyPrefix}=${encValue}`;
|
|
60
|
+
// trim trailing '=' if value was empty
|
|
61
|
+
if (tmp === `${keyPrefix}=`) {
|
|
62
|
+
tmp = tmp.slice(0, -1);
|
|
63
|
+
}
|
|
64
|
+
// If we end up with the nothing then skip forward
|
|
65
|
+
if (!tmp) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
out += `;${tmp}`;
|
|
69
|
+
});
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
function encodeLabel(key, value, options) {
|
|
73
|
+
let out = "";
|
|
74
|
+
const pairs = options?.explode
|
|
75
|
+
? explode(key, value)
|
|
76
|
+
: [[key, value]];
|
|
77
|
+
if (pairs.every(([_, v]) => v == null)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const encodeString = (v) => {
|
|
81
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
82
|
+
};
|
|
83
|
+
const encodeValue = (v) => encodeString(serializeValue(v));
|
|
84
|
+
pairs.forEach(([pk, pv]) => {
|
|
85
|
+
let encValue = "";
|
|
86
|
+
if (pv == null) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
else if (Array.isArray(pv)) {
|
|
90
|
+
encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(".");
|
|
91
|
+
}
|
|
92
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(pv)) {
|
|
93
|
+
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
|
|
94
|
+
return `.${encodeString(k)}.${encodeValue(v)}`;
|
|
95
|
+
});
|
|
96
|
+
encValue = mapped?.join("").slice(1);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const k = options?.explode && (0, is_plain_object_js_1.isPlainObject)(value) ? `${encodeString(pk)}=` : "";
|
|
100
|
+
encValue = `${k}${encodeValue(pv)}`;
|
|
101
|
+
}
|
|
102
|
+
out += encValue == null ? "" : `.${encValue}`;
|
|
103
|
+
});
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
function formEncoder(sep) {
|
|
107
|
+
return (key, value, options) => {
|
|
108
|
+
let out = "";
|
|
109
|
+
const pairs = options?.explode
|
|
110
|
+
? explode(key, value)
|
|
111
|
+
: [[key, value]];
|
|
112
|
+
if (pairs.every(([_, v]) => v == null)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const encodeString = (v) => {
|
|
116
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
117
|
+
};
|
|
118
|
+
const encodeValue = (v) => encodeString(serializeValue(v));
|
|
119
|
+
const encodedSep = encodeString(sep);
|
|
120
|
+
pairs.forEach(([pk, pv]) => {
|
|
121
|
+
let tmp = "";
|
|
122
|
+
let encValue = null;
|
|
123
|
+
if (pv == null) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
else if (Array.isArray(pv)) {
|
|
127
|
+
encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep);
|
|
128
|
+
}
|
|
129
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(pv)) {
|
|
130
|
+
encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
|
|
131
|
+
return `${encodeString(k)}${encodedSep}${encodeValue(v)}`;
|
|
132
|
+
})?.join(encodedSep);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
encValue = `${encodeValue(pv)}`;
|
|
136
|
+
}
|
|
137
|
+
if (encValue == null) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
tmp = `${encodeString(pk)}=${encValue}`;
|
|
141
|
+
// If we end up with the nothing then skip forward
|
|
142
|
+
if (!tmp || tmp === "=") {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
out += `&${tmp}`;
|
|
146
|
+
});
|
|
147
|
+
return out.slice(1);
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
exports.encodeForm = formEncoder(",");
|
|
151
|
+
exports.encodeSpaceDelimited = formEncoder(" ");
|
|
152
|
+
exports.encodePipeDelimited = formEncoder("|");
|
|
153
|
+
function encodeBodyForm(key, value, options) {
|
|
154
|
+
let out = "";
|
|
155
|
+
const pairs = options?.explode
|
|
156
|
+
? explode(key, value)
|
|
157
|
+
: [[key, value]];
|
|
158
|
+
const encodeString = (v) => {
|
|
159
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
160
|
+
};
|
|
161
|
+
const encodeValue = (v) => encodeString(serializeValue(v));
|
|
162
|
+
pairs.forEach(([pk, pv]) => {
|
|
163
|
+
let tmp = "";
|
|
164
|
+
let encValue = "";
|
|
165
|
+
if (pv == null) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
else if (Array.isArray(pv)) {
|
|
169
|
+
encValue = JSON.stringify(pv, jsonReplacer);
|
|
170
|
+
}
|
|
171
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(pv)) {
|
|
172
|
+
encValue = JSON.stringify(pv, jsonReplacer);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
encValue = `${encodeValue(pv)}`;
|
|
176
|
+
}
|
|
177
|
+
tmp = `${encodeString(pk)}=${encValue}`;
|
|
178
|
+
// If we end up with the nothing then skip forward
|
|
179
|
+
if (!tmp || tmp === "=") {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
out += `&${tmp}`;
|
|
183
|
+
});
|
|
184
|
+
return out.slice(1);
|
|
185
|
+
}
|
|
186
|
+
function encodeDeepObject(key, value, options) {
|
|
187
|
+
if (value == null) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (!(0, is_plain_object_js_1.isPlainObject)(value)) {
|
|
191
|
+
throw new EncodingError(`Value of parameter '${key}' which uses deepObject encoding must be an object or null`);
|
|
192
|
+
}
|
|
193
|
+
return encodeDeepObjectObject(key, value, options);
|
|
194
|
+
}
|
|
195
|
+
function encodeDeepObjectObject(key, value, options) {
|
|
196
|
+
if (value == null) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
let out = "";
|
|
200
|
+
const encodeString = (v) => {
|
|
201
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
202
|
+
};
|
|
203
|
+
if (!(0, is_plain_object_js_1.isPlainObject)(value)) {
|
|
204
|
+
throw new EncodingError(`Expected parameter '${key}' to be an object.`);
|
|
205
|
+
}
|
|
206
|
+
Object.entries(value).forEach(([ck, cv]) => {
|
|
207
|
+
if (cv == null) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const pk = `${key}[${ck}]`;
|
|
211
|
+
if ((0, is_plain_object_js_1.isPlainObject)(cv)) {
|
|
212
|
+
const objOut = encodeDeepObjectObject(pk, cv, options);
|
|
213
|
+
out += objOut == null ? "" : `&${objOut}`;
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const pairs = Array.isArray(cv) ? cv : [cv];
|
|
217
|
+
const encoded = mapDefined(pairs, (v) => {
|
|
218
|
+
return `${encodeString(pk)}=${encodeString(serializeValue(v))}`;
|
|
219
|
+
})?.join("&");
|
|
220
|
+
out += encoded == null ? "" : `&${encoded}`;
|
|
221
|
+
});
|
|
222
|
+
return out.slice(1);
|
|
223
|
+
}
|
|
224
|
+
function encodeJSON(key, value, options) {
|
|
225
|
+
if (typeof value === "undefined") {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const encodeString = (v) => {
|
|
229
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
230
|
+
};
|
|
231
|
+
const encVal = encodeString(JSON.stringify(value, jsonReplacer));
|
|
232
|
+
return options?.explode ? encVal : `${encodeString(key)}=${encVal}`;
|
|
233
|
+
}
|
|
234
|
+
const encodeSimple = (key, value, options) => {
|
|
235
|
+
let out = "";
|
|
236
|
+
const pairs = options?.explode
|
|
237
|
+
? explode(key, value)
|
|
238
|
+
: [[key, value]];
|
|
239
|
+
if (pairs.every(([_, v]) => v == null)) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const encodeString = (v) => {
|
|
243
|
+
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
|
|
244
|
+
};
|
|
245
|
+
const encodeValue = (v) => encodeString(serializeValue(v));
|
|
246
|
+
pairs.forEach(([pk, pv]) => {
|
|
247
|
+
let tmp = "";
|
|
248
|
+
if (pv == null) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
else if (Array.isArray(pv)) {
|
|
252
|
+
tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
|
|
253
|
+
}
|
|
254
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(pv)) {
|
|
255
|
+
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
|
|
256
|
+
return `,${encodeString(k)},${encodeValue(v)}`;
|
|
257
|
+
});
|
|
258
|
+
tmp = mapped?.join("").slice(1);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
const k = options?.explode && (0, is_plain_object_js_1.isPlainObject)(value) ? `${pk}=` : "";
|
|
262
|
+
tmp = `${k}${encodeValue(pv)}`;
|
|
263
|
+
}
|
|
264
|
+
out += tmp ? `,${tmp}` : "";
|
|
265
|
+
});
|
|
266
|
+
return out.slice(1);
|
|
267
|
+
};
|
|
268
|
+
exports.encodeSimple = encodeSimple;
|
|
269
|
+
function explode(key, value) {
|
|
270
|
+
if (Array.isArray(value)) {
|
|
271
|
+
return value.map((v) => [key, v]);
|
|
272
|
+
}
|
|
273
|
+
else if ((0, is_plain_object_js_1.isPlainObject)(value)) {
|
|
274
|
+
const o = value ?? {};
|
|
275
|
+
return Object.entries(o).map(([k, v]) => [k, v]);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
return [[key, value]];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function serializeValue(value) {
|
|
282
|
+
if (value == null) {
|
|
283
|
+
return "";
|
|
284
|
+
}
|
|
285
|
+
else if (value instanceof Date) {
|
|
286
|
+
return value.toISOString();
|
|
287
|
+
}
|
|
288
|
+
else if (value instanceof Uint8Array) {
|
|
289
|
+
return (0, base64_js_1.bytesToBase64)(value);
|
|
290
|
+
}
|
|
291
|
+
else if (typeof value === "object") {
|
|
292
|
+
return JSON.stringify(value, jsonReplacer);
|
|
293
|
+
}
|
|
294
|
+
return `${value}`;
|
|
295
|
+
}
|
|
296
|
+
function jsonReplacer(_, value) {
|
|
297
|
+
if (value instanceof Uint8Array) {
|
|
298
|
+
return (0, base64_js_1.bytesToBase64)(value);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
return value;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function mapDefined(inp, mapper) {
|
|
305
|
+
const res = inp.reduce((acc, v) => {
|
|
306
|
+
if (v == null) {
|
|
307
|
+
return acc;
|
|
308
|
+
}
|
|
309
|
+
const m = mapper(v);
|
|
310
|
+
if (m == null) {
|
|
311
|
+
return acc;
|
|
312
|
+
}
|
|
313
|
+
acc.push(m);
|
|
314
|
+
return acc;
|
|
315
|
+
}, []);
|
|
316
|
+
return res.length ? res : null;
|
|
317
|
+
}
|
|
318
|
+
function mapDefinedEntries(inp, mapper) {
|
|
319
|
+
const acc = [];
|
|
320
|
+
for (const [k, v] of inp) {
|
|
321
|
+
if (v == null) {
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
const m = mapper([k, v]);
|
|
325
|
+
if (m == null) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
acc.push(m);
|
|
329
|
+
}
|
|
330
|
+
return acc.length ? acc : null;
|
|
331
|
+
}
|
|
332
|
+
function queryJoin(...args) {
|
|
333
|
+
return args.filter(Boolean).join("&");
|
|
334
|
+
}
|
|
335
|
+
function queryEncoder(f) {
|
|
336
|
+
const bulkEncode = function (values, options) {
|
|
337
|
+
const opts = {
|
|
338
|
+
...options,
|
|
339
|
+
explode: options?.explode ?? true,
|
|
340
|
+
charEncoding: options?.charEncoding ?? "percent",
|
|
341
|
+
};
|
|
342
|
+
const encoded = Object.entries(values).map(([key, value]) => {
|
|
343
|
+
return f(key, value, opts);
|
|
344
|
+
});
|
|
345
|
+
return queryJoin(...encoded);
|
|
346
|
+
};
|
|
347
|
+
return bulkEncode;
|
|
348
|
+
}
|
|
349
|
+
exports.encodeJSONQuery = queryEncoder(encodeJSON);
|
|
350
|
+
exports.encodeFormQuery = queryEncoder(exports.encodeForm);
|
|
351
|
+
exports.encodeSpaceDelimitedQuery = queryEncoder(exports.encodeSpaceDelimited);
|
|
352
|
+
exports.encodePipeDelimitedQuery = queryEncoder(exports.encodePipeDelimited);
|
|
353
|
+
exports.encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
|
|
354
|
+
function appendForm(fd, key, value, fileName) {
|
|
355
|
+
if (value == null) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
else if (value instanceof Blob && fileName) {
|
|
359
|
+
fd.append(key, value, fileName);
|
|
360
|
+
}
|
|
361
|
+
else if (value instanceof Blob) {
|
|
362
|
+
fd.append(key, value);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
fd.append(key, String(value));
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
//# sourceMappingURL=encodings.js.map
|