@orq-ai/node 3.2.0-rc.6 → 3.2.0-rc.8
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 +1 -1
- package/funcs/contactsCreate.d.ts +2 -1
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +11 -7
- package/funcs/contactsCreate.js.map +1 -1
- package/funcs/deploymentsGetConfig.d.ts +2 -1
- package/funcs/deploymentsGetConfig.d.ts.map +1 -1
- package/funcs/deploymentsGetConfig.js +11 -7
- package/funcs/deploymentsGetConfig.js.map +1 -1
- package/funcs/deploymentsInvoke.d.ts +2 -1
- package/funcs/deploymentsInvoke.d.ts.map +1 -1
- package/funcs/deploymentsInvoke.js +11 -7
- package/funcs/deploymentsInvoke.js.map +1 -1
- package/funcs/deploymentsList.d.ts +2 -1
- package/funcs/deploymentsList.d.ts.map +1 -1
- package/funcs/deploymentsList.js +11 -7
- package/funcs/deploymentsList.js.map +1 -1
- package/funcs/deploymentsMetricsCreate.d.ts +2 -1
- package/funcs/deploymentsMetricsCreate.d.ts.map +1 -1
- package/funcs/deploymentsMetricsCreate.js +11 -7
- package/funcs/deploymentsMetricsCreate.js.map +1 -1
- package/funcs/feedbackCreate.d.ts +2 -1
- package/funcs/feedbackCreate.d.ts.map +1 -1
- package/funcs/feedbackCreate.js +11 -7
- package/funcs/feedbackCreate.js.map +1 -1
- package/funcs/filesCreate.d.ts +2 -1
- package/funcs/filesCreate.d.ts.map +1 -1
- package/funcs/filesCreate.js +11 -7
- package/funcs/filesCreate.js.map +1 -1
- package/funcs/filesDelete.d.ts +2 -1
- package/funcs/filesDelete.d.ts.map +1 -1
- package/funcs/filesDelete.js +11 -7
- package/funcs/filesDelete.js.map +1 -1
- package/funcs/filesGet.d.ts +2 -1
- package/funcs/filesGet.d.ts.map +1 -1
- package/funcs/filesGet.js +11 -7
- package/funcs/filesGet.js.map +1 -1
- package/funcs/filesList.d.ts +2 -1
- package/funcs/filesList.d.ts.map +1 -1
- package/funcs/filesList.js +11 -7
- package/funcs/filesList.js.map +1 -1
- package/funcs/promptsCreate.d.ts +2 -1
- package/funcs/promptsCreate.d.ts.map +1 -1
- package/funcs/promptsCreate.js +11 -7
- package/funcs/promptsCreate.js.map +1 -1
- package/funcs/promptsDelete.d.ts +2 -1
- package/funcs/promptsDelete.d.ts.map +1 -1
- package/funcs/promptsDelete.js +11 -7
- package/funcs/promptsDelete.js.map +1 -1
- package/funcs/promptsGetVersion.d.ts +2 -1
- package/funcs/promptsGetVersion.d.ts.map +1 -1
- package/funcs/promptsGetVersion.js +11 -7
- package/funcs/promptsGetVersion.js.map +1 -1
- package/funcs/promptsList.d.ts +2 -1
- package/funcs/promptsList.d.ts.map +1 -1
- package/funcs/promptsList.js +11 -7
- package/funcs/promptsList.js.map +1 -1
- package/funcs/promptsListVersions.d.ts +2 -1
- package/funcs/promptsListVersions.d.ts.map +1 -1
- package/funcs/promptsListVersions.js +11 -7
- package/funcs/promptsListVersions.js.map +1 -1
- package/funcs/promptsRetrieve.d.ts +2 -1
- package/funcs/promptsRetrieve.d.ts.map +1 -1
- package/funcs/promptsRetrieve.js +11 -7
- package/funcs/promptsRetrieve.js.map +1 -1
- package/funcs/promptsUpdate.d.ts +2 -1
- package/funcs/promptsUpdate.d.ts.map +1 -1
- package/funcs/promptsUpdate.js +11 -7
- package/funcs/promptsUpdate.js.map +1 -1
- package/funcs/remoteconfigsRetrieve.d.ts +2 -1
- package/funcs/remoteconfigsRetrieve.d.ts.map +1 -1
- package/funcs/remoteconfigsRetrieve.js +11 -7
- package/funcs/remoteconfigsRetrieve.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/models/operations/createcontact.js +2 -2
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/package.json +1 -1
- package/src/funcs/contactsCreate.ts +35 -8
- package/src/funcs/deploymentsGetConfig.ts +35 -8
- package/src/funcs/deploymentsInvoke.ts +35 -8
- package/src/funcs/deploymentsList.ts +36 -8
- package/src/funcs/deploymentsMetricsCreate.ts +35 -8
- package/src/funcs/feedbackCreate.ts +35 -8
- package/src/funcs/filesCreate.ts +35 -8
- package/src/funcs/filesDelete.ts +35 -8
- package/src/funcs/filesGet.ts +35 -8
- package/src/funcs/filesList.ts +35 -8
- package/src/funcs/promptsCreate.ts +35 -8
- package/src/funcs/promptsDelete.ts +35 -8
- package/src/funcs/promptsGetVersion.ts +36 -8
- package/src/funcs/promptsList.ts +35 -8
- package/src/funcs/promptsListVersions.ts +35 -8
- package/src/funcs/promptsRetrieve.ts +35 -8
- package/src/funcs/promptsUpdate.ts +36 -8
- package/src/funcs/remoteconfigsRetrieve.ts +35 -8
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +1 -1
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/types/async.ts +68 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import * as errors from "../models/errors/index.js";
|
|
22
22
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
25
|
import { Result } from "../types/fp.js";
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -29,11 +30,11 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Retrieves a specific version of a prompt by its ID and version ID.
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function promptsGetVersion(
|
|
33
34
|
client: OrqCore,
|
|
34
35
|
request: operations.GetPromptVersionRequest,
|
|
35
36
|
options?: RequestOptions,
|
|
36
|
-
):
|
|
37
|
+
): APIPromise<
|
|
37
38
|
Result<
|
|
38
39
|
operations.GetPromptVersionResponseBody,
|
|
39
40
|
| errors.GetPromptVersionResponseBody
|
|
@@ -45,6 +46,33 @@ export async function promptsGetVersion(
|
|
|
45
46
|
| RequestTimeoutError
|
|
46
47
|
| ConnectionError
|
|
47
48
|
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.GetPromptVersionRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.GetPromptVersionResponseBody,
|
|
65
|
+
| errors.GetPromptVersionResponseBody
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
48
76
|
> {
|
|
49
77
|
const parsed = safeParse(
|
|
50
78
|
request,
|
|
@@ -52,7 +80,7 @@ export async function promptsGetVersion(
|
|
|
52
80
|
"Input validation failed",
|
|
53
81
|
);
|
|
54
82
|
if (!parsed.ok) {
|
|
55
|
-
return parsed;
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
56
84
|
}
|
|
57
85
|
const payload = parsed.value;
|
|
58
86
|
const body = null;
|
|
@@ -81,7 +109,7 @@ export async function promptsGetVersion(
|
|
|
81
109
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
110
|
|
|
83
111
|
const context = {
|
|
84
|
-
baseURL: options?.serverURL ?? "",
|
|
112
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
85
113
|
operationID: "GetPromptVersion",
|
|
86
114
|
oAuth2Scopes: [],
|
|
87
115
|
|
|
@@ -104,7 +132,7 @@ export async function promptsGetVersion(
|
|
|
104
132
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
105
133
|
}, options);
|
|
106
134
|
if (!requestRes.ok) {
|
|
107
|
-
return requestRes;
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
108
136
|
}
|
|
109
137
|
const req = requestRes.value;
|
|
110
138
|
|
|
@@ -115,7 +143,7 @@ export async function promptsGetVersion(
|
|
|
115
143
|
retryCodes: context.retryCodes,
|
|
116
144
|
});
|
|
117
145
|
if (!doResult.ok) {
|
|
118
|
-
return doResult;
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
119
147
|
}
|
|
120
148
|
const response = doResult.value;
|
|
121
149
|
|
|
@@ -140,8 +168,8 @@ export async function promptsGetVersion(
|
|
|
140
168
|
M.fail("5XX"),
|
|
141
169
|
)(response, { extraFields: responseFields });
|
|
142
170
|
if (!result.ok) {
|
|
143
|
-
return result;
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
144
172
|
}
|
|
145
173
|
|
|
146
|
-
return result;
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
147
175
|
}
|
package/src/funcs/promptsList.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
21
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
22
|
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -28,11 +29,11 @@ import { Result } from "../types/fp.js";
|
|
|
28
29
|
* @remarks
|
|
29
30
|
* Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing first
|
|
30
31
|
*/
|
|
31
|
-
export
|
|
32
|
+
export function promptsList(
|
|
32
33
|
client: OrqCore,
|
|
33
34
|
request?: operations.GetAllPromptsRequest | undefined,
|
|
34
35
|
options?: RequestOptions,
|
|
35
|
-
):
|
|
36
|
+
): APIPromise<
|
|
36
37
|
Result<
|
|
37
38
|
operations.GetAllPromptsResponseBody,
|
|
38
39
|
| APIError
|
|
@@ -43,6 +44,32 @@ export async function promptsList(
|
|
|
43
44
|
| RequestTimeoutError
|
|
44
45
|
| ConnectionError
|
|
45
46
|
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: OrqCore,
|
|
57
|
+
request?: operations.GetAllPromptsRequest | undefined,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.GetAllPromptsResponseBody,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
46
73
|
> {
|
|
47
74
|
const parsed = safeParse(
|
|
48
75
|
request,
|
|
@@ -51,7 +78,7 @@ export async function promptsList(
|
|
|
51
78
|
"Input validation failed",
|
|
52
79
|
);
|
|
53
80
|
if (!parsed.ok) {
|
|
54
|
-
return parsed;
|
|
81
|
+
return [parsed, { status: "invalid" }];
|
|
55
82
|
}
|
|
56
83
|
const payload = parsed.value;
|
|
57
84
|
const body = null;
|
|
@@ -73,7 +100,7 @@ export async function promptsList(
|
|
|
73
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
74
101
|
|
|
75
102
|
const context = {
|
|
76
|
-
baseURL: options?.serverURL ?? "",
|
|
103
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
77
104
|
operationID: "GetAllPrompts",
|
|
78
105
|
oAuth2Scopes: [],
|
|
79
106
|
|
|
@@ -97,7 +124,7 @@ export async function promptsList(
|
|
|
97
124
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
98
125
|
}, options);
|
|
99
126
|
if (!requestRes.ok) {
|
|
100
|
-
return requestRes;
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
101
128
|
}
|
|
102
129
|
const req = requestRes.value;
|
|
103
130
|
|
|
@@ -108,7 +135,7 @@ export async function promptsList(
|
|
|
108
135
|
retryCodes: context.retryCodes,
|
|
109
136
|
});
|
|
110
137
|
if (!doResult.ok) {
|
|
111
|
-
return doResult;
|
|
138
|
+
return [doResult, { status: "request-error", request: req }];
|
|
112
139
|
}
|
|
113
140
|
const response = doResult.value;
|
|
114
141
|
|
|
@@ -127,8 +154,8 @@ export async function promptsList(
|
|
|
127
154
|
M.fail("5XX"),
|
|
128
155
|
)(response);
|
|
129
156
|
if (!result.ok) {
|
|
130
|
-
return result;
|
|
157
|
+
return [result, { status: "complete", request: req, response }];
|
|
131
158
|
}
|
|
132
159
|
|
|
133
|
-
return result;
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
134
161
|
}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
21
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
22
|
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -28,11 +29,11 @@ import { Result } from "../types/fp.js";
|
|
|
28
29
|
* @remarks
|
|
29
30
|
* Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing first
|
|
30
31
|
*/
|
|
31
|
-
export
|
|
32
|
+
export function promptsListVersions(
|
|
32
33
|
client: OrqCore,
|
|
33
34
|
request: operations.ListPromptVersionsRequest,
|
|
34
35
|
options?: RequestOptions,
|
|
35
|
-
):
|
|
36
|
+
): APIPromise<
|
|
36
37
|
Result<
|
|
37
38
|
operations.ListPromptVersionsResponseBody,
|
|
38
39
|
| APIError
|
|
@@ -43,6 +44,32 @@ export async function promptsListVersions(
|
|
|
43
44
|
| RequestTimeoutError
|
|
44
45
|
| ConnectionError
|
|
45
46
|
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: OrqCore,
|
|
57
|
+
request: operations.ListPromptVersionsRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.ListPromptVersionsResponseBody,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
46
73
|
> {
|
|
47
74
|
const parsed = safeParse(
|
|
48
75
|
request,
|
|
@@ -50,7 +77,7 @@ export async function promptsListVersions(
|
|
|
50
77
|
"Input validation failed",
|
|
51
78
|
);
|
|
52
79
|
if (!parsed.ok) {
|
|
53
|
-
return parsed;
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
54
81
|
}
|
|
55
82
|
const payload = parsed.value;
|
|
56
83
|
const body = null;
|
|
@@ -79,7 +106,7 @@ export async function promptsListVersions(
|
|
|
79
106
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
80
107
|
|
|
81
108
|
const context = {
|
|
82
|
-
baseURL: options?.serverURL ?? "",
|
|
109
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
83
110
|
operationID: "ListPromptVersions",
|
|
84
111
|
oAuth2Scopes: [],
|
|
85
112
|
|
|
@@ -103,7 +130,7 @@ export async function promptsListVersions(
|
|
|
103
130
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
104
131
|
}, options);
|
|
105
132
|
if (!requestRes.ok) {
|
|
106
|
-
return requestRes;
|
|
133
|
+
return [requestRes, { status: "invalid" }];
|
|
107
134
|
}
|
|
108
135
|
const req = requestRes.value;
|
|
109
136
|
|
|
@@ -114,7 +141,7 @@ export async function promptsListVersions(
|
|
|
114
141
|
retryCodes: context.retryCodes,
|
|
115
142
|
});
|
|
116
143
|
if (!doResult.ok) {
|
|
117
|
-
return doResult;
|
|
144
|
+
return [doResult, { status: "request-error", request: req }];
|
|
118
145
|
}
|
|
119
146
|
const response = doResult.value;
|
|
120
147
|
|
|
@@ -133,8 +160,8 @@ export async function promptsListVersions(
|
|
|
133
160
|
M.fail("5XX"),
|
|
134
161
|
)(response);
|
|
135
162
|
if (!result.ok) {
|
|
136
|
-
return result;
|
|
163
|
+
return [result, { status: "complete", request: req, response }];
|
|
137
164
|
}
|
|
138
165
|
|
|
139
|
-
return result;
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
140
167
|
}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
21
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
22
|
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -28,11 +29,11 @@ import { Result } from "../types/fp.js";
|
|
|
28
29
|
* @remarks
|
|
29
30
|
* Retrieves a prompt object
|
|
30
31
|
*/
|
|
31
|
-
export
|
|
32
|
+
export function promptsRetrieve(
|
|
32
33
|
client: OrqCore,
|
|
33
34
|
request: operations.GetOnePromptRequest,
|
|
34
35
|
options?: RequestOptions,
|
|
35
|
-
):
|
|
36
|
+
): APIPromise<
|
|
36
37
|
Result<
|
|
37
38
|
operations.GetOnePromptResponseBody,
|
|
38
39
|
| APIError
|
|
@@ -43,6 +44,32 @@ export async function promptsRetrieve(
|
|
|
43
44
|
| RequestTimeoutError
|
|
44
45
|
| ConnectionError
|
|
45
46
|
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: OrqCore,
|
|
57
|
+
request: operations.GetOnePromptRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.GetOnePromptResponseBody,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
46
73
|
> {
|
|
47
74
|
const parsed = safeParse(
|
|
48
75
|
request,
|
|
@@ -50,7 +77,7 @@ export async function promptsRetrieve(
|
|
|
50
77
|
"Input validation failed",
|
|
51
78
|
);
|
|
52
79
|
if (!parsed.ok) {
|
|
53
|
-
return parsed;
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
54
81
|
}
|
|
55
82
|
const payload = parsed.value;
|
|
56
83
|
const body = null;
|
|
@@ -73,7 +100,7 @@ export async function promptsRetrieve(
|
|
|
73
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
74
101
|
|
|
75
102
|
const context = {
|
|
76
|
-
baseURL: options?.serverURL ?? "",
|
|
103
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
77
104
|
operationID: "GetOnePrompt",
|
|
78
105
|
oAuth2Scopes: [],
|
|
79
106
|
|
|
@@ -96,7 +123,7 @@ export async function promptsRetrieve(
|
|
|
96
123
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
97
124
|
}, options);
|
|
98
125
|
if (!requestRes.ok) {
|
|
99
|
-
return requestRes;
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
100
127
|
}
|
|
101
128
|
const req = requestRes.value;
|
|
102
129
|
|
|
@@ -107,7 +134,7 @@ export async function promptsRetrieve(
|
|
|
107
134
|
retryCodes: context.retryCodes,
|
|
108
135
|
});
|
|
109
136
|
if (!doResult.ok) {
|
|
110
|
-
return doResult;
|
|
137
|
+
return [doResult, { status: "request-error", request: req }];
|
|
111
138
|
}
|
|
112
139
|
const response = doResult.value;
|
|
113
140
|
|
|
@@ -126,8 +153,8 @@ export async function promptsRetrieve(
|
|
|
126
153
|
M.fail("5XX"),
|
|
127
154
|
)(response);
|
|
128
155
|
if (!result.ok) {
|
|
129
|
-
return result;
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
130
157
|
}
|
|
131
158
|
|
|
132
|
-
return result;
|
|
159
|
+
return [result, { status: "complete", request: req, response }];
|
|
133
160
|
}
|
|
@@ -21,16 +21,17 @@ import {
|
|
|
21
21
|
import * as errors from "../models/errors/index.js";
|
|
22
22
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
25
|
import { Result } from "../types/fp.js";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Update a prompt
|
|
28
29
|
*/
|
|
29
|
-
export
|
|
30
|
+
export function promptsUpdate(
|
|
30
31
|
client: OrqCore,
|
|
31
32
|
request: operations.UpdatePromptRequest,
|
|
32
33
|
options?: RequestOptions,
|
|
33
|
-
):
|
|
34
|
+
): APIPromise<
|
|
34
35
|
Result<
|
|
35
36
|
operations.UpdatePromptResponseBody,
|
|
36
37
|
| errors.UpdatePromptResponseBody
|
|
@@ -42,6 +43,33 @@ export async function promptsUpdate(
|
|
|
42
43
|
| RequestTimeoutError
|
|
43
44
|
| ConnectionError
|
|
44
45
|
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: OrqCore,
|
|
56
|
+
request: operations.UpdatePromptRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.UpdatePromptResponseBody,
|
|
62
|
+
| errors.UpdatePromptResponseBody
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
45
73
|
> {
|
|
46
74
|
const parsed = safeParse(
|
|
47
75
|
request,
|
|
@@ -49,7 +77,7 @@ export async function promptsUpdate(
|
|
|
49
77
|
"Input validation failed",
|
|
50
78
|
);
|
|
51
79
|
if (!parsed.ok) {
|
|
52
|
-
return parsed;
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
53
81
|
}
|
|
54
82
|
const payload = parsed.value;
|
|
55
83
|
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
@@ -73,7 +101,7 @@ export async function promptsUpdate(
|
|
|
73
101
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
74
102
|
|
|
75
103
|
const context = {
|
|
76
|
-
baseURL: options?.serverURL ?? "",
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
77
105
|
operationID: "UpdatePrompt",
|
|
78
106
|
oAuth2Scopes: [],
|
|
79
107
|
|
|
@@ -96,7 +124,7 @@ export async function promptsUpdate(
|
|
|
96
124
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
97
125
|
}, options);
|
|
98
126
|
if (!requestRes.ok) {
|
|
99
|
-
return requestRes;
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
100
128
|
}
|
|
101
129
|
const req = requestRes.value;
|
|
102
130
|
|
|
@@ -107,7 +135,7 @@ export async function promptsUpdate(
|
|
|
107
135
|
retryCodes: context.retryCodes,
|
|
108
136
|
});
|
|
109
137
|
if (!doResult.ok) {
|
|
110
|
-
return doResult;
|
|
138
|
+
return [doResult, { status: "request-error", request: req }];
|
|
111
139
|
}
|
|
112
140
|
const response = doResult.value;
|
|
113
141
|
|
|
@@ -132,8 +160,8 @@ export async function promptsUpdate(
|
|
|
132
160
|
M.fail("5XX"),
|
|
133
161
|
)(response, { extraFields: responseFields });
|
|
134
162
|
if (!result.ok) {
|
|
135
|
-
return result;
|
|
163
|
+
return [result, { status: "complete", request: req, response }];
|
|
136
164
|
}
|
|
137
165
|
|
|
138
|
-
return result;
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
139
167
|
}
|
|
@@ -20,16 +20,17 @@ import {
|
|
|
20
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
21
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
22
|
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
23
24
|
import { Result } from "../types/fp.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Retrieve a remote config
|
|
27
28
|
*/
|
|
28
|
-
export
|
|
29
|
+
export function remoteconfigsRetrieve(
|
|
29
30
|
client: OrqCore,
|
|
30
31
|
request?: operations.RemoteConfigsGetConfigRequestBody | undefined,
|
|
31
32
|
options?: RequestOptions,
|
|
32
|
-
):
|
|
33
|
+
): APIPromise<
|
|
33
34
|
Result<
|
|
34
35
|
operations.RemoteConfigsGetConfigResponseBody,
|
|
35
36
|
| APIError
|
|
@@ -40,6 +41,32 @@ export async function remoteconfigsRetrieve(
|
|
|
40
41
|
| RequestTimeoutError
|
|
41
42
|
| ConnectionError
|
|
42
43
|
>
|
|
44
|
+
> {
|
|
45
|
+
return new APIPromise($do(
|
|
46
|
+
client,
|
|
47
|
+
request,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function $do(
|
|
53
|
+
client: OrqCore,
|
|
54
|
+
request?: operations.RemoteConfigsGetConfigRequestBody | undefined,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): Promise<
|
|
57
|
+
[
|
|
58
|
+
Result<
|
|
59
|
+
operations.RemoteConfigsGetConfigResponseBody,
|
|
60
|
+
| APIError
|
|
61
|
+
| SDKValidationError
|
|
62
|
+
| UnexpectedClientError
|
|
63
|
+
| InvalidRequestError
|
|
64
|
+
| RequestAbortedError
|
|
65
|
+
| RequestTimeoutError
|
|
66
|
+
| ConnectionError
|
|
67
|
+
>,
|
|
68
|
+
APICall,
|
|
69
|
+
]
|
|
43
70
|
> {
|
|
44
71
|
const parsed = safeParse(
|
|
45
72
|
request,
|
|
@@ -49,7 +76,7 @@ export async function remoteconfigsRetrieve(
|
|
|
49
76
|
"Input validation failed",
|
|
50
77
|
);
|
|
51
78
|
if (!parsed.ok) {
|
|
52
|
-
return parsed;
|
|
79
|
+
return [parsed, { status: "invalid" }];
|
|
53
80
|
}
|
|
54
81
|
const payload = parsed.value;
|
|
55
82
|
const body = payload === undefined
|
|
@@ -68,7 +95,7 @@ export async function remoteconfigsRetrieve(
|
|
|
68
95
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
69
96
|
|
|
70
97
|
const context = {
|
|
71
|
-
baseURL: options?.serverURL ?? "",
|
|
98
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
72
99
|
operationID: "RemoteConfigsGetConfig",
|
|
73
100
|
oAuth2Scopes: [],
|
|
74
101
|
|
|
@@ -91,7 +118,7 @@ export async function remoteconfigsRetrieve(
|
|
|
91
118
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
92
119
|
}, options);
|
|
93
120
|
if (!requestRes.ok) {
|
|
94
|
-
return requestRes;
|
|
121
|
+
return [requestRes, { status: "invalid" }];
|
|
95
122
|
}
|
|
96
123
|
const req = requestRes.value;
|
|
97
124
|
|
|
@@ -102,7 +129,7 @@ export async function remoteconfigsRetrieve(
|
|
|
102
129
|
retryCodes: context.retryCodes,
|
|
103
130
|
});
|
|
104
131
|
if (!doResult.ok) {
|
|
105
|
-
return doResult;
|
|
132
|
+
return [doResult, { status: "request-error", request: req }];
|
|
106
133
|
}
|
|
107
134
|
const response = doResult.value;
|
|
108
135
|
|
|
@@ -121,8 +148,8 @@ export async function remoteconfigsRetrieve(
|
|
|
121
148
|
M.fail([500, "5XX"]),
|
|
122
149
|
)(response);
|
|
123
150
|
if (!result.ok) {
|
|
124
|
-
return result;
|
|
151
|
+
return [result, { status: "complete", request: req, response }];
|
|
125
152
|
}
|
|
126
153
|
|
|
127
|
-
return result;
|
|
154
|
+
return [result, { status: "complete", request: req, response }];
|
|
128
155
|
}
|
package/src/lib/config.ts
CHANGED
|
@@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
64
64
|
export const SDK_METADATA = {
|
|
65
65
|
language: "typescript",
|
|
66
66
|
openapiDocVersion: "2.0",
|
|
67
|
-
sdkVersion: "3.2.0-rc.
|
|
68
|
-
genVersion: "2.
|
|
69
|
-
userAgent: "speakeasy-sdk/typescript 3.2.0-rc.
|
|
67
|
+
sdkVersion: "3.2.0-rc.8",
|
|
68
|
+
genVersion: "2.515.4",
|
|
69
|
+
userAgent: "speakeasy-sdk/typescript 3.2.0-rc.8 2.515.4 2.0 @orq-ai/node",
|
|
70
70
|
} as const;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -79,7 +79,7 @@ export class ClientSDK {
|
|
|
79
79
|
readonly #httpClient: HTTPClient;
|
|
80
80
|
readonly #hooks: SDKHooks;
|
|
81
81
|
readonly #logger?: Logger | undefined;
|
|
82
|
-
|
|
82
|
+
public readonly _baseURL: URL | null;
|
|
83
83
|
public readonly _options: SDKOptions & { hooks?: SDKHooks };
|
|
84
84
|
|
|
85
85
|
constructor(options: SDKOptions = {}) {
|
|
@@ -177,7 +177,7 @@ export const CreateContactResponseBody$inboundSchema: z.ZodType<
|
|
|
177
177
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
178
178
|
.optional(),
|
|
179
179
|
updated: z.string().datetime({ offset: true }).default(
|
|
180
|
-
"2025-02-
|
|
180
|
+
"2025-02-19T06:59:00.576Z",
|
|
181
181
|
).transform(v => new Date(v)),
|
|
182
182
|
}).transform((v) => {
|
|
183
183
|
return remap$(v, {
|
|
@@ -214,7 +214,7 @@ export const CreateContactResponseBody$outboundSchema: z.ZodType<
|
|
|
214
214
|
tags: z.array(z.string()).optional(),
|
|
215
215
|
metadata: z.record(z.any()).optional(),
|
|
216
216
|
created: z.date().transform(v => v.toISOString()).optional(),
|
|
217
|
-
updated: z.date().default(() => new Date("2025-02-
|
|
217
|
+
updated: z.date().default(() => new Date("2025-02-19T06:59:00.576Z"))
|
|
218
218
|
.transform(v => v.toISOString()),
|
|
219
219
|
}).transform((v) => {
|
|
220
220
|
return remap$(v, {
|
|
@@ -145,7 +145,7 @@ export const FileGetResponseBody$inboundSchema: z.ZodType<
|
|
|
145
145
|
file_name: z.string(),
|
|
146
146
|
workspace_id: z.string(),
|
|
147
147
|
created: z.string().datetime({ offset: true }).default(
|
|
148
|
-
"2025-02-
|
|
148
|
+
"2025-02-19T06:59:01.710Z",
|
|
149
149
|
).transform(v => new Date(v)),
|
|
150
150
|
}).transform((v) => {
|
|
151
151
|
return remap$(v, {
|
|
@@ -179,7 +179,7 @@ export const FileGetResponseBody$outboundSchema: z.ZodType<
|
|
|
179
179
|
bytes: z.number(),
|
|
180
180
|
fileName: z.string(),
|
|
181
181
|
workspaceId: z.string(),
|
|
182
|
-
created: z.date().default(() => new Date("2025-02-
|
|
182
|
+
created: z.date().default(() => new Date("2025-02-19T06:59:01.710Z"))
|
|
183
183
|
.transform(v => v.toISOString()),
|
|
184
184
|
}).transform((v) => {
|
|
185
185
|
return remap$(v, {
|
|
@@ -195,7 +195,7 @@ export const FileListData$inboundSchema: z.ZodType<
|
|
|
195
195
|
file_name: z.string(),
|
|
196
196
|
workspace_id: z.string(),
|
|
197
197
|
created: z.string().datetime({ offset: true }).default(
|
|
198
|
-
"2025-02-
|
|
198
|
+
"2025-02-19T06:59:01.710Z",
|
|
199
199
|
).transform(v => new Date(v)),
|
|
200
200
|
}).transform((v) => {
|
|
201
201
|
return remap$(v, {
|
|
@@ -229,7 +229,7 @@ export const FileListData$outboundSchema: z.ZodType<
|
|
|
229
229
|
bytes: z.number(),
|
|
230
230
|
fileName: z.string(),
|
|
231
231
|
workspaceId: z.string(),
|
|
232
|
-
created: z.date().default(() => new Date("2025-02-
|
|
232
|
+
created: z.date().default(() => new Date("2025-02-19T06:59:01.710Z"))
|
|
233
233
|
.transform(v => v.toISOString()),
|
|
234
234
|
}).transform((v) => {
|
|
235
235
|
return remap$(v, {
|
|
@@ -245,7 +245,7 @@ export const FileUploadResponseBody$inboundSchema: z.ZodType<
|
|
|
245
245
|
file_name: z.string(),
|
|
246
246
|
workspace_id: z.string(),
|
|
247
247
|
created: z.string().datetime({ offset: true }).default(
|
|
248
|
-
"2025-02-
|
|
248
|
+
"2025-02-19T06:59:01.710Z",
|
|
249
249
|
).transform(v => new Date(v)),
|
|
250
250
|
}).transform((v) => {
|
|
251
251
|
return remap$(v, {
|
|
@@ -279,7 +279,7 @@ export const FileUploadResponseBody$outboundSchema: z.ZodType<
|
|
|
279
279
|
bytes: z.number(),
|
|
280
280
|
fileName: z.string(),
|
|
281
281
|
workspaceId: z.string(),
|
|
282
|
-
created: z.date().default(() => new Date("2025-02-
|
|
282
|
+
created: z.date().default(() => new Date("2025-02-19T06:59:01.710Z"))
|
|
283
283
|
.transform(v => v.toISOString()),
|
|
284
284
|
}).transform((v) => {
|
|
285
285
|
return remap$(v, {
|