@orq-ai/node 1.31.1 → 1.31.11
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 +17 -45
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/errors/index.d.ts +0 -1
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -1
- package/models/errors/index.js.map +1 -1
- package/models/operations/bulkfileupload.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/deploymentgetconfig.d.ts +96 -96
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +135 -136
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +49 -46
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +63 -61
- 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 +67 -66
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/fileupload.js +2 -2
- package/models/operations/index.d.ts +0 -9
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -9
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sdk.d.ts +0 -6
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -10
- package/sdk/sdk.js.map +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/errors/index.ts +0 -1
- package/src/models/operations/bulkfileupload.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/deploymentgetconfig.ts +188 -255
- package/src/models/operations/deploymentinvoke.ts +81 -95
- package/src/models/operations/deployments.ts +88 -101
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/index.ts +0 -9
- package/src/sdk/sdk.ts +0 -12
- package/docs/sdks/prompt/README.md +0 -6
- package/docs/sdks/prompts/README.md +0 -533
- package/docs/sdks/snippets/README.md +0 -84
- package/docs/sdks/templates/README.md +0 -80
- package/funcs/promptSnippetsFindOne.d.ts +0 -12
- package/funcs/promptSnippetsFindOne.d.ts.map +0 -1
- package/funcs/promptSnippetsFindOne.js +0 -107
- 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 -107
- package/funcs/promptTemplatesGetAll.js.map +0 -1
- package/funcs/promptsCreate.d.ts +0 -12
- package/funcs/promptsCreate.d.ts.map +0 -1
- package/funcs/promptsCreate.js +0 -104
- package/funcs/promptsCreate.js.map +0 -1
- package/funcs/promptsCreateVersion.d.ts +0 -12
- package/funcs/promptsCreateVersion.d.ts.map +0 -1
- package/funcs/promptsCreateVersion.js +0 -108
- package/funcs/promptsCreateVersion.js.map +0 -1
- package/funcs/promptsDelete.d.ts +0 -12
- package/funcs/promptsDelete.d.ts.map +0 -1
- package/funcs/promptsDelete.js +0 -108
- package/funcs/promptsDelete.js.map +0 -1
- package/funcs/promptsDuplicate.d.ts +0 -12
- package/funcs/promptsDuplicate.d.ts.map +0 -1
- package/funcs/promptsDuplicate.js +0 -108
- package/funcs/promptsDuplicate.js.map +0 -1
- package/funcs/promptsGetAll.d.ts +0 -12
- package/funcs/promptsGetAll.d.ts.map +0 -1
- package/funcs/promptsGetAll.js +0 -107
- package/funcs/promptsGetAll.js.map +0 -1
- package/funcs/promptsGetOne.d.ts +0 -12
- package/funcs/promptsGetOne.d.ts.map +0 -1
- package/funcs/promptsGetOne.js +0 -108
- package/funcs/promptsGetOne.js.map +0 -1
- package/funcs/promptsUpdate.d.ts +0 -13
- package/funcs/promptsUpdate.d.ts.map +0 -1
- package/funcs/promptsUpdate.js +0 -112
- package/funcs/promptsUpdate.js.map +0 -1
- package/models/errors/updateprompt.d.ts +0 -36
- package/models/errors/updateprompt.d.ts.map +0 -1
- package/models/errors/updateprompt.js +0 -79
- package/models/errors/updateprompt.js.map +0 -1
- package/models/operations/createprompt.d.ts +0 -2035
- package/models/operations/createprompt.d.ts.map +0 -1
- package/models/operations/createprompt.js +0 -1853
- package/models/operations/createprompt.js.map +0 -1
- package/models/operations/createpromptversion.d.ts +0 -2001
- package/models/operations/createpromptversion.d.ts.map +0 -1
- package/models/operations/createpromptversion.js +0 -1848
- package/models/operations/createpromptversion.js.map +0 -1
- package/models/operations/deleteprompt.d.ts +0 -32
- package/models/operations/deleteprompt.d.ts.map +0 -1
- package/models/operations/deleteprompt.js +0 -69
- package/models/operations/deleteprompt.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 +0 -69
- package/models/operations/duplicateprompt.js.map +0 -1
- package/models/operations/findonepromptsnippet.d.ts +0 -6278
- package/models/operations/findonepromptsnippet.d.ts.map +0 -1
- package/models/operations/findonepromptsnippet.js +0 -5891
- package/models/operations/findonepromptsnippet.js.map +0 -1
- package/models/operations/getallprompts.d.ts +0 -6613
- package/models/operations/getallprompts.d.ts.map +0 -1
- package/models/operations/getallprompts.js +0 -6161
- package/models/operations/getallprompts.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/models/operations/getoneprompt.d.ts +0 -32
- package/models/operations/getoneprompt.d.ts.map +0 -1
- package/models/operations/getoneprompt.js +0 -69
- package/models/operations/getoneprompt.js.map +0 -1
- package/models/operations/updateprompt.d.ts +0 -7251
- package/models/operations/updateprompt.d.ts.map +0 -1
- package/models/operations/updateprompt.js +0 -6678
- package/models/operations/updateprompt.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/prompts.d.ts +0 -33
- package/sdk/prompts.d.ts.map +0 -1
- package/sdk/prompts.js +0 -61
- package/sdk/prompts.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/promptSnippetsFindOne.ts +0 -127
- package/src/funcs/promptTemplatesGetAll.ts +0 -129
- package/src/funcs/promptsCreate.ts +0 -123
- package/src/funcs/promptsCreateVersion.ts +0 -128
- package/src/funcs/promptsDelete.ts +0 -127
- package/src/funcs/promptsDuplicate.ts +0 -127
- package/src/funcs/promptsGetAll.ts +0 -127
- package/src/funcs/promptsGetOne.ts +0 -127
- package/src/funcs/promptsUpdate.ts +0 -135
- package/src/models/errors/updateprompt.ts +0 -71
- package/src/models/operations/createprompt.ts +0 -3455
- package/src/models/operations/createpromptversion.ts +0 -3697
- package/src/models/operations/deleteprompt.ts +0 -69
- package/src/models/operations/duplicateprompt.ts +0 -69
- package/src/models/operations/findonepromptsnippet.ts +0 -13629
- package/src/models/operations/getallprompts.ts +0 -13390
- package/src/models/operations/getallprompttemplates.ts +0 -13690
- package/src/models/operations/getoneprompt.ts +0 -69
- package/src/models/operations/updateprompt.ts +0 -14407
- package/src/sdk/prompt.ts +0 -19
- package/src/sdk/prompts.ts +0 -114
- package/src/sdk/snippets.ts +0 -24
- package/src/sdk/templates.ts +0 -24
package/sdk/templates.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
package/sdk/templates.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
package/sdk/templates.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,127 +0,0 @@
|
|
|
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
|
-
path: path,
|
|
89
|
-
headers: headers,
|
|
90
|
-
body: body,
|
|
91
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
92
|
-
}, options);
|
|
93
|
-
if (!requestRes.ok) {
|
|
94
|
-
return requestRes;
|
|
95
|
-
}
|
|
96
|
-
const req = requestRes.value;
|
|
97
|
-
|
|
98
|
-
const doResult = await client._do(req, {
|
|
99
|
-
context,
|
|
100
|
-
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
101
|
-
retryConfig: context.retryConfig,
|
|
102
|
-
retryCodes: context.retryCodes,
|
|
103
|
-
});
|
|
104
|
-
if (!doResult.ok) {
|
|
105
|
-
return doResult;
|
|
106
|
-
}
|
|
107
|
-
const response = doResult.value;
|
|
108
|
-
|
|
109
|
-
const [result] = await M.match<
|
|
110
|
-
operations.FindOnePromptSnippetResponseBody,
|
|
111
|
-
| APIError
|
|
112
|
-
| SDKValidationError
|
|
113
|
-
| UnexpectedClientError
|
|
114
|
-
| InvalidRequestError
|
|
115
|
-
| RequestAbortedError
|
|
116
|
-
| RequestTimeoutError
|
|
117
|
-
| ConnectionError
|
|
118
|
-
>(
|
|
119
|
-
M.json(200, operations.FindOnePromptSnippetResponseBody$inboundSchema),
|
|
120
|
-
M.fail([400, 404, "4XX", "5XX"]),
|
|
121
|
-
)(response);
|
|
122
|
-
if (!result.ok) {
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
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
|
-
path: path,
|
|
90
|
-
headers: headers,
|
|
91
|
-
query: query,
|
|
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: ["400", "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.GetAllPromptTemplatesResponseBody,
|
|
113
|
-
| APIError
|
|
114
|
-
| SDKValidationError
|
|
115
|
-
| UnexpectedClientError
|
|
116
|
-
| InvalidRequestError
|
|
117
|
-
| RequestAbortedError
|
|
118
|
-
| RequestTimeoutError
|
|
119
|
-
| ConnectionError
|
|
120
|
-
>(
|
|
121
|
-
M.json(200, operations.GetAllPromptTemplatesResponseBody$inboundSchema),
|
|
122
|
-
M.fail([400, "4XX", "5XX"]),
|
|
123
|
-
)(response);
|
|
124
|
-
if (!result.ok) {
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
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
|
-
path: path,
|
|
85
|
-
headers: headers,
|
|
86
|
-
body: body,
|
|
87
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
88
|
-
}, options);
|
|
89
|
-
if (!requestRes.ok) {
|
|
90
|
-
return requestRes;
|
|
91
|
-
}
|
|
92
|
-
const req = requestRes.value;
|
|
93
|
-
|
|
94
|
-
const doResult = await client._do(req, {
|
|
95
|
-
context,
|
|
96
|
-
errorCodes: ["4XX", "5XX"],
|
|
97
|
-
retryConfig: context.retryConfig,
|
|
98
|
-
retryCodes: context.retryCodes,
|
|
99
|
-
});
|
|
100
|
-
if (!doResult.ok) {
|
|
101
|
-
return doResult;
|
|
102
|
-
}
|
|
103
|
-
const response = doResult.value;
|
|
104
|
-
|
|
105
|
-
const [result] = await M.match<
|
|
106
|
-
operations.CreatePromptResponseBody,
|
|
107
|
-
| APIError
|
|
108
|
-
| SDKValidationError
|
|
109
|
-
| UnexpectedClientError
|
|
110
|
-
| InvalidRequestError
|
|
111
|
-
| RequestAbortedError
|
|
112
|
-
| RequestTimeoutError
|
|
113
|
-
| ConnectionError
|
|
114
|
-
>(
|
|
115
|
-
M.json(200, operations.CreatePromptResponseBody$inboundSchema),
|
|
116
|
-
M.fail(["4XX", "5XX"]),
|
|
117
|
-
)(response);
|
|
118
|
-
if (!result.ok) {
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
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
|
-
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: ["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.CreatePromptVersionResponseBody,
|
|
112
|
-
| APIError
|
|
113
|
-
| SDKValidationError
|
|
114
|
-
| UnexpectedClientError
|
|
115
|
-
| InvalidRequestError
|
|
116
|
-
| RequestAbortedError
|
|
117
|
-
| RequestTimeoutError
|
|
118
|
-
| ConnectionError
|
|
119
|
-
>(
|
|
120
|
-
M.json(200, operations.CreatePromptVersionResponseBody$inboundSchema),
|
|
121
|
-
M.fail(["4XX", "5XX"]),
|
|
122
|
-
)(response);
|
|
123
|
-
if (!result.ok) {
|
|
124
|
-
return result;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { OrqCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
-
import * as M from "../lib/matchers.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
|
-
* Delete a prompt
|
|
27
|
-
*/
|
|
28
|
-
export async function promptsDelete(
|
|
29
|
-
client: OrqCore,
|
|
30
|
-
request: operations.DeletePromptRequest,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): Promise<
|
|
33
|
-
Result<
|
|
34
|
-
void,
|
|
35
|
-
| APIError
|
|
36
|
-
| SDKValidationError
|
|
37
|
-
| UnexpectedClientError
|
|
38
|
-
| InvalidRequestError
|
|
39
|
-
| RequestAbortedError
|
|
40
|
-
| RequestTimeoutError
|
|
41
|
-
| ConnectionError
|
|
42
|
-
>
|
|
43
|
-
> {
|
|
44
|
-
const parsed = safeParse(
|
|
45
|
-
request,
|
|
46
|
-
(value) => operations.DeletePromptRequest$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
|
-
id: encodeSimple("id", payload.id, {
|
|
57
|
-
explode: false,
|
|
58
|
-
charEncoding: "percent",
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const path = pathToFunc("/v2/resources/prompts/{id}")(pathParams);
|
|
63
|
-
|
|
64
|
-
const headers = new Headers({
|
|
65
|
-
Accept: "*/*",
|
|
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: "DeletePrompt",
|
|
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: "DELETE",
|
|
88
|
-
path: path,
|
|
89
|
-
headers: headers,
|
|
90
|
-
body: body,
|
|
91
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
92
|
-
}, options);
|
|
93
|
-
if (!requestRes.ok) {
|
|
94
|
-
return requestRes;
|
|
95
|
-
}
|
|
96
|
-
const req = requestRes.value;
|
|
97
|
-
|
|
98
|
-
const doResult = await client._do(req, {
|
|
99
|
-
context,
|
|
100
|
-
errorCodes: ["4XX", "5XX"],
|
|
101
|
-
retryConfig: context.retryConfig,
|
|
102
|
-
retryCodes: context.retryCodes,
|
|
103
|
-
});
|
|
104
|
-
if (!doResult.ok) {
|
|
105
|
-
return doResult;
|
|
106
|
-
}
|
|
107
|
-
const response = doResult.value;
|
|
108
|
-
|
|
109
|
-
const [result] = await M.match<
|
|
110
|
-
void,
|
|
111
|
-
| APIError
|
|
112
|
-
| SDKValidationError
|
|
113
|
-
| UnexpectedClientError
|
|
114
|
-
| InvalidRequestError
|
|
115
|
-
| RequestAbortedError
|
|
116
|
-
| RequestTimeoutError
|
|
117
|
-
| ConnectionError
|
|
118
|
-
>(
|
|
119
|
-
M.nil(200, z.void()),
|
|
120
|
-
M.fail(["4XX", "5XX"]),
|
|
121
|
-
)(response);
|
|
122
|
-
if (!result.ok) {
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return result;
|
|
127
|
-
}
|