@orq-ai/node 3.1.3 → 3.1.5
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 +8 -23
- package/docs/sdks/files/README.md +8 -8
- package/docs/sdks/{remoteconfig → remoteconfigs}/README.md +8 -8
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +1 -0
- package/funcs/contactsCreate.js.map +1 -1
- package/funcs/deploymentsGetConfig.d.ts.map +1 -1
- package/funcs/deploymentsGetConfig.js +1 -0
- package/funcs/deploymentsGetConfig.js.map +1 -1
- package/funcs/deploymentsInvoke.d.ts.map +1 -1
- package/funcs/deploymentsInvoke.js +1 -0
- package/funcs/deploymentsInvoke.js.map +1 -1
- package/funcs/deploymentsList.d.ts.map +1 -1
- package/funcs/deploymentsList.js +1 -0
- package/funcs/deploymentsList.js.map +1 -1
- package/funcs/deploymentsMetricsCreate.d.ts.map +1 -1
- package/funcs/deploymentsMetricsCreate.js +1 -0
- package/funcs/deploymentsMetricsCreate.js.map +1 -1
- package/funcs/deploymentsStream.d.ts.map +1 -1
- package/funcs/deploymentsStream.js +1 -0
- package/funcs/deploymentsStream.js.map +1 -1
- package/funcs/feedbackCreate.d.ts.map +1 -1
- package/funcs/feedbackCreate.js +1 -0
- package/funcs/feedbackCreate.js.map +1 -1
- package/funcs/{filesUpload.d.ts → filesCreate.d.ts} +3 -3
- package/funcs/{filesUpload.d.ts.map → filesCreate.d.ts.map} +1 -1
- package/funcs/{filesUpload.js → filesCreate.js} +5 -4
- package/funcs/{filesUpload.js.map → filesCreate.js.map} +1 -1
- package/funcs/filesDelete.d.ts.map +1 -1
- package/funcs/filesDelete.js +1 -0
- package/funcs/filesDelete.js.map +1 -1
- package/funcs/filesGet.d.ts +4 -1
- package/funcs/filesGet.d.ts.map +1 -1
- package/funcs/filesGet.js +5 -1
- package/funcs/filesGet.js.map +1 -1
- package/funcs/filesList.d.ts +3 -0
- package/funcs/filesList.d.ts.map +1 -1
- package/funcs/filesList.js +6 -3
- package/funcs/filesList.js.map +1 -1
- package/funcs/promptsCreate.d.ts.map +1 -1
- package/funcs/promptsCreate.js +1 -0
- package/funcs/promptsCreate.js.map +1 -1
- package/funcs/promptsDelete.d.ts.map +1 -1
- package/funcs/promptsDelete.js +1 -0
- package/funcs/promptsDelete.js.map +1 -1
- package/funcs/promptsGetVersion.d.ts.map +1 -1
- package/funcs/promptsGetVersion.js +1 -0
- package/funcs/promptsGetVersion.js.map +1 -1
- package/funcs/promptsList.d.ts.map +1 -1
- package/funcs/promptsList.js +1 -0
- package/funcs/promptsList.js.map +1 -1
- package/funcs/promptsListVersions.d.ts.map +1 -1
- package/funcs/promptsListVersions.js +1 -0
- package/funcs/promptsListVersions.js.map +1 -1
- package/funcs/promptsRetrieve.d.ts.map +1 -1
- package/funcs/promptsRetrieve.js +1 -0
- package/funcs/promptsRetrieve.js.map +1 -1
- package/funcs/promptsUpdate.d.ts.map +1 -1
- package/funcs/promptsUpdate.js +1 -0
- package/funcs/promptsUpdate.js.map +1 -1
- package/funcs/{remoteconfigGetConfig.d.ts → remoteconfigsRetrieve.d.ts} +3 -3
- package/funcs/{remoteconfigGetConfig.d.ts.map → remoteconfigsRetrieve.d.ts.map} +1 -1
- package/funcs/{remoteconfigGetConfig.js → remoteconfigsRetrieve.js} +5 -4
- package/funcs/remoteconfigsRetrieve.js.map +1 -0
- package/hooks/types.d.ts +1 -0
- package/hooks/types.d.ts.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.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/createcontact.js +2 -2
- package/models/operations/createprompt.d.ts +348 -348
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +486 -483
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.d.ts +13 -6
- package/models/operations/filelist.d.ts.map +1 -1
- package/models/operations/filelist.js +18 -10
- package/models/operations/filelist.js.map +1 -1
- package/models/operations/fileupload.js +2 -2
- package/models/operations/index.d.ts +0 -6
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -6
- package/models/operations/index.js.map +1 -1
- package/models/operations/updateprompt.d.ts +30 -30
- package/models/operations/updateprompt.d.ts.map +1 -1
- package/models/operations/updateprompt.js +38 -38
- package/models/operations/updateprompt.js.map +1 -1
- package/package.json +1 -1
- package/sdk/files.d.ts +9 -3
- package/sdk/files.d.ts.map +1 -1
- package/sdk/files.js +11 -5
- package/sdk/files.js.map +1 -1
- package/sdk/remoteconfigs.d.ts +9 -0
- package/sdk/remoteconfigs.d.ts.map +1 -0
- package/sdk/remoteconfigs.js +19 -0
- package/sdk/remoteconfigs.js.map +1 -0
- package/sdk/sdk.d.ts +3 -6
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +3 -7
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/contactsCreate.ts +1 -0
- package/src/funcs/deploymentsGetConfig.ts +1 -0
- package/src/funcs/deploymentsInvoke.ts +1 -0
- package/src/funcs/deploymentsList.ts +1 -0
- package/src/funcs/deploymentsMetricsCreate.ts +1 -0
- package/src/funcs/deploymentsStream.ts +1 -0
- package/src/funcs/feedbackCreate.ts +1 -0
- package/src/funcs/{filesUpload.ts → filesCreate.ts} +3 -2
- package/src/funcs/filesDelete.ts +1 -0
- package/src/funcs/filesGet.ts +5 -1
- package/src/funcs/filesList.ts +6 -3
- package/src/funcs/promptsCreate.ts +1 -0
- package/src/funcs/promptsDelete.ts +1 -0
- package/src/funcs/promptsGetVersion.ts +1 -0
- package/src/funcs/promptsList.ts +1 -0
- package/src/funcs/promptsListVersions.ts +1 -0
- package/src/funcs/promptsRetrieve.ts +1 -0
- package/src/funcs/promptsUpdate.ts +1 -0
- package/src/funcs/{remoteconfigGetConfig.ts → remoteconfigsRetrieve.ts} +3 -2
- package/src/hooks/types.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +0 -1
- package/src/models/errors/index.ts +0 -1
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createprompt.ts +668 -770
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +31 -16
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/index.ts +0 -6
- package/src/models/operations/updateprompt.ts +64 -81
- package/src/sdk/files.ts +11 -5
- package/src/sdk/{remoteconfig.ts → remoteconfigs.ts} +5 -5
- package/src/sdk/sdk.ts +4 -10
- package/docs/sdks/promptsnippets/README.md +0 -488
- package/funcs/promptSnippetsCreate.d.ts +0 -12
- package/funcs/promptSnippetsCreate.d.ts.map +0 -1
- package/funcs/promptSnippetsCreate.js +0 -106
- package/funcs/promptSnippetsCreate.js.map +0 -1
- package/funcs/promptSnippetsDelete.d.ts +0 -12
- package/funcs/promptSnippetsDelete.d.ts.map +0 -1
- package/funcs/promptSnippetsDelete.js +0 -110
- package/funcs/promptSnippetsDelete.js.map +0 -1
- package/funcs/promptSnippetsGet.d.ts +0 -12
- package/funcs/promptSnippetsGet.d.ts.map +0 -1
- package/funcs/promptSnippetsGet.js +0 -109
- package/funcs/promptSnippetsGet.js.map +0 -1
- package/funcs/promptSnippetsGetByKey.d.ts +0 -12
- package/funcs/promptSnippetsGetByKey.d.ts.map +0 -1
- package/funcs/promptSnippetsGetByKey.js +0 -109
- package/funcs/promptSnippetsGetByKey.js.map +0 -1
- package/funcs/promptSnippetsList.d.ts +0 -12
- package/funcs/promptSnippetsList.d.ts.map +0 -1
- package/funcs/promptSnippetsList.js +0 -109
- package/funcs/promptSnippetsList.js.map +0 -1
- package/funcs/promptSnippetsUpdate.d.ts +0 -13
- package/funcs/promptSnippetsUpdate.d.ts.map +0 -1
- package/funcs/promptSnippetsUpdate.js +0 -114
- package/funcs/promptSnippetsUpdate.js.map +0 -1
- package/funcs/remoteconfigGetConfig.js.map +0 -1
- package/models/errors/updatepromptsnippet.d.ts +0 -36
- package/models/errors/updatepromptsnippet.d.ts.map +0 -1
- package/models/errors/updatepromptsnippet.js +0 -79
- package/models/errors/updatepromptsnippet.js.map +0 -1
- package/models/operations/createpromptsnippet.d.ts +0 -3567
- package/models/operations/createpromptsnippet.d.ts.map +0 -1
- package/models/operations/createpromptsnippet.js +0 -3056
- package/models/operations/createpromptsnippet.js.map +0 -1
- package/models/operations/deletepromptsnippet.d.ts +0 -32
- package/models/operations/deletepromptsnippet.d.ts.map +0 -1
- package/models/operations/deletepromptsnippet.js +0 -69
- package/models/operations/deletepromptsnippet.js.map +0 -1
- package/models/operations/findonebykeypromptsnippet.d.ts +0 -2448
- package/models/operations/findonebykeypromptsnippet.d.ts.map +0 -1
- package/models/operations/findonebykeypromptsnippet.js +0 -2133
- package/models/operations/findonebykeypromptsnippet.js.map +0 -1
- package/models/operations/findonepromptsnippet.d.ts +0 -2448
- package/models/operations/findonepromptsnippet.d.ts.map +0 -1
- package/models/operations/findonepromptsnippet.js +0 -2124
- package/models/operations/findonepromptsnippet.js.map +0 -1
- package/models/operations/getallpromptsnippets.d.ts +0 -2512
- package/models/operations/getallpromptsnippets.d.ts.map +0 -1
- package/models/operations/getallpromptsnippets.js +0 -2195
- package/models/operations/getallpromptsnippets.js.map +0 -1
- package/models/operations/updatepromptsnippet.d.ts +0 -3595
- package/models/operations/updatepromptsnippet.d.ts.map +0 -1
- package/models/operations/updatepromptsnippet.js +0 -3116
- package/models/operations/updatepromptsnippet.js.map +0 -1
- package/sdk/promptsnippets.d.ts +0 -29
- package/sdk/promptsnippets.d.ts.map +0 -1
- package/sdk/promptsnippets.js +0 -54
- package/sdk/promptsnippets.js.map +0 -1
- package/sdk/remoteconfig.d.ts +0 -9
- package/sdk/remoteconfig.d.ts.map +0 -1
- package/sdk/remoteconfig.js +0 -19
- package/sdk/remoteconfig.js.map +0 -1
- package/src/funcs/promptSnippetsCreate.ts +0 -128
- package/src/funcs/promptSnippetsDelete.ts +0 -131
- package/src/funcs/promptSnippetsGet.ts +0 -130
- package/src/funcs/promptSnippetsGetByKey.ts +0 -132
- package/src/funcs/promptSnippetsList.ts +0 -132
- package/src/funcs/promptSnippetsUpdate.ts +0 -139
- package/src/models/errors/updatepromptsnippet.ts +0 -71
- package/src/models/operations/createpromptsnippet.ts +0 -6239
- package/src/models/operations/deletepromptsnippet.ts +0 -69
- package/src/models/operations/findonebykeypromptsnippet.ts +0 -4483
- package/src/models/operations/findonepromptsnippet.ts +0 -4343
- package/src/models/operations/getallpromptsnippets.ts +0 -4472
- package/src/models/operations/updatepromptsnippet.ts +0 -6544
- package/src/sdk/promptsnippets.ts +0 -99
|
@@ -1,130 +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 { 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
|
|
27
|
-
*/
|
|
28
|
-
export async function promptSnippetsGet(
|
|
29
|
-
client: OrqCore,
|
|
30
|
-
request: operations.FindOnePromptSnippetRequest,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): Promise<
|
|
33
|
-
Result<
|
|
34
|
-
operations.FindOnePromptSnippetResponseBody,
|
|
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.FindOnePromptSnippetRequest$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
|
-
id: encodeSimple("id", payload.id, {
|
|
58
|
-
explode: false,
|
|
59
|
-
charEncoding: "percent",
|
|
60
|
-
}),
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const path = pathToFunc("/v2/resources/prompts/snippets/{id}")(pathParams);
|
|
64
|
-
|
|
65
|
-
const headers = new Headers(compactMap({
|
|
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: "FindOnePromptSnippet",
|
|
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: "GET",
|
|
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: ["400", "404", "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.FindOnePromptSnippetResponseBody,
|
|
113
|
-
| APIError
|
|
114
|
-
| SDKValidationError
|
|
115
|
-
| UnexpectedClientError
|
|
116
|
-
| InvalidRequestError
|
|
117
|
-
| RequestAbortedError
|
|
118
|
-
| RequestTimeoutError
|
|
119
|
-
| ConnectionError
|
|
120
|
-
>(
|
|
121
|
-
M.json(200, operations.FindOnePromptSnippetResponseBody$inboundSchema),
|
|
122
|
-
M.fail([400, 404, "4XX"]),
|
|
123
|
-
M.fail("5XX"),
|
|
124
|
-
)(response);
|
|
125
|
-
if (!result.ok) {
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return result;
|
|
130
|
-
}
|
|
@@ -1,132 +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 { 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
|
-
}));
|
|
70
|
-
|
|
71
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
72
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
73
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
74
|
-
|
|
75
|
-
const context = {
|
|
76
|
-
operationID: "FindOneByKeyPromptSnippet",
|
|
77
|
-
oAuth2Scopes: [],
|
|
78
|
-
|
|
79
|
-
resolvedSecurity: requestSecurity,
|
|
80
|
-
|
|
81
|
-
securitySource: client._options.apiKey,
|
|
82
|
-
retryConfig: options?.retries
|
|
83
|
-
|| client._options.retryConfig
|
|
84
|
-
|| { strategy: "none" },
|
|
85
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const requestRes = client._createRequest(context, {
|
|
89
|
-
security: requestSecurity,
|
|
90
|
-
method: "GET",
|
|
91
|
-
baseURL: options?.serverURL,
|
|
92
|
-
path: path,
|
|
93
|
-
headers: headers,
|
|
94
|
-
body: body,
|
|
95
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
96
|
-
}, options);
|
|
97
|
-
if (!requestRes.ok) {
|
|
98
|
-
return requestRes;
|
|
99
|
-
}
|
|
100
|
-
const req = requestRes.value;
|
|
101
|
-
|
|
102
|
-
const doResult = await client._do(req, {
|
|
103
|
-
context,
|
|
104
|
-
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
105
|
-
retryConfig: context.retryConfig,
|
|
106
|
-
retryCodes: context.retryCodes,
|
|
107
|
-
});
|
|
108
|
-
if (!doResult.ok) {
|
|
109
|
-
return doResult;
|
|
110
|
-
}
|
|
111
|
-
const response = doResult.value;
|
|
112
|
-
|
|
113
|
-
const [result] = await M.match<
|
|
114
|
-
operations.FindOneByKeyPromptSnippetResponseBody,
|
|
115
|
-
| APIError
|
|
116
|
-
| SDKValidationError
|
|
117
|
-
| UnexpectedClientError
|
|
118
|
-
| InvalidRequestError
|
|
119
|
-
| RequestAbortedError
|
|
120
|
-
| RequestTimeoutError
|
|
121
|
-
| ConnectionError
|
|
122
|
-
>(
|
|
123
|
-
M.json(200, operations.FindOneByKeyPromptSnippetResponseBody$inboundSchema),
|
|
124
|
-
M.fail([400, 404, "4XX"]),
|
|
125
|
-
M.fail("5XX"),
|
|
126
|
-
)(response);
|
|
127
|
-
if (!result.ok) {
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
@@ -1,132 +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 } 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
|
-
* List all prompts snippets
|
|
27
|
-
*/
|
|
28
|
-
export async function promptSnippetsList(
|
|
29
|
-
client: OrqCore,
|
|
30
|
-
request?: operations.GetAllPromptSnippetsRequest | undefined,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): Promise<
|
|
33
|
-
Result<
|
|
34
|
-
operations.GetAllPromptSnippetsResponseBody,
|
|
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.GetAllPromptSnippetsRequest$outboundSchema.optional().parse(
|
|
48
|
-
value,
|
|
49
|
-
),
|
|
50
|
-
"Input validation failed",
|
|
51
|
-
);
|
|
52
|
-
if (!parsed.ok) {
|
|
53
|
-
return parsed;
|
|
54
|
-
}
|
|
55
|
-
const payload = parsed.value;
|
|
56
|
-
const body = null;
|
|
57
|
-
|
|
58
|
-
const path = pathToFunc("/v2/resources/prompts/snippets/")();
|
|
59
|
-
|
|
60
|
-
const query = encodeFormQuery({
|
|
61
|
-
"ending_before": payload?.ending_before,
|
|
62
|
-
"limit": payload?.limit,
|
|
63
|
-
"starting_after": payload?.starting_after,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const headers = new Headers(compactMap({
|
|
67
|
-
Accept: "application/json",
|
|
68
|
-
}));
|
|
69
|
-
|
|
70
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
71
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
72
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
73
|
-
|
|
74
|
-
const context = {
|
|
75
|
-
operationID: "GetAllPromptSnippets",
|
|
76
|
-
oAuth2Scopes: [],
|
|
77
|
-
|
|
78
|
-
resolvedSecurity: requestSecurity,
|
|
79
|
-
|
|
80
|
-
securitySource: client._options.apiKey,
|
|
81
|
-
retryConfig: options?.retries
|
|
82
|
-
|| client._options.retryConfig
|
|
83
|
-
|| { strategy: "none" },
|
|
84
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const requestRes = client._createRequest(context, {
|
|
88
|
-
security: requestSecurity,
|
|
89
|
-
method: "GET",
|
|
90
|
-
baseURL: options?.serverURL,
|
|
91
|
-
path: path,
|
|
92
|
-
headers: headers,
|
|
93
|
-
query: query,
|
|
94
|
-
body: body,
|
|
95
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
96
|
-
}, options);
|
|
97
|
-
if (!requestRes.ok) {
|
|
98
|
-
return requestRes;
|
|
99
|
-
}
|
|
100
|
-
const req = requestRes.value;
|
|
101
|
-
|
|
102
|
-
const doResult = await client._do(req, {
|
|
103
|
-
context,
|
|
104
|
-
errorCodes: ["4XX", "5XX"],
|
|
105
|
-
retryConfig: context.retryConfig,
|
|
106
|
-
retryCodes: context.retryCodes,
|
|
107
|
-
});
|
|
108
|
-
if (!doResult.ok) {
|
|
109
|
-
return doResult;
|
|
110
|
-
}
|
|
111
|
-
const response = doResult.value;
|
|
112
|
-
|
|
113
|
-
const [result] = await M.match<
|
|
114
|
-
operations.GetAllPromptSnippetsResponseBody,
|
|
115
|
-
| APIError
|
|
116
|
-
| SDKValidationError
|
|
117
|
-
| UnexpectedClientError
|
|
118
|
-
| InvalidRequestError
|
|
119
|
-
| RequestAbortedError
|
|
120
|
-
| RequestTimeoutError
|
|
121
|
-
| ConnectionError
|
|
122
|
-
>(
|
|
123
|
-
M.json(200, operations.GetAllPromptSnippetsResponseBody$inboundSchema),
|
|
124
|
-
M.fail("4XX"),
|
|
125
|
-
M.fail("5XX"),
|
|
126
|
-
)(response);
|
|
127
|
-
if (!result.ok) {
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
@@ -1,139 +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 { 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 * as errors from "../models/errors/index.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Update a prompt snippet
|
|
28
|
-
*/
|
|
29
|
-
export async function promptSnippetsUpdate(
|
|
30
|
-
client: OrqCore,
|
|
31
|
-
request: operations.UpdatePromptSnippetRequest,
|
|
32
|
-
options?: RequestOptions,
|
|
33
|
-
): Promise<
|
|
34
|
-
Result<
|
|
35
|
-
operations.UpdatePromptSnippetResponseBody,
|
|
36
|
-
| errors.UpdatePromptSnippetResponseBody
|
|
37
|
-
| APIError
|
|
38
|
-
| SDKValidationError
|
|
39
|
-
| UnexpectedClientError
|
|
40
|
-
| InvalidRequestError
|
|
41
|
-
| RequestAbortedError
|
|
42
|
-
| RequestTimeoutError
|
|
43
|
-
| ConnectionError
|
|
44
|
-
>
|
|
45
|
-
> {
|
|
46
|
-
const parsed = safeParse(
|
|
47
|
-
request,
|
|
48
|
-
(value) =>
|
|
49
|
-
operations.UpdatePromptSnippetRequest$outboundSchema.parse(value),
|
|
50
|
-
"Input validation failed",
|
|
51
|
-
);
|
|
52
|
-
if (!parsed.ok) {
|
|
53
|
-
return parsed;
|
|
54
|
-
}
|
|
55
|
-
const payload = parsed.value;
|
|
56
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
57
|
-
|
|
58
|
-
const pathParams = {
|
|
59
|
-
id: encodeSimple("id", payload.id, {
|
|
60
|
-
explode: false,
|
|
61
|
-
charEncoding: "percent",
|
|
62
|
-
}),
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const path = pathToFunc("/v2/resources/prompts/snippets/{id}")(pathParams);
|
|
66
|
-
|
|
67
|
-
const headers = new Headers(compactMap({
|
|
68
|
-
"Content-Type": "application/json",
|
|
69
|
-
Accept: "application/json",
|
|
70
|
-
}));
|
|
71
|
-
|
|
72
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
73
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
74
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
75
|
-
|
|
76
|
-
const context = {
|
|
77
|
-
operationID: "UpdatePromptSnippet",
|
|
78
|
-
oAuth2Scopes: [],
|
|
79
|
-
|
|
80
|
-
resolvedSecurity: requestSecurity,
|
|
81
|
-
|
|
82
|
-
securitySource: client._options.apiKey,
|
|
83
|
-
retryConfig: options?.retries
|
|
84
|
-
|| client._options.retryConfig
|
|
85
|
-
|| { strategy: "none" },
|
|
86
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const requestRes = client._createRequest(context, {
|
|
90
|
-
security: requestSecurity,
|
|
91
|
-
method: "PATCH",
|
|
92
|
-
baseURL: options?.serverURL,
|
|
93
|
-
path: path,
|
|
94
|
-
headers: headers,
|
|
95
|
-
body: body,
|
|
96
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
97
|
-
}, options);
|
|
98
|
-
if (!requestRes.ok) {
|
|
99
|
-
return requestRes;
|
|
100
|
-
}
|
|
101
|
-
const req = requestRes.value;
|
|
102
|
-
|
|
103
|
-
const doResult = await client._do(req, {
|
|
104
|
-
context,
|
|
105
|
-
errorCodes: ["404", "4XX", "5XX"],
|
|
106
|
-
retryConfig: context.retryConfig,
|
|
107
|
-
retryCodes: context.retryCodes,
|
|
108
|
-
});
|
|
109
|
-
if (!doResult.ok) {
|
|
110
|
-
return doResult;
|
|
111
|
-
}
|
|
112
|
-
const response = doResult.value;
|
|
113
|
-
|
|
114
|
-
const responseFields = {
|
|
115
|
-
HttpMeta: { Response: response, Request: req },
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const [result] = await M.match<
|
|
119
|
-
operations.UpdatePromptSnippetResponseBody,
|
|
120
|
-
| errors.UpdatePromptSnippetResponseBody
|
|
121
|
-
| APIError
|
|
122
|
-
| SDKValidationError
|
|
123
|
-
| UnexpectedClientError
|
|
124
|
-
| InvalidRequestError
|
|
125
|
-
| RequestAbortedError
|
|
126
|
-
| RequestTimeoutError
|
|
127
|
-
| ConnectionError
|
|
128
|
-
>(
|
|
129
|
-
M.json(200, operations.UpdatePromptSnippetResponseBody$inboundSchema),
|
|
130
|
-
M.jsonErr(404, errors.UpdatePromptSnippetResponseBody$inboundSchema),
|
|
131
|
-
M.fail("4XX"),
|
|
132
|
-
M.fail("5XX"),
|
|
133
|
-
)(response, { extraFields: responseFields });
|
|
134
|
-
if (!result.ok) {
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Prompt snippet not found.
|
|
9
|
-
*/
|
|
10
|
-
export type UpdatePromptSnippetResponseBodyData = {
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Prompt snippet not found.
|
|
16
|
-
*/
|
|
17
|
-
export class UpdatePromptSnippetResponseBody extends Error {
|
|
18
|
-
/** The original data that was passed to this error instance. */
|
|
19
|
-
data$: UpdatePromptSnippetResponseBodyData;
|
|
20
|
-
|
|
21
|
-
constructor(err: UpdatePromptSnippetResponseBodyData) {
|
|
22
|
-
const message = "message" in err && typeof err.message === "string"
|
|
23
|
-
? err.message
|
|
24
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
25
|
-
super(message);
|
|
26
|
-
this.data$ = err;
|
|
27
|
-
|
|
28
|
-
this.name = "UpdatePromptSnippetResponseBody";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** @internal */
|
|
33
|
-
export const UpdatePromptSnippetResponseBody$inboundSchema: z.ZodType<
|
|
34
|
-
UpdatePromptSnippetResponseBody,
|
|
35
|
-
z.ZodTypeDef,
|
|
36
|
-
unknown
|
|
37
|
-
> = z.object({
|
|
38
|
-
message: z.string(),
|
|
39
|
-
})
|
|
40
|
-
.transform((v) => {
|
|
41
|
-
return new UpdatePromptSnippetResponseBody(v);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
/** @internal */
|
|
45
|
-
export type UpdatePromptSnippetResponseBody$Outbound = {
|
|
46
|
-
message: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const UpdatePromptSnippetResponseBody$outboundSchema: z.ZodType<
|
|
51
|
-
UpdatePromptSnippetResponseBody$Outbound,
|
|
52
|
-
z.ZodTypeDef,
|
|
53
|
-
UpdatePromptSnippetResponseBody
|
|
54
|
-
> = z.instanceof(UpdatePromptSnippetResponseBody)
|
|
55
|
-
.transform(v => v.data$)
|
|
56
|
-
.pipe(z.object({
|
|
57
|
-
message: z.string(),
|
|
58
|
-
}));
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @internal
|
|
62
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
63
|
-
*/
|
|
64
|
-
export namespace UpdatePromptSnippetResponseBody$ {
|
|
65
|
-
/** @deprecated use `UpdatePromptSnippetResponseBody$inboundSchema` instead. */
|
|
66
|
-
export const inboundSchema = UpdatePromptSnippetResponseBody$inboundSchema;
|
|
67
|
-
/** @deprecated use `UpdatePromptSnippetResponseBody$outboundSchema` instead. */
|
|
68
|
-
export const outboundSchema = UpdatePromptSnippetResponseBody$outboundSchema;
|
|
69
|
-
/** @deprecated use `UpdatePromptSnippetResponseBody$Outbound` instead. */
|
|
70
|
-
export type Outbound = UpdatePromptSnippetResponseBody$Outbound;
|
|
71
|
-
}
|