@orq-ai/node 1.32.0-rc.5 → 1.32.0-rc.6
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 +30 -0
- package/docs/sdks/prompt/README.md +6 -0
- package/docs/sdks/prompts/README.md +533 -0
- package/docs/sdks/snippets/README.md +84 -0
- package/docs/sdks/templates/README.md +80 -0
- package/funcs/promptSnippetsFindOne.d.ts +12 -0
- package/funcs/promptSnippetsFindOne.d.ts.map +1 -0
- package/funcs/promptSnippetsFindOne.js +108 -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 +108 -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 +105 -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 +109 -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 +109 -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 +109 -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 +108 -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 +109 -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 +113 -0
- package/funcs/promptsUpdate.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- 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/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.js +2 -2
- package/models/operations/createcontact.js +2 -2
- 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 +2001 -0
- package/models/operations/createpromptversion.d.ts.map +1 -0
- package/models/operations/createpromptversion.js +1848 -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/deploymentgetconfig.d.ts +96 -96
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +136 -135
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +46 -49
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +61 -63
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +53 -53
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +66 -67
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/duplicateprompt.d.ts +32 -0
- package/models/operations/duplicateprompt.d.ts.map +1 -0
- package/models/operations/duplicateprompt.js +69 -0
- package/models/operations/duplicateprompt.js.map +1 -0
- package/models/operations/fileupload.js +2 -2
- 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 +6613 -0
- package/models/operations/getallprompts.d.ts.map +1 -0
- package/models/operations/getallprompts.js +6161 -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 +9 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +9 -0
- package/models/operations/index.js.map +1 -1
- 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 +1 -1
- package/sdk/prompt.d.ts +10 -0
- package/sdk/prompt.d.ts.map +1 -0
- package/sdk/prompt.js +21 -0
- package/sdk/prompt.js.map +1 -0
- package/sdk/prompts.d.ts +33 -0
- package/sdk/prompts.d.ts.map +1 -0
- package/sdk/prompts.js +61 -0
- package/sdk/prompts.js.map +1 -0
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +10 -0
- package/sdk/sdk.js.map +1 -1
- 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/funcs/promptSnippetsFindOne.ts +128 -0
- package/src/funcs/promptTemplatesGetAll.ts +130 -0
- package/src/funcs/promptsCreate.ts +124 -0
- package/src/funcs/promptsCreateVersion.ts +129 -0
- package/src/funcs/promptsDelete.ts +128 -0
- package/src/funcs/promptsDuplicate.ts +128 -0
- package/src/funcs/promptsGetAll.ts +128 -0
- package/src/funcs/promptsGetOne.ts +128 -0
- package/src/funcs/promptsUpdate.ts +136 -0
- package/src/lib/config.ts +2 -2
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/updateprompt.ts +71 -0
- package/src/models/operations/bulkfileupload.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createprompt.ts +3455 -0
- package/src/models/operations/createpromptversion.ts +3697 -0
- package/src/models/operations/deleteprompt.ts +69 -0
- package/src/models/operations/deploymentgetconfig.ts +255 -188
- package/src/models/operations/deploymentinvoke.ts +95 -81
- package/src/models/operations/deployments.ts +101 -88
- package/src/models/operations/duplicateprompt.ts +69 -0
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/findonepromptsnippet.ts +13629 -0
- package/src/models/operations/getallprompts.ts +13390 -0
- package/src/models/operations/getallprompttemplates.ts +13690 -0
- package/src/models/operations/getoneprompt.ts +69 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/updateprompt.ts +14407 -0
- package/src/sdk/prompt.ts +19 -0
- package/src/sdk/prompts.ts +114 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/snippets.ts +24 -0
- package/src/sdk/templates.ts +24 -0
package/sdk/sdk.js
CHANGED
|
@@ -9,6 +9,8 @@ const contacts_js_1 = require("./contacts.js");
|
|
|
9
9
|
const deployments_js_1 = require("./deployments.js");
|
|
10
10
|
const feedback_js_1 = require("./feedback.js");
|
|
11
11
|
const files_js_1 = require("./files.js");
|
|
12
|
+
const prompt_js_1 = require("./prompt.js");
|
|
13
|
+
const prompts_js_1 = require("./prompts.js");
|
|
12
14
|
const remoteconfig_js_1 = require("./remoteconfig.js");
|
|
13
15
|
class Orq extends sdks_js_1.ClientSDK {
|
|
14
16
|
get contacts() {
|
|
@@ -27,6 +29,14 @@ class Orq extends sdks_js_1.ClientSDK {
|
|
|
27
29
|
var _a;
|
|
28
30
|
return ((_a = this._files) !== null && _a !== void 0 ? _a : (this._files = new files_js_1.Files(this._options)));
|
|
29
31
|
}
|
|
32
|
+
get prompt() {
|
|
33
|
+
var _a;
|
|
34
|
+
return ((_a = this._prompt) !== null && _a !== void 0 ? _a : (this._prompt = new prompt_js_1.Prompt(this._options)));
|
|
35
|
+
}
|
|
36
|
+
get prompts() {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new prompts_js_1.Prompts(this._options)));
|
|
39
|
+
}
|
|
30
40
|
get remoteconfig() {
|
|
31
41
|
var _a;
|
|
32
42
|
return ((_a = this._remoteconfig) !== null && _a !== void 0 ? _a : (this._remoteconfig = new remoteconfig_js_1.Remoteconfig(this._options)));
|
package/sdk/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk/sdk.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4CAA2C;AAC3C,+CAAyC;AACzC,qDAA+C;AAC/C,+CAAyC;AACzC,yCAAmC;AACnC,uDAAiD;AAEjD,MAAa,GAAI,SAAQ,mBAAS;IAEhC,IAAI,QAAQ;;QACV,OAAO,OAAC,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,sBAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,QAAQ;;QACV,OAAO,OAAC,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,sBAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,WAAW;;QACb,OAAO,OAAC,IAAI,CAAC,YAAY,oCAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,4BAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAChE,CAAC;IAGD,IAAI,KAAK;;QACP,OAAO,OAAC,IAAI,CAAC,MAAM,oCAAX,IAAI,CAAC,MAAM,GAAK,IAAI,gBAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACpD,CAAC;IAGD,IAAI,YAAY;;QACd,OAAO,OAAC,IAAI,CAAC,aAAa,oCAAlB,IAAI,CAAC,aAAa,GAAK,IAAI,8BAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAClE,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk/sdk.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4CAA2C;AAC3C,+CAAyC;AACzC,qDAA+C;AAC/C,+CAAyC;AACzC,yCAAmC;AACnC,2CAAqC;AACrC,6CAAuC;AACvC,uDAAiD;AAEjD,MAAa,GAAI,SAAQ,mBAAS;IAEhC,IAAI,QAAQ;;QACV,OAAO,OAAC,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,sBAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,QAAQ;;QACV,OAAO,OAAC,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,sBAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,WAAW;;QACb,OAAO,OAAC,IAAI,CAAC,YAAY,oCAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,4BAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAChE,CAAC;IAGD,IAAI,KAAK;;QACP,OAAO,OAAC,IAAI,CAAC,MAAM,oCAAX,IAAI,CAAC,MAAM,GAAK,IAAI,gBAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACpD,CAAC;IAGD,IAAI,MAAM;;QACR,OAAO,OAAC,IAAI,CAAC,OAAO,oCAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,kBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,OAAO;;QACT,OAAO,OAAC,IAAI,CAAC,QAAQ,oCAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACxD,CAAC;IAGD,IAAI,YAAY;;QACd,OAAO,OAAC,IAAI,CAAC,aAAa,oCAAlB,IAAI,CAAC,aAAa,GAAK,IAAI,8BAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAClE,CAAC;CACF;AAnCD,kBAmCC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as operations from "../models/operations/index.js";
|
|
3
|
+
export declare class Snippets extends ClientSDK {
|
|
4
|
+
/**
|
|
5
|
+
* Get one prompt snippet
|
|
6
|
+
*/
|
|
7
|
+
findOne(request: operations.FindOnePromptSnippetRequest, options?: RequestOptions): Promise<operations.FindOnePromptSnippetResponseBody>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../src/sdk/snippets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,QAAS,SAAQ,SAAS;IACrC;;OAEG;IACG,OAAO,CACX,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,gCAAgC,CAAC;CAOxD"}
|
package/sdk/snippets.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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.Snippets = void 0;
|
|
7
|
+
const promptSnippetsFindOne_js_1 = require("../funcs/promptSnippetsFindOne.js");
|
|
8
|
+
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
|
+
const fp_js_1 = require("../types/fp.js");
|
|
10
|
+
class Snippets extends sdks_js_1.ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Get one prompt snippet
|
|
13
|
+
*/
|
|
14
|
+
async findOne(request, options) {
|
|
15
|
+
return (0, fp_js_1.unwrapAsync)((0, promptSnippetsFindOne_js_1.promptSnippetsFindOne)(this, request, options));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.Snippets = Snippets;
|
|
19
|
+
//# sourceMappingURL=snippets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.js","sourceRoot":"","sources":["../src/sdk/snippets.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gFAA0E;AAC1E,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACrC;;OAEG;IACH,KAAK,CAAC,OAAO,CACX,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAdD,4BAcC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as operations from "../models/operations/index.js";
|
|
3
|
+
export declare class Templates extends ClientSDK {
|
|
4
|
+
/**
|
|
5
|
+
* Get all prompt templates
|
|
6
|
+
*/
|
|
7
|
+
getAll(request?: operations.GetAllPromptTemplatesRequest | undefined, options?: RequestOptions): Promise<operations.GetAllPromptTemplatesResponseBody>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/sdk/templates.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,SAAU,SAAQ,SAAS;IACtC;;OAEG;IACG,MAAM,CACV,OAAO,CAAC,EAAE,UAAU,CAAC,4BAA4B,GAAG,SAAS,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,iCAAiC,CAAC;CAOzD"}
|
package/sdk/templates.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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.Templates = void 0;
|
|
7
|
+
const promptTemplatesGetAll_js_1 = require("../funcs/promptTemplatesGetAll.js");
|
|
8
|
+
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
|
+
const fp_js_1 = require("../types/fp.js");
|
|
10
|
+
class Templates extends sdks_js_1.ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Get all prompt templates
|
|
13
|
+
*/
|
|
14
|
+
async getAll(request, options) {
|
|
15
|
+
return (0, fp_js_1.unwrapAsync)((0, promptTemplatesGetAll_js_1.promptTemplatesGetAll)(this, request, options));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.Templates = Templates;
|
|
19
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/sdk/templates.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gFAA0E;AAC1E,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,SAAU,SAAQ,mBAAS;IACtC;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAA6D,EAC7D,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAdD,8BAcC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
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 { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../models/operations/index.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get one prompt snippet
|
|
26
|
+
*/
|
|
27
|
+
export async function promptSnippetsFindOne(
|
|
28
|
+
client: OrqCore,
|
|
29
|
+
request: operations.FindOnePromptSnippetRequest,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.FindOnePromptSnippetResponseBody,
|
|
34
|
+
| APIError
|
|
35
|
+
| SDKValidationError
|
|
36
|
+
| UnexpectedClientError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
const parsed = safeParse(
|
|
44
|
+
request,
|
|
45
|
+
(value) =>
|
|
46
|
+
operations.FindOnePromptSnippetRequest$outboundSchema.parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = null;
|
|
54
|
+
|
|
55
|
+
const pathParams = {
|
|
56
|
+
key: encodeSimple("key", payload.key, {
|
|
57
|
+
explode: false,
|
|
58
|
+
charEncoding: "percent",
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const path = pathToFunc("/v2/resources/prompts/snippets/{key}")(pathParams);
|
|
63
|
+
|
|
64
|
+
const headers = new Headers({
|
|
65
|
+
Accept: "application/json",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
69
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
70
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
|
+
|
|
72
|
+
const context = {
|
|
73
|
+
operationID: "FindOnePromptSnippet",
|
|
74
|
+
oAuth2Scopes: [],
|
|
75
|
+
|
|
76
|
+
resolvedSecurity: requestSecurity,
|
|
77
|
+
|
|
78
|
+
securitySource: client._options.apiKey,
|
|
79
|
+
retryConfig: options?.retries
|
|
80
|
+
|| client._options.retryConfig
|
|
81
|
+
|| { strategy: "none" },
|
|
82
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const requestRes = client._createRequest(context, {
|
|
86
|
+
security: requestSecurity,
|
|
87
|
+
method: "GET",
|
|
88
|
+
baseURL: options?.serverURL,
|
|
89
|
+
path: path,
|
|
90
|
+
headers: headers,
|
|
91
|
+
body: body,
|
|
92
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
93
|
+
}, options);
|
|
94
|
+
if (!requestRes.ok) {
|
|
95
|
+
return requestRes;
|
|
96
|
+
}
|
|
97
|
+
const req = requestRes.value;
|
|
98
|
+
|
|
99
|
+
const doResult = await client._do(req, {
|
|
100
|
+
context,
|
|
101
|
+
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
102
|
+
retryConfig: context.retryConfig,
|
|
103
|
+
retryCodes: context.retryCodes,
|
|
104
|
+
});
|
|
105
|
+
if (!doResult.ok) {
|
|
106
|
+
return doResult;
|
|
107
|
+
}
|
|
108
|
+
const response = doResult.value;
|
|
109
|
+
|
|
110
|
+
const [result] = await M.match<
|
|
111
|
+
operations.FindOnePromptSnippetResponseBody,
|
|
112
|
+
| APIError
|
|
113
|
+
| SDKValidationError
|
|
114
|
+
| UnexpectedClientError
|
|
115
|
+
| InvalidRequestError
|
|
116
|
+
| RequestAbortedError
|
|
117
|
+
| RequestTimeoutError
|
|
118
|
+
| ConnectionError
|
|
119
|
+
>(
|
|
120
|
+
M.json(200, operations.FindOnePromptSnippetResponseBody$inboundSchema),
|
|
121
|
+
M.fail([400, 404, "4XX", "5XX"]),
|
|
122
|
+
)(response);
|
|
123
|
+
if (!result.ok) {
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../models/operations/index.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get all prompt templates
|
|
26
|
+
*/
|
|
27
|
+
export async function promptTemplatesGetAll(
|
|
28
|
+
client: OrqCore,
|
|
29
|
+
request?: operations.GetAllPromptTemplatesRequest | undefined,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.GetAllPromptTemplatesResponseBody,
|
|
34
|
+
| APIError
|
|
35
|
+
| SDKValidationError
|
|
36
|
+
| UnexpectedClientError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
const parsed = safeParse(
|
|
44
|
+
request,
|
|
45
|
+
(value) =>
|
|
46
|
+
operations.GetAllPromptTemplatesRequest$outboundSchema.optional().parse(
|
|
47
|
+
value,
|
|
48
|
+
),
|
|
49
|
+
"Input validation failed",
|
|
50
|
+
);
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = encodeJSON("body", payload?.RequestBody, { explode: true });
|
|
56
|
+
|
|
57
|
+
const path = pathToFunc("/v2/resources/prompts/templates/query")();
|
|
58
|
+
|
|
59
|
+
const query = encodeFormQuery({
|
|
60
|
+
"limit": payload?.limit,
|
|
61
|
+
"page": payload?.page,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const headers = new Headers({
|
|
65
|
+
"Content-Type": "application/json",
|
|
66
|
+
Accept: "application/json",
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
70
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
71
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
72
|
+
|
|
73
|
+
const context = {
|
|
74
|
+
operationID: "GetAllPromptTemplates",
|
|
75
|
+
oAuth2Scopes: [],
|
|
76
|
+
|
|
77
|
+
resolvedSecurity: requestSecurity,
|
|
78
|
+
|
|
79
|
+
securitySource: client._options.apiKey,
|
|
80
|
+
retryConfig: options?.retries
|
|
81
|
+
|| client._options.retryConfig
|
|
82
|
+
|| { strategy: "none" },
|
|
83
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const requestRes = client._createRequest(context, {
|
|
87
|
+
security: requestSecurity,
|
|
88
|
+
method: "POST",
|
|
89
|
+
baseURL: options?.serverURL,
|
|
90
|
+
path: path,
|
|
91
|
+
headers: headers,
|
|
92
|
+
query: query,
|
|
93
|
+
body: body,
|
|
94
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
95
|
+
}, options);
|
|
96
|
+
if (!requestRes.ok) {
|
|
97
|
+
return requestRes;
|
|
98
|
+
}
|
|
99
|
+
const req = requestRes.value;
|
|
100
|
+
|
|
101
|
+
const doResult = await client._do(req, {
|
|
102
|
+
context,
|
|
103
|
+
errorCodes: ["400", "4XX", "5XX"],
|
|
104
|
+
retryConfig: context.retryConfig,
|
|
105
|
+
retryCodes: context.retryCodes,
|
|
106
|
+
});
|
|
107
|
+
if (!doResult.ok) {
|
|
108
|
+
return doResult;
|
|
109
|
+
}
|
|
110
|
+
const response = doResult.value;
|
|
111
|
+
|
|
112
|
+
const [result] = await M.match<
|
|
113
|
+
operations.GetAllPromptTemplatesResponseBody,
|
|
114
|
+
| APIError
|
|
115
|
+
| SDKValidationError
|
|
116
|
+
| UnexpectedClientError
|
|
117
|
+
| InvalidRequestError
|
|
118
|
+
| RequestAbortedError
|
|
119
|
+
| RequestTimeoutError
|
|
120
|
+
| ConnectionError
|
|
121
|
+
>(
|
|
122
|
+
M.json(200, operations.GetAllPromptTemplatesResponseBody$inboundSchema),
|
|
123
|
+
M.fail([400, "4XX", "5XX"]),
|
|
124
|
+
)(response);
|
|
125
|
+
if (!result.ok) {
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../models/operations/index.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a new prompt
|
|
26
|
+
*/
|
|
27
|
+
export async function promptsCreate(
|
|
28
|
+
client: OrqCore,
|
|
29
|
+
request?: operations.CreatePromptRequestBody | undefined,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.CreatePromptResponseBody,
|
|
34
|
+
| APIError
|
|
35
|
+
| SDKValidationError
|
|
36
|
+
| UnexpectedClientError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
const parsed = safeParse(
|
|
44
|
+
request,
|
|
45
|
+
(value) =>
|
|
46
|
+
operations.CreatePromptRequestBody$outboundSchema.optional().parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = payload === undefined
|
|
54
|
+
? null
|
|
55
|
+
: encodeJSON("body", payload, { explode: true });
|
|
56
|
+
|
|
57
|
+
const path = pathToFunc("/v2/resources/prompts")();
|
|
58
|
+
|
|
59
|
+
const headers = new Headers({
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
Accept: "application/json",
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
65
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
66
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
67
|
+
|
|
68
|
+
const context = {
|
|
69
|
+
operationID: "CreatePrompt",
|
|
70
|
+
oAuth2Scopes: [],
|
|
71
|
+
|
|
72
|
+
resolvedSecurity: requestSecurity,
|
|
73
|
+
|
|
74
|
+
securitySource: client._options.apiKey,
|
|
75
|
+
retryConfig: options?.retries
|
|
76
|
+
|| client._options.retryConfig
|
|
77
|
+
|| { strategy: "none" },
|
|
78
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const requestRes = client._createRequest(context, {
|
|
82
|
+
security: requestSecurity,
|
|
83
|
+
method: "POST",
|
|
84
|
+
baseURL: options?.serverURL,
|
|
85
|
+
path: path,
|
|
86
|
+
headers: headers,
|
|
87
|
+
body: body,
|
|
88
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
89
|
+
}, options);
|
|
90
|
+
if (!requestRes.ok) {
|
|
91
|
+
return requestRes;
|
|
92
|
+
}
|
|
93
|
+
const req = requestRes.value;
|
|
94
|
+
|
|
95
|
+
const doResult = await client._do(req, {
|
|
96
|
+
context,
|
|
97
|
+
errorCodes: ["4XX", "5XX"],
|
|
98
|
+
retryConfig: context.retryConfig,
|
|
99
|
+
retryCodes: context.retryCodes,
|
|
100
|
+
});
|
|
101
|
+
if (!doResult.ok) {
|
|
102
|
+
return doResult;
|
|
103
|
+
}
|
|
104
|
+
const response = doResult.value;
|
|
105
|
+
|
|
106
|
+
const [result] = await M.match<
|
|
107
|
+
operations.CreatePromptResponseBody,
|
|
108
|
+
| APIError
|
|
109
|
+
| SDKValidationError
|
|
110
|
+
| UnexpectedClientError
|
|
111
|
+
| InvalidRequestError
|
|
112
|
+
| RequestAbortedError
|
|
113
|
+
| RequestTimeoutError
|
|
114
|
+
| ConnectionError
|
|
115
|
+
>(
|
|
116
|
+
M.json(200, operations.CreatePromptResponseBody$inboundSchema),
|
|
117
|
+
M.fail(["4XX", "5XX"]),
|
|
118
|
+
)(response);
|
|
119
|
+
if (!result.ok) {
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../models/operations/index.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a new prompt version
|
|
26
|
+
*/
|
|
27
|
+
export async function promptsCreateVersion(
|
|
28
|
+
client: OrqCore,
|
|
29
|
+
request: operations.CreatePromptVersionRequest,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.CreatePromptVersionResponseBody,
|
|
34
|
+
| APIError
|
|
35
|
+
| SDKValidationError
|
|
36
|
+
| UnexpectedClientError
|
|
37
|
+
| InvalidRequestError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
>
|
|
42
|
+
> {
|
|
43
|
+
const parsed = safeParse(
|
|
44
|
+
request,
|
|
45
|
+
(value) =>
|
|
46
|
+
operations.CreatePromptVersionRequest$outboundSchema.parse(value),
|
|
47
|
+
"Input validation failed",
|
|
48
|
+
);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
const payload = parsed.value;
|
|
53
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
54
|
+
|
|
55
|
+
const pathParams = {
|
|
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);
|
|
63
|
+
|
|
64
|
+
const headers = new Headers({
|
|
65
|
+
"Content-Type": "application/json",
|
|
66
|
+
Accept: "application/json",
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
70
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
71
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
72
|
+
|
|
73
|
+
const context = {
|
|
74
|
+
operationID: "CreatePromptVersion",
|
|
75
|
+
oAuth2Scopes: [],
|
|
76
|
+
|
|
77
|
+
resolvedSecurity: requestSecurity,
|
|
78
|
+
|
|
79
|
+
securitySource: client._options.apiKey,
|
|
80
|
+
retryConfig: options?.retries
|
|
81
|
+
|| client._options.retryConfig
|
|
82
|
+
|| { strategy: "none" },
|
|
83
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const requestRes = client._createRequest(context, {
|
|
87
|
+
security: requestSecurity,
|
|
88
|
+
method: "POST",
|
|
89
|
+
baseURL: options?.serverURL,
|
|
90
|
+
path: path,
|
|
91
|
+
headers: headers,
|
|
92
|
+
body: body,
|
|
93
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
94
|
+
}, options);
|
|
95
|
+
if (!requestRes.ok) {
|
|
96
|
+
return requestRes;
|
|
97
|
+
}
|
|
98
|
+
const req = requestRes.value;
|
|
99
|
+
|
|
100
|
+
const doResult = await client._do(req, {
|
|
101
|
+
context,
|
|
102
|
+
errorCodes: ["4XX", "5XX"],
|
|
103
|
+
retryConfig: context.retryConfig,
|
|
104
|
+
retryCodes: context.retryCodes,
|
|
105
|
+
});
|
|
106
|
+
if (!doResult.ok) {
|
|
107
|
+
return doResult;
|
|
108
|
+
}
|
|
109
|
+
const response = doResult.value;
|
|
110
|
+
|
|
111
|
+
const [result] = await M.match<
|
|
112
|
+
operations.CreatePromptVersionResponseBody,
|
|
113
|
+
| APIError
|
|
114
|
+
| SDKValidationError
|
|
115
|
+
| UnexpectedClientError
|
|
116
|
+
| InvalidRequestError
|
|
117
|
+
| RequestAbortedError
|
|
118
|
+
| RequestTimeoutError
|
|
119
|
+
| ConnectionError
|
|
120
|
+
>(
|
|
121
|
+
M.json(200, operations.CreatePromptVersionResponseBody$inboundSchema),
|
|
122
|
+
M.fail(["4XX", "5XX"]),
|
|
123
|
+
)(response);
|
|
124
|
+
if (!result.ok) {
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return result;
|
|
129
|
+
}
|