@continuous-labs/sdk 0.0.8 → 0.0.10
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 +10 -0
- package/esm/funcs/simulations-advance-simulation-time.d.ts +19 -0
- package/esm/funcs/simulations-advance-simulation-time.d.ts.map +1 -0
- package/esm/funcs/simulations-advance-simulation-time.js +94 -0
- package/esm/funcs/simulations-advance-simulation-time.js.map +1 -0
- package/esm/funcs/simulations-get-simulation-advance.d.ts +19 -0
- package/esm/funcs/simulations-get-simulation-advance.d.ts.map +1 -0
- package/esm/funcs/simulations-get-simulation-advance.js +98 -0
- package/esm/funcs/simulations-get-simulation-advance.js.map +1 -0
- package/esm/funcs/simulations-list-simulation-advance-events.d.ts +19 -0
- package/esm/funcs/simulations-list-simulation-advance-events.d.ts.map +1 -0
- package/esm/funcs/simulations-list-simulation-advance-events.js +103 -0
- package/esm/funcs/simulations-list-simulation-advance-events.js.map +1 -0
- package/esm/funcs/simulators-build-simulator.d.ts +1 -1
- package/esm/funcs/simulators-build-simulator.js +1 -1
- package/esm/funcs/worlds-advance-world-time.d.ts +19 -0
- package/esm/funcs/worlds-advance-world-time.d.ts.map +1 -0
- package/esm/funcs/worlds-advance-world-time.js +94 -0
- package/esm/funcs/worlds-advance-world-time.js.map +1 -0
- package/esm/funcs/worlds-build-world.d.ts +1 -1
- package/esm/funcs/worlds-build-world.js +1 -1
- package/esm/funcs/worlds-get-world-advance.d.ts +19 -0
- package/esm/funcs/worlds-get-world-advance.d.ts.map +1 -0
- package/esm/funcs/worlds-get-world-advance.js +98 -0
- package/esm/funcs/worlds-get-world-advance.js.map +1 -0
- package/esm/funcs/worlds-start-world.js +4 -5
- package/esm/funcs/worlds-start-world.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/advance-time-input-body.d.ts +15 -0
- package/esm/models/advance-time-input-body.d.ts.map +1 -0
- package/esm/models/advance-time-input-body.js +12 -0
- package/esm/models/advance-time-input-body.js.map +1 -0
- package/esm/models/build-simulator-request.d.ts +9 -4
- package/esm/models/build-simulator-request.d.ts.map +1 -1
- package/esm/models/build-simulator-request.js +5 -3
- package/esm/models/build-simulator-request.js.map +1 -1
- package/esm/models/build-tool-call.d.ts +17 -0
- package/esm/models/build-tool-call.d.ts.map +1 -0
- package/esm/models/build-tool-call.js +15 -0
- package/esm/models/build-tool-call.js.map +1 -0
- package/esm/models/build-world-request.d.ts +34 -0
- package/esm/models/build-world-request.d.ts.map +1 -1
- package/esm/models/build-world-request.js +21 -2
- package/esm/models/build-world-request.js.map +1 -1
- package/esm/models/clock-advance-member.d.ts +42 -0
- package/esm/models/clock-advance-member.d.ts.map +1 -0
- package/esm/models/clock-advance-member.js +36 -0
- package/esm/models/clock-advance-member.js.map +1 -0
- package/esm/models/clock-advance.d.ts +56 -0
- package/esm/models/clock-advance.d.ts.map +1 -0
- package/esm/models/clock-advance.js +40 -0
- package/esm/models/clock-advance.js.map +1 -0
- package/esm/models/clock-event.d.ts +25 -0
- package/esm/models/clock-event.d.ts.map +1 -0
- package/esm/models/clock-event.js +23 -0
- package/esm/models/clock-event.js.map +1 -0
- package/esm/models/create-simulation-request.d.ts +5 -0
- package/esm/models/create-simulation-request.d.ts.map +1 -1
- package/esm/models/create-simulation-request.js +2 -0
- package/esm/models/create-simulation-request.js.map +1 -1
- package/esm/models/created-simulation.d.ts +12 -0
- package/esm/models/created-simulation.d.ts.map +1 -1
- package/esm/models/created-simulation.js +6 -0
- package/esm/models/created-simulation.js.map +1 -1
- package/esm/models/index.d.ts +9 -1
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +9 -1
- package/esm/models/index.js.map +1 -1
- package/esm/models/list-advance-events-output-body.d.ts +18 -0
- package/esm/models/list-advance-events-output-body.d.ts.map +1 -0
- package/esm/models/list-advance-events-output-body.js +21 -0
- package/esm/models/list-advance-events-output-body.js.map +1 -0
- package/esm/models/operations/advance-simulation-time.d.ts +23 -0
- package/esm/models/operations/advance-simulation-time.d.ts.map +1 -0
- package/esm/models/operations/advance-simulation-time.js +20 -0
- package/esm/models/operations/advance-simulation-time.js.map +1 -0
- package/esm/models/operations/advance-world-time.d.ts +23 -0
- package/esm/models/operations/advance-world-time.d.ts.map +1 -0
- package/esm/models/operations/advance-world-time.js +20 -0
- package/esm/models/operations/advance-world-time.js.map +1 -0
- package/esm/models/operations/get-simulation-advance.d.ts +20 -0
- package/esm/models/operations/get-simulation-advance.d.ts.map +1 -0
- package/esm/models/operations/get-simulation-advance.js +18 -0
- package/esm/models/operations/get-simulation-advance.js.map +1 -0
- package/esm/models/operations/get-world-advance.d.ts +20 -0
- package/esm/models/operations/get-world-advance.d.ts.map +1 -0
- package/esm/models/operations/get-world-advance.js +18 -0
- package/esm/models/operations/get-world-advance.js.map +1 -0
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-simulation-advance-events.d.ts +30 -0
- package/esm/models/operations/list-simulation-advance-events.d.ts.map +1 -0
- package/esm/models/operations/list-simulation-advance-events.js +20 -0
- package/esm/models/operations/list-simulation-advance-events.js.map +1 -0
- package/esm/models/operations/list-simulators.d.ts +1 -0
- package/esm/models/operations/list-simulators.d.ts.map +1 -1
- package/esm/models/operations/list-simulators.js +1 -0
- package/esm/models/operations/list-simulators.js.map +1 -1
- package/esm/models/operations/start-world.d.ts +3 -0
- package/esm/models/operations/start-world.d.ts.map +1 -1
- package/esm/models/operations/start-world.js +2 -0
- package/esm/models/operations/start-world.js.map +1 -1
- package/esm/models/resource-error.d.ts +17 -0
- package/esm/models/resource-error.d.ts.map +1 -0
- package/esm/models/resource-error.js +15 -0
- package/esm/models/resource-error.js.map +1 -0
- package/esm/models/simulation.d.ts +12 -0
- package/esm/models/simulation.d.ts.map +1 -1
- package/esm/models/simulation.js +6 -0
- package/esm/models/simulation.js.map +1 -1
- package/esm/models/simulator-build-progress.d.ts +9 -4
- package/esm/models/simulator-build-progress.d.ts.map +1 -1
- package/esm/models/simulator-build-progress.js +6 -3
- package/esm/models/simulator-build-progress.js.map +1 -1
- package/esm/models/simulator.d.ts +25 -3
- package/esm/models/simulator.d.ts.map +1 -1
- package/esm/models/simulator.js +14 -1
- package/esm/models/simulator.js.map +1 -1
- package/esm/models/start-world-request.d.ts +15 -0
- package/esm/models/start-world-request.d.ts.map +1 -0
- package/esm/models/start-world-request.js +17 -0
- package/esm/models/start-world-request.js.map +1 -0
- package/esm/models/step.d.ts +30 -0
- package/esm/models/step.d.ts.map +1 -1
- package/esm/models/step.js +24 -2
- package/esm/models/step.js.map +1 -1
- package/esm/models/world-build-progress.d.ts +85 -0
- package/esm/models/world-build-progress.d.ts.map +1 -0
- package/esm/models/world-build-progress.js +61 -0
- package/esm/models/world-build-progress.js.map +1 -0
- package/esm/models/world.d.ts +26 -6
- package/esm/models/world.d.ts.map +1 -1
- package/esm/models/world.js +11 -3
- package/esm/models/world.js.map +1 -1
- package/esm/sdk/simulations.d.ts +21 -0
- package/esm/sdk/simulations.d.ts.map +1 -1
- package/esm/sdk/simulations.js +30 -0
- package/esm/sdk/simulations.js.map +1 -1
- package/esm/sdk/simulators.d.ts +1 -1
- package/esm/sdk/simulators.js +1 -1
- package/esm/sdk/worlds.d.ts +15 -1
- package/esm/sdk/worlds.d.ts.map +1 -1
- package/esm/sdk/worlds.js +21 -1
- package/esm/sdk/worlds.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/simulations-advance-simulation-time.ts +192 -0
- package/src/funcs/simulations-get-simulation-advance.ts +190 -0
- package/src/funcs/simulations-list-simulation-advance-events.ts +199 -0
- package/src/funcs/simulators-build-simulator.ts +1 -1
- package/src/funcs/worlds-advance-world-time.ts +192 -0
- package/src/funcs/worlds-build-world.ts +1 -1
- package/src/funcs/worlds-get-world-advance.ts +187 -0
- package/src/funcs/worlds-start-world.ts +8 -5
- package/src/lib/config.ts +2 -2
- package/src/models/advance-time-input-body.ts +33 -0
- package/src/models/build-simulator-request.ts +16 -7
- package/src/models/build-tool-call.ts +39 -0
- package/src/models/build-world-request.ts +57 -4
- package/src/models/clock-advance-member.ts +87 -0
- package/src/models/clock-advance.ts +102 -0
- package/src/models/clock-event.ts +55 -0
- package/src/models/create-simulation-request.ts +7 -0
- package/src/models/created-simulation.ts +18 -0
- package/src/models/index.ts +9 -1
- package/src/models/list-advance-events-output-body.ts +48 -0
- package/src/models/operations/advance-simulation-time.ts +53 -0
- package/src/models/operations/advance-world-time.ts +51 -0
- package/src/models/operations/get-simulation-advance.ts +49 -0
- package/src/models/operations/get-world-advance.ts +47 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/list-simulation-advance-events.ts +61 -0
- package/src/models/operations/list-simulators.ts +1 -0
- package/src/models/operations/start-world.ts +4 -0
- package/src/models/resource-error.ts +39 -0
- package/src/models/simulation.ts +18 -0
- package/src/models/simulator-build-progress.ts +21 -7
- package/src/models/simulator.ts +33 -3
- package/src/models/start-world-request.ts +41 -0
- package/src/models/step.ts +52 -4
- package/src/models/world-build-progress.ts +152 -0
- package/src/models/world.ts +37 -7
- package/src/sdk/simulations.ts +54 -0
- package/src/sdk/simulators.ts +1 -1
- package/src/sdk/worlds.ts +37 -1
- package/esm/models/world-build.d.ts +0 -31
- package/esm/models/world-build.d.ts.map +0 -1
- package/esm/models/world-build.js +0 -29
- package/esm/models/world-build.js.map +0 -1
- package/src/models/world-build.ts +0 -60
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ContinuousCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import { ContinuousError } from "../models/errors/continuous-error.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/http-client-errors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as models from "../models/index.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Advance World Time
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Fences all members, advances each local clock, and returns a durable operation. A partial failure keeps members fenced while the operation retries. The World clock changes after all members commit.
|
|
36
|
+
*/
|
|
37
|
+
export function worldsAdvanceWorldTime(
|
|
38
|
+
client: ContinuousCore,
|
|
39
|
+
request: operations.AdvanceWorldTimeRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
models.ClockAdvance,
|
|
44
|
+
| errors.ErrorT
|
|
45
|
+
| ContinuousError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: ContinuousCore,
|
|
64
|
+
request: operations.AdvanceWorldTimeRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
models.ClockAdvance,
|
|
70
|
+
| errors.ErrorT
|
|
71
|
+
| ContinuousError
|
|
72
|
+
| ResponseValidationError
|
|
73
|
+
| ConnectionError
|
|
74
|
+
| RequestAbortedError
|
|
75
|
+
| RequestTimeoutError
|
|
76
|
+
| InvalidRequestError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
82
|
+
> {
|
|
83
|
+
const parsed = safeParse(
|
|
84
|
+
request,
|
|
85
|
+
(value) =>
|
|
86
|
+
z.parse(operations.AdvanceWorldTimeRequest$outboundSchema, value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
id: encodeSimple("id", payload.id, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
const path = pathToFunc("/v1/worlds/{id}/advance-time")(pathParams);
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
Accept: "application/json",
|
|
106
|
+
"Idempotency-Key": encodeSimple(
|
|
107
|
+
"Idempotency-Key",
|
|
108
|
+
payload["Idempotency-Key"],
|
|
109
|
+
{ explode: false, charEncoding: "none" },
|
|
110
|
+
),
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "advance-world-time",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.apiKeyAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "POST",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
150
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
151
|
+
retryConfig: context.retryConfig,
|
|
152
|
+
retryCodes: context.retryCodes,
|
|
153
|
+
});
|
|
154
|
+
if (!doResult.ok) {
|
|
155
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
|
+
}
|
|
157
|
+
const response = doResult.value;
|
|
158
|
+
|
|
159
|
+
const responseFields = {
|
|
160
|
+
HttpMeta: { Response: response, Request: req },
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const [result] = await M.match<
|
|
164
|
+
models.ClockAdvance,
|
|
165
|
+
| errors.ErrorT
|
|
166
|
+
| ContinuousError
|
|
167
|
+
| ResponseValidationError
|
|
168
|
+
| ConnectionError
|
|
169
|
+
| RequestAbortedError
|
|
170
|
+
| RequestTimeoutError
|
|
171
|
+
| InvalidRequestError
|
|
172
|
+
| UnexpectedClientError
|
|
173
|
+
| SDKValidationError
|
|
174
|
+
>(
|
|
175
|
+
M.json(202, models.ClockAdvance$inboundSchema),
|
|
176
|
+
M.jsonErr(
|
|
177
|
+
[400, 401, 403, 404, 408, 409, 413, 415, 422],
|
|
178
|
+
errors.ErrorT$inboundSchema,
|
|
179
|
+
{ ctype: "application/problem+json" },
|
|
180
|
+
),
|
|
181
|
+
M.jsonErr([500, 503], errors.ErrorT$inboundSchema, {
|
|
182
|
+
ctype: "application/problem+json",
|
|
183
|
+
}),
|
|
184
|
+
M.fail("4XX"),
|
|
185
|
+
M.fail("5XX"),
|
|
186
|
+
)(response, req, { extraFields: responseFields });
|
|
187
|
+
if (!result.ok) {
|
|
188
|
+
return [result, { status: "complete", request: req, response }];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
|
+
}
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Build World
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Starts an asynchronous World build from ready Simulators and returns it in the
|
|
34
|
+
* Starts an asynchronous World build from ready Simulators and returns it in the pending state. Builds start in queue order when workspace capacity is available. Instructions generate and validate initial synthetic data. Start the World once it is ready to create its Simulations.
|
|
35
35
|
*/
|
|
36
36
|
export function worldsBuildWorld(
|
|
37
37
|
client: ContinuousCore,
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ContinuousCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import { ContinuousError } from "../models/errors/continuous-error.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/http-client-errors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as models from "../models/index.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get World Clock Advance
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Returns durable progress for each member. Members remain fenced until the whole advance can finish.
|
|
36
|
+
*/
|
|
37
|
+
export function worldsGetWorldAdvance(
|
|
38
|
+
client: ContinuousCore,
|
|
39
|
+
request: operations.GetWorldAdvanceRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
models.ClockAdvance,
|
|
44
|
+
| errors.ErrorT
|
|
45
|
+
| ContinuousError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: ContinuousCore,
|
|
64
|
+
request: operations.GetWorldAdvanceRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
models.ClockAdvance,
|
|
70
|
+
| errors.ErrorT
|
|
71
|
+
| ContinuousError
|
|
72
|
+
| ResponseValidationError
|
|
73
|
+
| ConnectionError
|
|
74
|
+
| RequestAbortedError
|
|
75
|
+
| RequestTimeoutError
|
|
76
|
+
| InvalidRequestError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
82
|
+
> {
|
|
83
|
+
const parsed = safeParse(
|
|
84
|
+
request,
|
|
85
|
+
(value) => z.parse(operations.GetWorldAdvanceRequest$outboundSchema, value),
|
|
86
|
+
"Input validation failed",
|
|
87
|
+
);
|
|
88
|
+
if (!parsed.ok) {
|
|
89
|
+
return [parsed, { status: "invalid" }];
|
|
90
|
+
}
|
|
91
|
+
const payload = parsed.value;
|
|
92
|
+
const body = null;
|
|
93
|
+
|
|
94
|
+
const pathParams = {
|
|
95
|
+
advance_id: encodeSimple("advance_id", payload.advance_id, {
|
|
96
|
+
explode: false,
|
|
97
|
+
charEncoding: "percent",
|
|
98
|
+
}),
|
|
99
|
+
id: encodeSimple("id", payload.id, {
|
|
100
|
+
explode: false,
|
|
101
|
+
charEncoding: "percent",
|
|
102
|
+
}),
|
|
103
|
+
};
|
|
104
|
+
const path = pathToFunc("/v1/worlds/{id}/advances/{advance_id}")(pathParams);
|
|
105
|
+
|
|
106
|
+
const headers = new Headers(compactMap({
|
|
107
|
+
Accept: "application/json",
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
111
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
112
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "get-world-advance",
|
|
118
|
+
oAuth2Scopes: null,
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.apiKeyAuth,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "GET",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
body: body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
models.ClockAdvance,
|
|
162
|
+
| errors.ErrorT
|
|
163
|
+
| ContinuousError
|
|
164
|
+
| ResponseValidationError
|
|
165
|
+
| ConnectionError
|
|
166
|
+
| RequestAbortedError
|
|
167
|
+
| RequestTimeoutError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| UnexpectedClientError
|
|
170
|
+
| SDKValidationError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, models.ClockAdvance$inboundSchema),
|
|
173
|
+
M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema, {
|
|
174
|
+
ctype: "application/problem+json",
|
|
175
|
+
}),
|
|
176
|
+
M.jsonErr([500, 503], errors.ErrorT$inboundSchema, {
|
|
177
|
+
ctype: "application/problem+json",
|
|
178
|
+
}),
|
|
179
|
+
M.fail("4XX"),
|
|
180
|
+
M.fail("5XX"),
|
|
181
|
+
)(response, req, { extraFields: responseFields });
|
|
182
|
+
if (!result.ok) {
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { ContinuousCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
9
|
import * as M from "../lib/matchers.js";
|
|
10
10
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -89,7 +89,7 @@ async function $do(
|
|
|
89
89
|
return [parsed, { status: "invalid" }];
|
|
90
90
|
}
|
|
91
91
|
const payload = parsed.value;
|
|
92
|
-
const body =
|
|
92
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
93
93
|
|
|
94
94
|
const pathParams = {
|
|
95
95
|
id: encodeSimple("id", payload.id, {
|
|
@@ -100,6 +100,7 @@ async function $do(
|
|
|
100
100
|
const path = pathToFunc("/v1/worlds/{id}/start")(pathParams);
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
103
104
|
Accept: "application/json",
|
|
104
105
|
}));
|
|
105
106
|
|
|
@@ -166,9 +167,11 @@ async function $do(
|
|
|
166
167
|
| SDKValidationError
|
|
167
168
|
>(
|
|
168
169
|
M.json(200, models.World$inboundSchema),
|
|
169
|
-
M.jsonErr(
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
M.jsonErr(
|
|
171
|
+
[400, 401, 403, 404, 408, 409, 413, 415, 429],
|
|
172
|
+
errors.ErrorT$inboundSchema,
|
|
173
|
+
{ ctype: "application/problem+json" },
|
|
174
|
+
),
|
|
172
175
|
M.jsonErr([500, 503], errors.ErrorT$inboundSchema, {
|
|
173
176
|
ctype: "application/problem+json",
|
|
174
177
|
}),
|
package/src/lib/config.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "v1",
|
|
64
|
-
sdkVersion: "0.0.
|
|
64
|
+
sdkVersion: "0.0.10",
|
|
65
65
|
genVersion: "2.935.1",
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 0.0.
|
|
66
|
+
userAgent: "speakeasy-sdk/typescript 0.0.10 2.935.1 v1 @continuous-labs/sdk",
|
|
67
67
|
} as const;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type AdvanceTimeInputBody = {
|
|
8
|
+
/**
|
|
9
|
+
* Absolute target time in RFC 3339, with at most millisecond precision.
|
|
10
|
+
*/
|
|
11
|
+
to: Date;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type AdvanceTimeInputBody$Outbound = {
|
|
16
|
+
to: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const AdvanceTimeInputBody$outboundSchema: z.ZodMiniType<
|
|
21
|
+
AdvanceTimeInputBody$Outbound,
|
|
22
|
+
AdvanceTimeInputBody
|
|
23
|
+
> = z.object({
|
|
24
|
+
to: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function advanceTimeInputBodyToJSON(
|
|
28
|
+
advanceTimeInputBody: AdvanceTimeInputBody,
|
|
29
|
+
): string {
|
|
30
|
+
return JSON.stringify(
|
|
31
|
+
AdvanceTimeInputBody$outboundSchema.parse(advanceTimeInputBody),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -23,14 +23,16 @@ export type BuildSimulatorRequestBuilder = ClosedEnum<
|
|
|
23
23
|
/**
|
|
24
24
|
* Source specification format. Omission detects the format.
|
|
25
25
|
*/
|
|
26
|
-
export const
|
|
26
|
+
export const BuildSimulatorRequestSpecKind = {
|
|
27
27
|
Openapi: "openapi",
|
|
28
28
|
Wsdl: "wsdl",
|
|
29
29
|
} as const;
|
|
30
30
|
/**
|
|
31
31
|
* Source specification format. Omission detects the format.
|
|
32
32
|
*/
|
|
33
|
-
export type
|
|
33
|
+
export type BuildSimulatorRequestSpecKind = ClosedEnum<
|
|
34
|
+
typeof BuildSimulatorRequestSpecKind
|
|
35
|
+
>;
|
|
34
36
|
|
|
35
37
|
export type BuildSimulatorRequest = {
|
|
36
38
|
/**
|
|
@@ -56,7 +58,11 @@ export type BuildSimulatorRequest = {
|
|
|
56
58
|
/**
|
|
57
59
|
* Source specification format. Omission detects the format.
|
|
58
60
|
*/
|
|
59
|
-
specKind?:
|
|
61
|
+
specKind?: BuildSimulatorRequestSpecKind | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Time limit for generation and validation in seconds, from 1 to 43200. Defaults to 3600 (one hour). Excludes queue wait and finalization. Retries share the same deadline.
|
|
64
|
+
*/
|
|
65
|
+
timeoutSeconds?: number | undefined;
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
/** @internal */
|
|
@@ -65,9 +71,9 @@ export const BuildSimulatorRequestBuilder$outboundSchema: z.ZodMiniEnum<
|
|
|
65
71
|
> = z.enum(BuildSimulatorRequestBuilder);
|
|
66
72
|
|
|
67
73
|
/** @internal */
|
|
68
|
-
export const
|
|
69
|
-
|
|
70
|
-
);
|
|
74
|
+
export const BuildSimulatorRequestSpecKind$outboundSchema: z.ZodMiniEnum<
|
|
75
|
+
typeof BuildSimulatorRequestSpecKind
|
|
76
|
+
> = z.enum(BuildSimulatorRequestSpecKind);
|
|
71
77
|
|
|
72
78
|
/** @internal */
|
|
73
79
|
export type BuildSimulatorRequest$Outbound = {
|
|
@@ -77,6 +83,7 @@ export type BuildSimulatorRequest$Outbound = {
|
|
|
77
83
|
name?: string | undefined;
|
|
78
84
|
parent_id?: string | undefined;
|
|
79
85
|
spec_kind?: string | undefined;
|
|
86
|
+
timeout_seconds: number;
|
|
80
87
|
};
|
|
81
88
|
|
|
82
89
|
/** @internal */
|
|
@@ -90,12 +97,14 @@ export const BuildSimulatorRequest$outboundSchema: z.ZodMiniType<
|
|
|
90
97
|
instructions: z.optional(z.string()),
|
|
91
98
|
name: z.optional(z.string()),
|
|
92
99
|
parentId: z.optional(z.string()),
|
|
93
|
-
specKind: z.optional(
|
|
100
|
+
specKind: z.optional(BuildSimulatorRequestSpecKind$outboundSchema),
|
|
101
|
+
timeoutSeconds: z._default(z.int(), 3600),
|
|
94
102
|
}),
|
|
95
103
|
z.transform((v) => {
|
|
96
104
|
return remap$(v, {
|
|
97
105
|
parentId: "parent_id",
|
|
98
106
|
specKind: "spec_kind",
|
|
107
|
+
timeoutSeconds: "timeout_seconds",
|
|
99
108
|
});
|
|
100
109
|
}),
|
|
101
110
|
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type BuildToolCall = {
|
|
12
|
+
/**
|
|
13
|
+
* Time the call ran.
|
|
14
|
+
*/
|
|
15
|
+
at: Date;
|
|
16
|
+
/**
|
|
17
|
+
* Name of the tool. Arguments and output are private.
|
|
18
|
+
*/
|
|
19
|
+
tool: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const BuildToolCall$inboundSchema: z.ZodMiniType<
|
|
24
|
+
BuildToolCall,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
at: types.date(),
|
|
28
|
+
tool: types.string(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function buildToolCallFromJSON(
|
|
32
|
+
jsonString: string,
|
|
33
|
+
): SafeParseResult<BuildToolCall, SDKValidationError> {
|
|
34
|
+
return safeParse(
|
|
35
|
+
jsonString,
|
|
36
|
+
(x) => BuildToolCall$inboundSchema.parse(JSON.parse(x)),
|
|
37
|
+
`Failed to parse 'BuildToolCall' from JSON`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -3,32 +3,85 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Model provider that builds starting data. Defaults to claude.
|
|
11
|
+
*/
|
|
12
|
+
export const BuildWorldRequestBuilder = {
|
|
13
|
+
Openai: "openai",
|
|
14
|
+
Claude: "claude",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Model provider that builds starting data. Defaults to claude.
|
|
18
|
+
*/
|
|
19
|
+
export type BuildWorldRequestBuilder = ClosedEnum<
|
|
20
|
+
typeof BuildWorldRequestBuilder
|
|
21
|
+
>;
|
|
6
22
|
|
|
7
23
|
export type BuildWorldRequest = {
|
|
24
|
+
/**
|
|
25
|
+
* Model provider that builds starting data. Defaults to claude.
|
|
26
|
+
*/
|
|
27
|
+
builder?: BuildWorldRequestBuilder | undefined;
|
|
8
28
|
/**
|
|
9
29
|
* Describe the initial data, scenario, and relationships. Populated Worlds support up to 8 selected Simulators and 1,000 starting records in total. Named record types replace their default data. At most 16,384 characters and 65,536 UTF-8 bytes. U+0000 is not permitted.
|
|
10
30
|
*/
|
|
11
31
|
instructions?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Name for the World. Omission generates a name. The ID stays its identity, and names need not be unique.
|
|
34
|
+
*/
|
|
35
|
+
name?: string | undefined;
|
|
12
36
|
/**
|
|
13
37
|
* Simulator IDs for the World.
|
|
14
38
|
*/
|
|
15
39
|
simulators: Array<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Simulated time the World starts at, in RFC 3339 format. Omission uses 2024-01-01T00:00:00Z. Saved starting data keeps its build dates.
|
|
42
|
+
*/
|
|
43
|
+
startTime?: Date | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Time limit for generation and validation in seconds, from 1 to 43200. Defaults to 3600 (one hour). Excludes queue wait and finalization. Retries share the same deadline.
|
|
46
|
+
*/
|
|
47
|
+
timeoutSeconds?: number | undefined;
|
|
16
48
|
};
|
|
17
49
|
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const BuildWorldRequestBuilder$outboundSchema: z.ZodMiniEnum<
|
|
52
|
+
typeof BuildWorldRequestBuilder
|
|
53
|
+
> = z.enum(BuildWorldRequestBuilder);
|
|
54
|
+
|
|
18
55
|
/** @internal */
|
|
19
56
|
export type BuildWorldRequest$Outbound = {
|
|
57
|
+
builder: string;
|
|
20
58
|
instructions?: string | undefined;
|
|
59
|
+
name?: string | undefined;
|
|
21
60
|
simulators: Array<string>;
|
|
61
|
+
start_time?: string | undefined;
|
|
62
|
+
timeout_seconds: number;
|
|
22
63
|
};
|
|
23
64
|
|
|
24
65
|
/** @internal */
|
|
25
66
|
export const BuildWorldRequest$outboundSchema: z.ZodMiniType<
|
|
26
67
|
BuildWorldRequest$Outbound,
|
|
27
68
|
BuildWorldRequest
|
|
28
|
-
> = z.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
> = z.pipe(
|
|
70
|
+
z.object({
|
|
71
|
+
builder: z._default(BuildWorldRequestBuilder$outboundSchema, "claude"),
|
|
72
|
+
instructions: z.optional(z.string()),
|
|
73
|
+
name: z.optional(z.string()),
|
|
74
|
+
simulators: z.array(z.string()),
|
|
75
|
+
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
76
|
+
timeoutSeconds: z._default(z.int(), 3600),
|
|
77
|
+
}),
|
|
78
|
+
z.transform((v) => {
|
|
79
|
+
return remap$(v, {
|
|
80
|
+
startTime: "start_time",
|
|
81
|
+
timeoutSeconds: "timeout_seconds",
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
32
85
|
|
|
33
86
|
export function buildWorldRequestToJSON(
|
|
34
87
|
buildWorldRequest: BuildWorldRequest,
|