@orq-ai/node 3.0.0-rc.19 → 3.1.0-rc.26
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 +29 -40
- package/RUNTIMES.md +27 -1
- package/docs/sdks/deployments/README.md +86 -9
- package/docs/sdks/files/README.md +2 -170
- package/docs/sdks/orq/README.md +1 -1
- package/docs/sdks/prompts/README.md +97 -181
- package/docs/sdks/promptsnippets/README.md +463 -0
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +12 -7
- package/funcs/contactsCreate.js.map +1 -1
- package/funcs/deploymentsGetConfig.d.ts.map +1 -1
- package/funcs/deploymentsGetConfig.js +12 -7
- package/funcs/deploymentsGetConfig.js.map +1 -1
- package/funcs/deploymentsInvoke.d.ts +1 -7
- package/funcs/deploymentsInvoke.d.ts.map +1 -1
- package/funcs/deploymentsInvoke.js +17 -17
- package/funcs/deploymentsInvoke.js.map +1 -1
- package/funcs/{deploymentsAll.d.ts → deploymentsList.d.ts} +2 -2
- package/funcs/deploymentsList.d.ts.map +1 -0
- package/funcs/{deploymentsAll.js → deploymentsList.js} +18 -12
- package/funcs/deploymentsList.js.map +1 -0
- package/funcs/deploymentsMetricsCreate.d.ts.map +1 -1
- package/funcs/deploymentsMetricsCreate.js +12 -7
- package/funcs/deploymentsMetricsCreate.js.map +1 -1
- package/funcs/deploymentsStream.d.ts +16 -0
- package/funcs/deploymentsStream.d.ts.map +1 -0
- package/funcs/deploymentsStream.js +125 -0
- package/funcs/deploymentsStream.js.map +1 -0
- package/funcs/feedbackCreate.d.ts.map +1 -1
- package/funcs/feedbackCreate.js +12 -7
- package/funcs/feedbackCreate.js.map +1 -1
- package/funcs/filesDelete.d.ts.map +1 -1
- package/funcs/filesDelete.js +12 -7
- package/funcs/filesDelete.js.map +1 -1
- package/funcs/filesGet.d.ts.map +1 -1
- package/funcs/filesGet.js +12 -7
- package/funcs/filesGet.js.map +1 -1
- package/funcs/filesList.d.ts.map +1 -1
- package/funcs/filesList.js +16 -11
- package/funcs/filesList.js.map +1 -1
- package/funcs/filesUpload.d.ts.map +1 -1
- package/funcs/filesUpload.js +22 -16
- package/funcs/filesUpload.js.map +1 -1
- package/funcs/{promptsCreateVersion.d.ts → promptSnippetsCreate.d.ts} +3 -3
- package/funcs/promptSnippetsCreate.d.ts.map +1 -0
- package/funcs/{promptsGetAll.js → promptSnippetsCreate.js} +19 -14
- package/funcs/promptSnippetsCreate.js.map +1 -0
- package/funcs/{filesUpdate.d.ts → promptSnippetsDelete.d.ts} +3 -3
- package/funcs/{promptsCreateVersion.d.ts.map → promptSnippetsDelete.d.ts.map} +1 -1
- package/funcs/{promptsDuplicate.js → promptSnippetsDelete.js} +20 -15
- package/funcs/promptSnippetsDelete.js.map +1 -0
- package/funcs/{promptsGetAll.d.ts → promptSnippetsGet.d.ts} +3 -3
- package/funcs/promptSnippetsGet.d.ts.map +1 -0
- package/funcs/{promptSnippetsFindOne.js → promptSnippetsGet.js} +18 -13
- package/funcs/promptSnippetsGet.js.map +1 -0
- package/funcs/{promptSnippetsFindOne.d.ts → promptSnippetsGetByKey.d.ts} +3 -3
- package/funcs/promptSnippetsGetByKey.d.ts.map +1 -0
- package/funcs/promptSnippetsGetByKey.js +113 -0
- package/funcs/promptSnippetsGetByKey.js.map +1 -0
- package/funcs/promptSnippetsUpdate.d.ts +13 -0
- package/funcs/promptSnippetsUpdate.d.ts.map +1 -0
- package/funcs/{promptsCreateVersion.js → promptSnippetsUpdate.js} +25 -16
- package/funcs/promptSnippetsUpdate.js.map +1 -0
- package/funcs/promptsCreate.d.ts +1 -1
- package/funcs/promptsCreate.d.ts.map +1 -1
- package/funcs/promptsCreate.js +14 -9
- package/funcs/promptsCreate.js.map +1 -1
- package/funcs/promptsDelete.d.ts.map +1 -1
- package/funcs/promptsDelete.js +13 -8
- package/funcs/promptsDelete.js.map +1 -1
- package/funcs/{promptsGetOne.d.ts → promptsGet.d.ts} +3 -3
- package/funcs/promptsGet.d.ts.map +1 -0
- package/funcs/{promptsGetOne.js → promptsGet.js} +17 -12
- package/funcs/promptsGet.js.map +1 -0
- package/funcs/{promptsDuplicate.d.ts → promptsList.d.ts} +3 -3
- package/funcs/promptsList.d.ts.map +1 -0
- package/funcs/promptsList.js +113 -0
- package/funcs/promptsList.js.map +1 -0
- package/funcs/promptsUpdate.d.ts.map +1 -1
- package/funcs/promptsUpdate.js +13 -8
- package/funcs/promptsUpdate.js.map +1 -1
- package/funcs/remoteconfigGetConfig.d.ts.map +1 -1
- package/funcs/remoteconfigGetConfig.js +12 -7
- package/funcs/remoteconfigGetConfig.js.map +1 -1
- package/hooks/global.d.ts +5 -0
- package/hooks/global.d.ts.map +1 -0
- package/hooks/global.js +35 -0
- package/hooks/global.js.map +1 -0
- package/hooks/registration.d.ts.map +1 -1
- package/hooks/registration.js +2 -1
- package/hooks/registration.js.map +1 -1
- package/jsr.json +28 -0
- package/lib/config.d.ts +12 -4
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +5 -6
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts +10 -9
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +91 -66
- package/lib/encodings.js.map +1 -1
- package/lib/env.d.ts +13 -0
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +18 -2
- package/lib/env.js.map +1 -1
- package/lib/event-streams.js +2 -3
- package/lib/event-streams.js.map +1 -1
- package/lib/http.js +1 -2
- package/lib/http.js.map +1 -1
- package/lib/matchers.js +5 -6
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +1 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +11 -1
- package/lib/primitives.js.map +1 -1
- package/lib/retries.js +3 -5
- package/lib/retries.js.map +1 -1
- package/lib/schemas.d.ts +1 -1
- package/lib/schemas.d.ts.map +1 -1
- package/lib/schemas.js +4 -1
- package/lib/schemas.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +20 -18
- package/lib/sdks.js.map +1 -1
- package/lib/security.js +2 -3
- package/lib/security.js.map +1 -1
- package/lib/url.js +1 -1
- package/lib/url.js.map +1 -1
- package/models/errors/httpclienterrors.js +2 -2
- package/models/errors/httpclienterrors.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/updatepromptsnippet.d.ts +36 -0
- package/models/errors/updatepromptsnippet.d.ts.map +1 -0
- package/models/{operations/duplicateprompt.js → errors/updatepromptsnippet.js} +33 -23
- package/models/errors/updatepromptsnippet.js.map +1 -0
- package/models/operations/createcontact.d.ts +25 -0
- package/models/operations/createcontact.d.ts.map +1 -1
- package/models/operations/createcontact.js +30 -3
- package/models/operations/createcontact.js.map +1 -1
- package/models/operations/createfeedback.d.ts +25 -0
- package/models/operations/createfeedback.d.ts.map +1 -1
- package/models/operations/createfeedback.js +28 -1
- package/models/operations/createfeedback.js.map +1 -1
- package/models/operations/createprompt.d.ts +2199 -748
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +1628 -486
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/createpromptsnippet.d.ts +3490 -0
- package/models/operations/createpromptsnippet.d.ts.map +1 -0
- package/models/operations/createpromptsnippet.js +3018 -0
- package/models/operations/createpromptsnippet.js.map +1 -0
- package/models/operations/deleteprompt.d.ts +25 -0
- package/models/operations/deleteprompt.d.ts.map +1 -1
- package/models/operations/deleteprompt.js +28 -1
- package/models/operations/deleteprompt.js.map +1 -1
- package/models/operations/deletepromptsnippet.d.ts +57 -0
- package/models/operations/deletepromptsnippet.d.ts.map +1 -0
- package/models/operations/deletepromptsnippet.js +96 -0
- package/models/operations/deletepromptsnippet.js.map +1 -0
- package/models/operations/deploymentcreatemetric.d.ts +25 -0
- package/models/operations/deploymentcreatemetric.d.ts.map +1 -1
- package/models/operations/deploymentcreatemetric.js +29 -2
- package/models/operations/deploymentcreatemetric.js.map +1 -1
- package/models/operations/deploymentgetconfig.d.ts +25 -0
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +31 -4
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +23 -683
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +23 -614
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +40 -8
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +46 -13
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/deploymentstream.d.ts +1622 -0
- package/models/operations/deploymentstream.d.ts.map +1 -0
- package/models/operations/deploymentstream.js +1571 -0
- package/models/operations/deploymentstream.js.map +1 -0
- package/models/operations/filedelete.d.ts +25 -0
- package/models/operations/filedelete.d.ts.map +1 -1
- package/models/operations/filedelete.js +28 -1
- package/models/operations/filedelete.js.map +1 -1
- package/models/operations/fileget.d.ts +25 -0
- package/models/operations/fileget.d.ts.map +1 -1
- package/models/operations/fileget.js +30 -3
- package/models/operations/fileget.js.map +1 -1
- package/models/operations/filelist.d.ts +26 -5
- package/models/operations/filelist.d.ts.map +1 -1
- package/models/operations/filelist.js +32 -13
- package/models/operations/filelist.js.map +1 -1
- package/models/operations/fileupload.d.ts +25 -0
- package/models/operations/fileupload.d.ts.map +1 -1
- package/models/operations/fileupload.js +30 -3
- package/models/operations/fileupload.js.map +1 -1
- package/models/operations/findonebykeypromptsnippet.d.ts +2405 -0
- package/models/operations/findonebykeypromptsnippet.d.ts.map +1 -0
- package/models/operations/findonebykeypromptsnippet.js +2113 -0
- package/models/operations/findonebykeypromptsnippet.js.map +1 -0
- package/models/operations/findonepromptsnippet.d.ts +891 -4764
- package/models/operations/findonepromptsnippet.d.ts.map +1 -1
- package/models/operations/findonepromptsnippet.js +966 -4752
- package/models/operations/findonepromptsnippet.js.map +1 -1
- package/models/operations/getallprompts.d.ts +907 -9115
- package/models/operations/getallprompts.d.ts.map +1 -1
- package/models/operations/getallprompts.js +923 -8166
- package/models/operations/getallprompts.js.map +1 -1
- package/models/operations/getoneprompt.d.ts +25 -0
- package/models/operations/getoneprompt.d.ts.map +1 -1
- package/models/operations/getoneprompt.js +28 -1
- package/models/operations/getoneprompt.js.map +1 -1
- package/models/operations/index.d.ts +5 -5
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -5
- package/models/operations/index.js.map +1 -1
- package/models/operations/remoteconfigsgetconfig.d.ts +25 -0
- package/models/operations/remoteconfigsgetconfig.d.ts.map +1 -1
- package/models/operations/remoteconfigsgetconfig.js +28 -1
- package/models/operations/remoteconfigsgetconfig.js.map +1 -1
- package/models/operations/updateprompt.d.ts +1363 -5103
- package/models/operations/updateprompt.d.ts.map +1 -1
- package/models/operations/updateprompt.js +1020 -4666
- package/models/operations/updateprompt.js.map +1 -1
- package/models/operations/updatepromptsnippet.d.ts +3518 -0
- package/models/operations/updatepromptsnippet.d.ts.map +1 -0
- package/models/operations/updatepromptsnippet.js +3076 -0
- package/models/operations/updatepromptsnippet.js.map +1 -0
- package/package.json +6 -7
- package/sdk/deployments.d.ts +10 -6
- package/sdk/deployments.d.ts.map +1 -1
- package/sdk/deployments.js +15 -8
- package/sdk/deployments.js.map +1 -1
- package/sdk/files.d.ts +0 -11
- package/sdk/files.d.ts.map +1 -1
- package/sdk/files.js +0 -17
- package/sdk/files.js.map +1 -1
- package/sdk/prompts.d.ts +7 -15
- package/sdk/prompts.d.ts.map +1 -1
- package/sdk/prompts.js +12 -26
- package/sdk/prompts.js.map +1 -1
- package/sdk/promptsnippets.d.ts +25 -0
- package/sdk/promptsnippets.d.ts.map +1 -0
- package/sdk/promptsnippets.js +47 -0
- package/sdk/promptsnippets.js.map +1 -0
- package/sdk/sdk.d.ts +3 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +9 -16
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/contactsCreate.ts +10 -4
- package/src/funcs/deploymentsGetConfig.ts +10 -4
- package/src/funcs/deploymentsInvoke.ts +26 -19
- package/src/funcs/{deploymentsAll.ts → deploymentsList.ts} +13 -6
- package/src/funcs/deploymentsMetricsCreate.ts +9 -3
- package/src/funcs/deploymentsStream.ts +150 -0
- package/src/funcs/feedbackCreate.ts +10 -4
- package/src/funcs/filesDelete.ts +9 -3
- package/src/funcs/filesGet.ts +9 -3
- package/src/funcs/filesList.ts +10 -4
- package/src/funcs/filesUpload.ts +15 -7
- package/src/funcs/{promptsCreateVersion.ts → promptSnippetsCreate.ts} +23 -20
- package/src/funcs/{promptsDuplicate.ts → promptSnippetsDelete.ts} +17 -10
- package/src/funcs/{promptSnippetsFindOne.ts → promptSnippetsGet.ts} +13 -7
- package/src/funcs/promptSnippetsGetByKey.ts +136 -0
- package/src/funcs/{filesUpdate.ts → promptSnippetsUpdate.ts} +29 -14
- package/src/funcs/promptsCreate.ts +12 -6
- package/src/funcs/promptsDelete.ts +10 -4
- package/src/funcs/{promptsGetOne.ts → promptsGet.ts} +12 -6
- package/src/funcs/{promptsGetAll.ts → promptsList.ts} +24 -16
- package/src/funcs/promptsUpdate.ts +10 -4
- package/src/funcs/remoteconfigGetConfig.ts +10 -4
- package/src/hooks/global.ts +38 -0
- package/src/hooks/registration.ts +2 -1
- package/src/lib/config.ts +14 -4
- package/src/lib/encodings.ts +95 -61
- package/src/lib/env.ts +32 -0
- package/src/lib/primitives.ts +14 -0
- package/src/lib/retries.ts +0 -1
- package/src/lib/schemas.ts +5 -0
- package/src/lib/sdks.ts +6 -3
- package/src/lib/security.ts +1 -1
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/updatepromptsnippet.ts +71 -0
- package/src/models/operations/createcontact.ts +60 -2
- package/src/models/operations/createfeedback.ts +58 -0
- package/src/models/operations/createprompt.ts +3795 -1345
- package/src/models/operations/createpromptsnippet.ts +6189 -0
- package/src/models/operations/deleteprompt.ts +58 -0
- package/src/models/operations/deletepromptsnippet.ts +127 -0
- package/src/models/operations/deploymentcreatemetric.ts +60 -0
- package/src/models/operations/deploymentgetconfig.ts +58 -0
- package/src/models/operations/deploymentinvoke.ts +182 -1423
- package/src/models/operations/deployments.ts +83 -18
- package/src/models/operations/deploymentstream.ts +3062 -0
- package/src/models/operations/filedelete.ts +58 -0
- package/src/models/operations/fileget.ts +56 -2
- package/src/models/operations/filelist.ts +61 -17
- package/src/models/operations/fileupload.ts +60 -2
- package/src/models/operations/findonebykeypromptsnippet.ts +4461 -0
- package/src/models/operations/findonepromptsnippet.ts +1779 -11084
- package/src/models/operations/getallprompts.ts +1595 -16105
- package/src/models/operations/getoneprompt.ts +58 -0
- package/src/models/operations/index.ts +5 -5
- package/src/models/operations/remoteconfigsgetconfig.ts +60 -0
- package/src/models/operations/updateprompt.ts +2571 -10999
- package/src/models/operations/updatepromptsnippet.ts +6483 -0
- package/src/sdk/deployments.ts +25 -11
- package/src/sdk/files.ts +0 -33
- package/src/sdk/prompts.ts +15 -45
- package/src/sdk/promptsnippets.ts +84 -0
- package/src/sdk/sdk.ts +4 -4
- package/tsconfig.json +41 -0
- package/docs/sdks/prompt/README.md +0 -6
- package/docs/sdks/snippets/README.md +0 -84
- package/docs/sdks/templates/README.md +0 -80
- package/funcs/deploymentsAll.d.ts.map +0 -1
- package/funcs/deploymentsAll.js.map +0 -1
- package/funcs/filesBulkUpload.d.ts +0 -15
- package/funcs/filesBulkUpload.d.ts.map +0 -1
- package/funcs/filesBulkUpload.js +0 -107
- package/funcs/filesBulkUpload.js.map +0 -1
- package/funcs/filesUpdate.d.ts.map +0 -1
- package/funcs/filesUpdate.js +0 -109
- package/funcs/filesUpdate.js.map +0 -1
- package/funcs/promptSnippetsFindOne.d.ts.map +0 -1
- package/funcs/promptSnippetsFindOne.js.map +0 -1
- package/funcs/promptTemplatesGetAll.d.ts +0 -12
- package/funcs/promptTemplatesGetAll.d.ts.map +0 -1
- package/funcs/promptTemplatesGetAll.js +0 -108
- package/funcs/promptTemplatesGetAll.js.map +0 -1
- package/funcs/promptsCreateVersion.js.map +0 -1
- package/funcs/promptsDuplicate.d.ts.map +0 -1
- package/funcs/promptsDuplicate.js.map +0 -1
- package/funcs/promptsGetAll.d.ts.map +0 -1
- package/funcs/promptsGetAll.js.map +0 -1
- package/funcs/promptsGetOne.d.ts.map +0 -1
- package/funcs/promptsGetOne.js.map +0 -1
- package/models/operations/bulkfileupload.d.ts +0 -173
- package/models/operations/bulkfileupload.d.ts.map +0 -1
- package/models/operations/bulkfileupload.js +0 -210
- package/models/operations/bulkfileupload.js.map +0 -1
- package/models/operations/createpromptversion.d.ts +0 -2003
- package/models/operations/createpromptversion.d.ts.map +0 -1
- package/models/operations/createpromptversion.js +0 -1852
- package/models/operations/createpromptversion.js.map +0 -1
- package/models/operations/duplicateprompt.d.ts +0 -32
- package/models/operations/duplicateprompt.d.ts.map +0 -1
- package/models/operations/duplicateprompt.js.map +0 -1
- package/models/operations/fileupdate.d.ts +0 -143
- package/models/operations/fileupdate.d.ts.map +0 -1
- package/models/operations/fileupdate.js +0 -193
- package/models/operations/fileupdate.js.map +0 -1
- package/models/operations/getallprompttemplates.d.ts +0 -6607
- package/models/operations/getallprompttemplates.d.ts.map +0 -1
- package/models/operations/getallprompttemplates.js +0 -6225
- package/models/operations/getallprompttemplates.js.map +0 -1
- package/sdk/prompt.d.ts +0 -10
- package/sdk/prompt.d.ts.map +0 -1
- package/sdk/prompt.js +0 -21
- package/sdk/prompt.js.map +0 -1
- package/sdk/snippets.d.ts +0 -9
- package/sdk/snippets.d.ts.map +0 -1
- package/sdk/snippets.js +0 -19
- package/sdk/snippets.js.map +0 -1
- package/sdk/templates.d.ts +0 -9
- package/sdk/templates.d.ts.map +0 -1
- package/sdk/templates.js +0 -19
- package/sdk/templates.js.map +0 -1
- package/src/funcs/filesBulkUpload.ts +0 -126
- package/src/funcs/promptTemplatesGetAll.ts +0 -130
- package/src/models/operations/bulkfileupload.ts +0 -315
- package/src/models/operations/createpromptversion.ts +0 -3703
- package/src/models/operations/duplicateprompt.ts +0 -69
- package/src/models/operations/fileupdate.ts +0 -298
- package/src/models/operations/getallprompttemplates.ts +0 -13690
- package/src/sdk/prompt.ts +0 -19
- package/src/sdk/snippets.ts +0 -24
- package/src/sdk/templates.ts +0 -24
package/src/funcs/filesUpload.ts
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
|
+
import { appendForm, encodeSimple } from "../lib/encodings.js";
|
|
6
7
|
import { readableStreamToArrayBuffer } from "../lib/files.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
10
|
import { safeParse } from "../lib/schemas.js";
|
|
9
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -59,13 +61,14 @@ export async function filesUpload(
|
|
|
59
61
|
|
|
60
62
|
if (payload?.file !== undefined) {
|
|
61
63
|
if (isBlobLike(payload?.file)) {
|
|
62
|
-
body
|
|
64
|
+
appendForm(body, "file", payload?.file);
|
|
63
65
|
} else if (isReadableStream(payload?.file.content)) {
|
|
64
66
|
const buffer = await readableStreamToArrayBuffer(payload?.file.content);
|
|
65
67
|
const blob = new Blob([buffer], { type: "application/octet-stream" });
|
|
66
|
-
body
|
|
68
|
+
appendForm(body, "file", blob);
|
|
67
69
|
} else {
|
|
68
|
-
|
|
70
|
+
appendForm(
|
|
71
|
+
body,
|
|
69
72
|
"file",
|
|
70
73
|
new Blob([payload?.file.content], { type: "application/octet-stream" }),
|
|
71
74
|
payload?.file.fileName,
|
|
@@ -73,14 +76,18 @@ export async function filesUpload(
|
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
if (payload?.purpose !== undefined) {
|
|
76
|
-
body
|
|
79
|
+
appendForm(body, "purpose", payload?.purpose);
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
const path = pathToFunc("/v2/files")();
|
|
80
83
|
|
|
81
|
-
const headers = new Headers({
|
|
84
|
+
const headers = new Headers(compactMap({
|
|
82
85
|
Accept: "application/json",
|
|
83
|
-
|
|
86
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "none",
|
|
89
|
+
}),
|
|
90
|
+
}));
|
|
84
91
|
|
|
85
92
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
86
93
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -135,7 +142,8 @@ export async function filesUpload(
|
|
|
135
142
|
| ConnectionError
|
|
136
143
|
>(
|
|
137
144
|
M.json(200, operations.FileUploadResponseBody$inboundSchema),
|
|
138
|
-
M.fail([400, "4XX"
|
|
145
|
+
M.fail([400, "4XX"]),
|
|
146
|
+
M.fail("5XX"),
|
|
139
147
|
)(response);
|
|
140
148
|
if (!result.ok) {
|
|
141
149
|
return result;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
6
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
9
|
import { safeParse } from "../lib/schemas.js";
|
|
9
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -22,15 +23,15 @@ import * as operations from "../models/operations/index.js";
|
|
|
22
23
|
import { Result } from "../types/fp.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* Create a
|
|
26
|
+
* Create a prompt snippet
|
|
26
27
|
*/
|
|
27
|
-
export async function
|
|
28
|
+
export async function promptSnippetsCreate(
|
|
28
29
|
client: OrqCore,
|
|
29
|
-
request
|
|
30
|
+
request?: operations.CreatePromptSnippetRequestBody | undefined,
|
|
30
31
|
options?: RequestOptions,
|
|
31
32
|
): Promise<
|
|
32
33
|
Result<
|
|
33
|
-
operations.
|
|
34
|
+
operations.CreatePromptSnippetResponseBody,
|
|
34
35
|
| APIError
|
|
35
36
|
| SDKValidationError
|
|
36
37
|
| UnexpectedClientError
|
|
@@ -43,35 +44,36 @@ export async function promptsCreateVersion(
|
|
|
43
44
|
const parsed = safeParse(
|
|
44
45
|
request,
|
|
45
46
|
(value) =>
|
|
46
|
-
operations.
|
|
47
|
+
operations.CreatePromptSnippetRequestBody$outboundSchema.optional().parse(
|
|
48
|
+
value,
|
|
49
|
+
),
|
|
47
50
|
"Input validation failed",
|
|
48
51
|
);
|
|
49
52
|
if (!parsed.ok) {
|
|
50
53
|
return parsed;
|
|
51
54
|
}
|
|
52
55
|
const payload = parsed.value;
|
|
53
|
-
const body =
|
|
56
|
+
const body = payload === undefined
|
|
57
|
+
? null
|
|
58
|
+
: encodeJSON("body", payload, { explode: true });
|
|
54
59
|
|
|
55
|
-
const
|
|
56
|
-
id: encodeSimple("id", payload.id, {
|
|
57
|
-
explode: false,
|
|
58
|
-
charEncoding: "percent",
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const path = pathToFunc("/v2/resources/prompts/{id}/versions")(pathParams);
|
|
60
|
+
const path = pathToFunc("/v2/resources/prompts/snippets")();
|
|
63
61
|
|
|
64
|
-
const headers = new Headers({
|
|
62
|
+
const headers = new Headers(compactMap({
|
|
65
63
|
"Content-Type": "application/json",
|
|
66
64
|
Accept: "application/json",
|
|
67
|
-
|
|
65
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
66
|
+
explode: false,
|
|
67
|
+
charEncoding: "none",
|
|
68
|
+
}),
|
|
69
|
+
}));
|
|
68
70
|
|
|
69
71
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
70
72
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
71
73
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
72
74
|
|
|
73
75
|
const context = {
|
|
74
|
-
operationID: "
|
|
76
|
+
operationID: "CreatePromptSnippet",
|
|
75
77
|
oAuth2Scopes: [],
|
|
76
78
|
|
|
77
79
|
resolvedSecurity: requestSecurity,
|
|
@@ -109,7 +111,7 @@ export async function promptsCreateVersion(
|
|
|
109
111
|
const response = doResult.value;
|
|
110
112
|
|
|
111
113
|
const [result] = await M.match<
|
|
112
|
-
operations.
|
|
114
|
+
operations.CreatePromptSnippetResponseBody,
|
|
113
115
|
| APIError
|
|
114
116
|
| SDKValidationError
|
|
115
117
|
| UnexpectedClientError
|
|
@@ -118,8 +120,9 @@ export async function promptsCreateVersion(
|
|
|
118
120
|
| RequestTimeoutError
|
|
119
121
|
| ConnectionError
|
|
120
122
|
>(
|
|
121
|
-
M.json(200, operations.
|
|
122
|
-
M.fail(
|
|
123
|
+
M.json(200, operations.CreatePromptSnippetResponseBody$inboundSchema),
|
|
124
|
+
M.fail("4XX"),
|
|
125
|
+
M.fail("5XX"),
|
|
123
126
|
)(response);
|
|
124
127
|
if (!result.ok) {
|
|
125
128
|
return result;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod";
|
|
|
6
6
|
import { OrqCore } from "../core.js";
|
|
7
7
|
import { encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
10
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -23,11 +24,11 @@ import * as operations from "../models/operations/index.js";
|
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Delete a prompt snippet
|
|
27
28
|
*/
|
|
28
|
-
export async function
|
|
29
|
+
export async function promptSnippetsDelete(
|
|
29
30
|
client: OrqCore,
|
|
30
|
-
request: operations.
|
|
31
|
+
request: operations.DeletePromptSnippetRequest,
|
|
31
32
|
options?: RequestOptions,
|
|
32
33
|
): Promise<
|
|
33
34
|
Result<
|
|
@@ -43,7 +44,8 @@ export async function promptsDuplicate(
|
|
|
43
44
|
> {
|
|
44
45
|
const parsed = safeParse(
|
|
45
46
|
request,
|
|
46
|
-
(value) =>
|
|
47
|
+
(value) =>
|
|
48
|
+
operations.DeletePromptSnippetRequest$outboundSchema.parse(value),
|
|
47
49
|
"Input validation failed",
|
|
48
50
|
);
|
|
49
51
|
if (!parsed.ok) {
|
|
@@ -59,18 +61,22 @@ export async function promptsDuplicate(
|
|
|
59
61
|
}),
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
const path = pathToFunc("/v2/resources/prompts/{id}
|
|
64
|
+
const path = pathToFunc("/v2/resources/prompts/snippets/{id}")(pathParams);
|
|
63
65
|
|
|
64
|
-
const headers = new Headers({
|
|
66
|
+
const headers = new Headers(compactMap({
|
|
65
67
|
Accept: "*/*",
|
|
66
|
-
|
|
68
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
69
|
+
explode: false,
|
|
70
|
+
charEncoding: "none",
|
|
71
|
+
}),
|
|
72
|
+
}));
|
|
67
73
|
|
|
68
74
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
75
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
70
76
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
77
|
|
|
72
78
|
const context = {
|
|
73
|
-
operationID: "
|
|
79
|
+
operationID: "DeletePromptSnippet",
|
|
74
80
|
oAuth2Scopes: [],
|
|
75
81
|
|
|
76
82
|
resolvedSecurity: requestSecurity,
|
|
@@ -84,7 +90,7 @@ export async function promptsDuplicate(
|
|
|
84
90
|
|
|
85
91
|
const requestRes = client._createRequest(context, {
|
|
86
92
|
security: requestSecurity,
|
|
87
|
-
method: "
|
|
93
|
+
method: "DELETE",
|
|
88
94
|
baseURL: options?.serverURL,
|
|
89
95
|
path: path,
|
|
90
96
|
headers: headers,
|
|
@@ -118,7 +124,8 @@ export async function promptsDuplicate(
|
|
|
118
124
|
| ConnectionError
|
|
119
125
|
>(
|
|
120
126
|
M.nil(200, z.void()),
|
|
121
|
-
M.fail(
|
|
127
|
+
M.fail("4XX"),
|
|
128
|
+
M.fail("5XX"),
|
|
122
129
|
)(response);
|
|
123
130
|
if (!result.ok) {
|
|
124
131
|
return result;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
9
|
import { safeParse } from "../lib/schemas.js";
|
|
9
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -22,9 +23,9 @@ import * as operations from "../models/operations/index.js";
|
|
|
22
23
|
import { Result } from "../types/fp.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
+
* Retrieve a prompt snippet
|
|
26
27
|
*/
|
|
27
|
-
export async function
|
|
28
|
+
export async function promptSnippetsGet(
|
|
28
29
|
client: OrqCore,
|
|
29
30
|
request: operations.FindOnePromptSnippetRequest,
|
|
30
31
|
options?: RequestOptions,
|
|
@@ -53,17 +54,21 @@ export async function promptSnippetsFindOne(
|
|
|
53
54
|
const body = null;
|
|
54
55
|
|
|
55
56
|
const pathParams = {
|
|
56
|
-
|
|
57
|
+
id: encodeSimple("id", payload.id, {
|
|
57
58
|
explode: false,
|
|
58
59
|
charEncoding: "percent",
|
|
59
60
|
}),
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
const path = pathToFunc("/v2/resources/prompts/snippets/{
|
|
63
|
+
const path = pathToFunc("/v2/resources/prompts/snippets/{id}")(pathParams);
|
|
63
64
|
|
|
64
|
-
const headers = new Headers({
|
|
65
|
+
const headers = new Headers(compactMap({
|
|
65
66
|
Accept: "application/json",
|
|
66
|
-
|
|
67
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
68
|
+
explode: false,
|
|
69
|
+
charEncoding: "none",
|
|
70
|
+
}),
|
|
71
|
+
}));
|
|
67
72
|
|
|
68
73
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
74
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -118,7 +123,8 @@ export async function promptSnippetsFindOne(
|
|
|
118
123
|
| ConnectionError
|
|
119
124
|
>(
|
|
120
125
|
M.json(200, operations.FindOnePromptSnippetResponseBody$inboundSchema),
|
|
121
|
-
M.fail([400, 404, "4XX"
|
|
126
|
+
M.fail([400, 404, "4XX"]),
|
|
127
|
+
M.fail("5XX"),
|
|
122
128
|
)(response);
|
|
123
129
|
if (!result.ok) {
|
|
124
130
|
return result;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a prompt snippet by key
|
|
27
|
+
*/
|
|
28
|
+
export async function promptSnippetsGetByKey(
|
|
29
|
+
client: OrqCore,
|
|
30
|
+
request: operations.FindOneByKeyPromptSnippetRequest,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): Promise<
|
|
33
|
+
Result<
|
|
34
|
+
operations.FindOneByKeyPromptSnippetResponseBody,
|
|
35
|
+
| APIError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) =>
|
|
47
|
+
operations.FindOneByKeyPromptSnippetRequest$outboundSchema.parse(value),
|
|
48
|
+
"Input validation failed",
|
|
49
|
+
);
|
|
50
|
+
if (!parsed.ok) {
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const payload = parsed.value;
|
|
54
|
+
const body = null;
|
|
55
|
+
|
|
56
|
+
const pathParams = {
|
|
57
|
+
key: encodeSimple("key", payload.key, {
|
|
58
|
+
explode: false,
|
|
59
|
+
charEncoding: "percent",
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const path = pathToFunc("/v2/resources/prompts/snippets/key/{key}")(
|
|
64
|
+
pathParams,
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const headers = new Headers(compactMap({
|
|
68
|
+
Accept: "application/json",
|
|
69
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
70
|
+
explode: false,
|
|
71
|
+
charEncoding: "none",
|
|
72
|
+
}),
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
77
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
|
+
|
|
79
|
+
const context = {
|
|
80
|
+
operationID: "FindOneByKeyPromptSnippet",
|
|
81
|
+
oAuth2Scopes: [],
|
|
82
|
+
|
|
83
|
+
resolvedSecurity: requestSecurity,
|
|
84
|
+
|
|
85
|
+
securitySource: client._options.apiKey,
|
|
86
|
+
retryConfig: options?.retries
|
|
87
|
+
|| client._options.retryConfig
|
|
88
|
+
|| { strategy: "none" },
|
|
89
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const requestRes = client._createRequest(context, {
|
|
93
|
+
security: requestSecurity,
|
|
94
|
+
method: "GET",
|
|
95
|
+
baseURL: options?.serverURL,
|
|
96
|
+
path: path,
|
|
97
|
+
headers: headers,
|
|
98
|
+
body: body,
|
|
99
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
100
|
+
}, options);
|
|
101
|
+
if (!requestRes.ok) {
|
|
102
|
+
return requestRes;
|
|
103
|
+
}
|
|
104
|
+
const req = requestRes.value;
|
|
105
|
+
|
|
106
|
+
const doResult = await client._do(req, {
|
|
107
|
+
context,
|
|
108
|
+
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
109
|
+
retryConfig: context.retryConfig,
|
|
110
|
+
retryCodes: context.retryCodes,
|
|
111
|
+
});
|
|
112
|
+
if (!doResult.ok) {
|
|
113
|
+
return doResult;
|
|
114
|
+
}
|
|
115
|
+
const response = doResult.value;
|
|
116
|
+
|
|
117
|
+
const [result] = await M.match<
|
|
118
|
+
operations.FindOneByKeyPromptSnippetResponseBody,
|
|
119
|
+
| APIError
|
|
120
|
+
| SDKValidationError
|
|
121
|
+
| UnexpectedClientError
|
|
122
|
+
| InvalidRequestError
|
|
123
|
+
| RequestAbortedError
|
|
124
|
+
| RequestTimeoutError
|
|
125
|
+
| ConnectionError
|
|
126
|
+
>(
|
|
127
|
+
M.json(200, operations.FindOneByKeyPromptSnippetResponseBody$inboundSchema),
|
|
128
|
+
M.fail([400, 404, "4XX"]),
|
|
129
|
+
M.fail("5XX"),
|
|
130
|
+
)(response);
|
|
131
|
+
if (!result.ok) {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
6
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
9
|
import { safeParse } from "../lib/schemas.js";
|
|
9
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -17,20 +18,22 @@ import {
|
|
|
17
18
|
RequestTimeoutError,
|
|
18
19
|
UnexpectedClientError,
|
|
19
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
20
22
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
23
|
import * as operations from "../models/operations/index.js";
|
|
22
24
|
import { Result } from "../types/fp.js";
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
|
-
* Update
|
|
27
|
+
* Update a prompt snippet
|
|
26
28
|
*/
|
|
27
|
-
export async function
|
|
29
|
+
export async function promptSnippetsUpdate(
|
|
28
30
|
client: OrqCore,
|
|
29
|
-
request: operations.
|
|
31
|
+
request: operations.UpdatePromptSnippetRequest,
|
|
30
32
|
options?: RequestOptions,
|
|
31
33
|
): Promise<
|
|
32
34
|
Result<
|
|
33
|
-
operations.
|
|
35
|
+
operations.UpdatePromptSnippetResponseBody,
|
|
36
|
+
| errors.UpdatePromptSnippetResponseBody
|
|
34
37
|
| APIError
|
|
35
38
|
| SDKValidationError
|
|
36
39
|
| UnexpectedClientError
|
|
@@ -42,7 +45,8 @@ export async function filesUpdate(
|
|
|
42
45
|
> {
|
|
43
46
|
const parsed = safeParse(
|
|
44
47
|
request,
|
|
45
|
-
(value) =>
|
|
48
|
+
(value) =>
|
|
49
|
+
operations.UpdatePromptSnippetRequest$outboundSchema.parse(value),
|
|
46
50
|
"Input validation failed",
|
|
47
51
|
);
|
|
48
52
|
if (!parsed.ok) {
|
|
@@ -52,25 +56,29 @@ export async function filesUpdate(
|
|
|
52
56
|
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
53
57
|
|
|
54
58
|
const pathParams = {
|
|
55
|
-
|
|
59
|
+
id: encodeSimple("id", payload.id, {
|
|
56
60
|
explode: false,
|
|
57
61
|
charEncoding: "percent",
|
|
58
62
|
}),
|
|
59
63
|
};
|
|
60
64
|
|
|
61
|
-
const path = pathToFunc("/v2/
|
|
65
|
+
const path = pathToFunc("/v2/resources/prompts/snippets/{id}")(pathParams);
|
|
62
66
|
|
|
63
|
-
const headers = new Headers({
|
|
67
|
+
const headers = new Headers(compactMap({
|
|
64
68
|
"Content-Type": "application/json",
|
|
65
69
|
Accept: "application/json",
|
|
66
|
-
|
|
70
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
71
|
+
explode: false,
|
|
72
|
+
charEncoding: "none",
|
|
73
|
+
}),
|
|
74
|
+
}));
|
|
67
75
|
|
|
68
76
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
77
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
70
78
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
79
|
|
|
72
80
|
const context = {
|
|
73
|
-
operationID: "
|
|
81
|
+
operationID: "UpdatePromptSnippet",
|
|
74
82
|
oAuth2Scopes: [],
|
|
75
83
|
|
|
76
84
|
resolvedSecurity: requestSecurity,
|
|
@@ -107,8 +115,13 @@ export async function filesUpdate(
|
|
|
107
115
|
}
|
|
108
116
|
const response = doResult.value;
|
|
109
117
|
|
|
118
|
+
const responseFields = {
|
|
119
|
+
HttpMeta: { Response: response, Request: req },
|
|
120
|
+
};
|
|
121
|
+
|
|
110
122
|
const [result] = await M.match<
|
|
111
|
-
operations.
|
|
123
|
+
operations.UpdatePromptSnippetResponseBody,
|
|
124
|
+
| errors.UpdatePromptSnippetResponseBody
|
|
112
125
|
| APIError
|
|
113
126
|
| SDKValidationError
|
|
114
127
|
| UnexpectedClientError
|
|
@@ -117,9 +130,11 @@ export async function filesUpdate(
|
|
|
117
130
|
| RequestTimeoutError
|
|
118
131
|
| ConnectionError
|
|
119
132
|
>(
|
|
120
|
-
M.json(200, operations.
|
|
121
|
-
M.
|
|
122
|
-
|
|
133
|
+
M.json(200, operations.UpdatePromptSnippetResponseBody$inboundSchema),
|
|
134
|
+
M.jsonErr(404, errors.UpdatePromptSnippetResponseBody$inboundSchema),
|
|
135
|
+
M.fail("4XX"),
|
|
136
|
+
M.fail("5XX"),
|
|
137
|
+
)(response, { extraFields: responseFields });
|
|
123
138
|
if (!result.ok) {
|
|
124
139
|
return result;
|
|
125
140
|
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
9
|
import { safeParse } from "../lib/schemas.js";
|
|
9
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -22,7 +23,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
22
23
|
import { Result } from "../types/fp.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* Create a
|
|
26
|
+
* Create a prompt
|
|
26
27
|
*/
|
|
27
28
|
export async function promptsCreate(
|
|
28
29
|
client: OrqCore,
|
|
@@ -54,12 +55,16 @@ export async function promptsCreate(
|
|
|
54
55
|
? null
|
|
55
56
|
: encodeJSON("body", payload, { explode: true });
|
|
56
57
|
|
|
57
|
-
const path = pathToFunc("/v2/
|
|
58
|
+
const path = pathToFunc("/v2/prompts")();
|
|
58
59
|
|
|
59
|
-
const headers = new Headers({
|
|
60
|
+
const headers = new Headers(compactMap({
|
|
60
61
|
"Content-Type": "application/json",
|
|
61
62
|
Accept: "application/json",
|
|
62
|
-
|
|
63
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
64
|
+
explode: false,
|
|
65
|
+
charEncoding: "none",
|
|
66
|
+
}),
|
|
67
|
+
}));
|
|
63
68
|
|
|
64
69
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
65
70
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -114,7 +119,8 @@ export async function promptsCreate(
|
|
|
114
119
|
| ConnectionError
|
|
115
120
|
>(
|
|
116
121
|
M.json(200, operations.CreatePromptResponseBody$inboundSchema),
|
|
117
|
-
M.fail(
|
|
122
|
+
M.fail("4XX"),
|
|
123
|
+
M.fail("5XX"),
|
|
118
124
|
)(response);
|
|
119
125
|
if (!result.ok) {
|
|
120
126
|
return result;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod";
|
|
|
6
6
|
import { OrqCore } from "../core.js";
|
|
7
7
|
import { encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
10
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -59,11 +60,15 @@ export async function promptsDelete(
|
|
|
59
60
|
}),
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
const path = pathToFunc("/v2/
|
|
63
|
+
const path = pathToFunc("/v2/prompts/{id}")(pathParams);
|
|
63
64
|
|
|
64
|
-
const headers = new Headers({
|
|
65
|
+
const headers = new Headers(compactMap({
|
|
65
66
|
Accept: "*/*",
|
|
66
|
-
|
|
67
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
68
|
+
explode: false,
|
|
69
|
+
charEncoding: "none",
|
|
70
|
+
}),
|
|
71
|
+
}));
|
|
67
72
|
|
|
68
73
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
74
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -118,7 +123,8 @@ export async function promptsDelete(
|
|
|
118
123
|
| ConnectionError
|
|
119
124
|
>(
|
|
120
125
|
M.nil(200, z.void()),
|
|
121
|
-
M.fail(
|
|
126
|
+
M.fail("4XX"),
|
|
127
|
+
M.fail("5XX"),
|
|
122
128
|
)(response);
|
|
123
129
|
if (!result.ok) {
|
|
124
130
|
return result;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod";
|
|
|
6
6
|
import { OrqCore } from "../core.js";
|
|
7
7
|
import { encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
10
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
@@ -23,9 +24,9 @@ import * as operations from "../models/operations/index.js";
|
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Retrieve a prompt
|
|
27
28
|
*/
|
|
28
|
-
export async function
|
|
29
|
+
export async function promptsGet(
|
|
29
30
|
client: OrqCore,
|
|
30
31
|
request: operations.GetOnePromptRequest,
|
|
31
32
|
options?: RequestOptions,
|
|
@@ -59,11 +60,15 @@ export async function promptsGetOne(
|
|
|
59
60
|
}),
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
const path = pathToFunc("/v2/
|
|
63
|
+
const path = pathToFunc("/v2/prompts/{id}")(pathParams);
|
|
63
64
|
|
|
64
|
-
const headers = new Headers({
|
|
65
|
+
const headers = new Headers(compactMap({
|
|
65
66
|
Accept: "*/*",
|
|
66
|
-
|
|
67
|
+
"contactId": encodeSimple("contactId", client._options.contactId, {
|
|
68
|
+
explode: false,
|
|
69
|
+
charEncoding: "none",
|
|
70
|
+
}),
|
|
71
|
+
}));
|
|
67
72
|
|
|
68
73
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
74
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -118,7 +123,8 @@ export async function promptsGetOne(
|
|
|
118
123
|
| ConnectionError
|
|
119
124
|
>(
|
|
120
125
|
M.nil(200, z.void()),
|
|
121
|
-
M.fail(
|
|
126
|
+
M.fail("4XX"),
|
|
127
|
+
M.fail("5XX"),
|
|
122
128
|
)(response);
|
|
123
129
|
if (!result.ok) {
|
|
124
130
|
return result;
|