@usestatemachines/sdk 0.3.0 → 0.4.0
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 +67 -17
- package/agents/SKILL.md +10 -7
- package/agents/index.js +6 -6
- package/agents/llms.txt +16 -9
- package/agents/prompt.md +1 -1
- package/esm/extensions/client.d.ts +11 -1
- package/esm/extensions/client.js +12 -2
- package/esm/extensions/running-environment.d.ts +16 -2
- package/esm/extensions/running-environment.js +24 -2
- package/esm/extensions/wait.d.ts +3 -1
- package/esm/extensions/wait.js +16 -1
- package/esm/funcs/environments-resume.d.ts +11 -0
- package/esm/funcs/environments-resume.js +92 -0
- package/esm/funcs/environments-suspend.d.ts +11 -0
- package/esm/funcs/environments-suspend.js +92 -0
- package/esm/funcs/get-environment-exchange.d.ts +11 -0
- package/esm/funcs/get-environment-exchange.js +96 -0
- package/esm/funcs/get-environment-position.d.ts +11 -0
- package/esm/funcs/get-environment-position.js +92 -0
- package/esm/funcs/list-environment-history.d.ts +11 -0
- package/esm/funcs/list-environment-history.js +97 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/environment-app.d.ts +10 -0
- package/esm/models/environment-app.js +12 -0
- package/esm/models/environment-exchange.d.ts +116 -0
- package/esm/models/environment-exchange.js +126 -0
- package/esm/models/environment-position.d.ts +25 -0
- package/esm/models/environment-position.js +32 -0
- package/esm/models/environment-snapshot.d.ts +3 -2
- package/esm/models/environment-snapshot.js +3 -2
- package/esm/models/environment.d.ts +4 -0
- package/esm/models/environment.js +4 -0
- package/esm/models/error-response.d.ts +8 -0
- package/esm/models/error-response.js +8 -0
- package/esm/models/history-body.d.ts +28 -0
- package/esm/models/history-body.js +33 -0
- package/esm/models/history-cause.d.ts +48 -0
- package/esm/models/history-cause.js +63 -0
- package/esm/models/history-position.d.ts +11 -0
- package/esm/models/history-position.js +15 -0
- package/esm/models/history-transaction.d.ts +16 -0
- package/esm/models/history-transaction.js +20 -0
- package/esm/models/index.d.ts +6 -0
- package/esm/models/index.js +6 -0
- package/esm/models/operations/create-environment-definition.d.ts +92 -10
- package/esm/models/operations/create-environment-definition.js +63 -4
- package/esm/models/operations/get-environment-exchange.d.ts +25 -0
- package/esm/models/operations/get-environment-exchange.js +21 -0
- package/esm/models/operations/get-environment-position.d.ts +23 -0
- package/esm/models/operations/get-environment-position.js +20 -0
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/list-environment-history.d.ts +28 -0
- package/esm/models/operations/list-environment-history.js +24 -0
- package/esm/models/operations/resume-environment.d.ts +23 -0
- package/esm/models/operations/resume-environment.js +20 -0
- package/esm/models/operations/stop-environment.d.ts +1 -1
- package/esm/models/operations/suspend-environment.d.ts +23 -0
- package/esm/models/operations/suspend-environment.js +20 -0
- package/esm/models/release.d.ts +11 -0
- package/esm/models/release.js +10 -0
- package/esm/sdk/environments.d.ts +2 -0
- package/esm/sdk/environments.js +8 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +12 -0
- package/esm/types/discriminated-union.d.ts +24 -0
- package/esm/types/discriminated-union.js +60 -0
- package/esm/types/smart-union.js +2 -1
- package/openapi.json +1433 -142
- package/package.json +3 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
export function listEnvironmentHistory(client, request, options) {
|
|
16
|
+
return new APIPromise($do(client, request, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, request, options) {
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.ListEnvironmentHistoryRequest$outboundSchema, value), "Input validation failed");
|
|
20
|
+
if (!parsed.ok) {
|
|
21
|
+
return [parsed, { status: "invalid" }];
|
|
22
|
+
}
|
|
23
|
+
const payload = parsed.value;
|
|
24
|
+
const body = null;
|
|
25
|
+
const pathParams = {
|
|
26
|
+
environmentId: encodeSimple("environmentId", payload.environmentId, {
|
|
27
|
+
explode: false,
|
|
28
|
+
charEncoding: "percent",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const path = pathToFunc("/v1/environments/{environmentId}/history")(pathParams);
|
|
32
|
+
const query = encodeFormQuery({
|
|
33
|
+
"cursor": payload.cursor,
|
|
34
|
+
"limit": payload.limit,
|
|
35
|
+
});
|
|
36
|
+
const headers = new Headers(compactMap({
|
|
37
|
+
Accept: "application/json",
|
|
38
|
+
}));
|
|
39
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
40
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
41
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
42
|
+
const context = {
|
|
43
|
+
options: client._options,
|
|
44
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
45
|
+
operationID: "listEnvironmentHistory",
|
|
46
|
+
oAuth2Scopes: null,
|
|
47
|
+
resolvedSecurity: requestSecurity,
|
|
48
|
+
securitySource: client._options.apiKey,
|
|
49
|
+
retryConfig: options?.retries
|
|
50
|
+
|| client._options.retryConfig
|
|
51
|
+
|| {
|
|
52
|
+
strategy: "backoff",
|
|
53
|
+
backoff: {
|
|
54
|
+
initialInterval: 1000,
|
|
55
|
+
maxInterval: 5000,
|
|
56
|
+
exponent: 1.5,
|
|
57
|
+
maxElapsedTime: 600000,
|
|
58
|
+
},
|
|
59
|
+
retryConnectionErrors: true,
|
|
60
|
+
}
|
|
61
|
+
|| { strategy: "none" },
|
|
62
|
+
retryCodes: options?.retryCodes || ["502", "503", "504"],
|
|
63
|
+
};
|
|
64
|
+
const requestRes = client._createRequest(context, {
|
|
65
|
+
security: requestSecurity,
|
|
66
|
+
method: "GET",
|
|
67
|
+
baseURL: options?.serverURL,
|
|
68
|
+
path: path,
|
|
69
|
+
headers: headers,
|
|
70
|
+
query: query,
|
|
71
|
+
body: body,
|
|
72
|
+
userAgent: client._options.userAgent,
|
|
73
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
74
|
+
}, options);
|
|
75
|
+
if (!requestRes.ok) {
|
|
76
|
+
return [requestRes, { status: "invalid" }];
|
|
77
|
+
}
|
|
78
|
+
const req = requestRes.value;
|
|
79
|
+
const doResult = await client._do(req, {
|
|
80
|
+
context,
|
|
81
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
82
|
+
retryConfig: context.retryConfig,
|
|
83
|
+
retryCodes: context.retryCodes,
|
|
84
|
+
});
|
|
85
|
+
if (!doResult.ok) {
|
|
86
|
+
return [doResult, { status: "request-error", request: req }];
|
|
87
|
+
}
|
|
88
|
+
const response = doResult.value;
|
|
89
|
+
const responseFields = {
|
|
90
|
+
HttpMeta: { Response: response, Request: req },
|
|
91
|
+
};
|
|
92
|
+
const [result] = await M.match(M.json(200, operations.ListEnvironmentHistoryResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorResponse$inboundSchema), M.jsonErr([500, 503], errors.ErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
93
|
+
if (!result.ok) {
|
|
94
|
+
return [result, { status: "complete", request: req, response }];
|
|
95
|
+
}
|
|
96
|
+
return [result, { status: "complete", request: req, response }];
|
|
97
|
+
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1.0.0";
|
|
34
|
-
readonly sdkVersion: "0.
|
|
34
|
+
readonly sdkVersion: "0.4.0";
|
|
35
35
|
readonly genVersion: "2.941.0";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.4.0 2.941.0 1.0.0 @usestatemachines/sdk";
|
|
37
37
|
};
|
package/esm/lib/config.js
CHANGED
|
@@ -24,7 +24,7 @@ export function serverURLFromOptions(options) {
|
|
|
24
24
|
export const SDK_METADATA = {
|
|
25
25
|
language: "typescript",
|
|
26
26
|
openapiDocVersion: "1.0.0",
|
|
27
|
-
sdkVersion: "0.
|
|
27
|
+
sdkVersion: "0.4.0",
|
|
28
28
|
genVersion: "2.941.0",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.4.0 2.941.0 1.0.0 @usestatemachines/sdk",
|
|
30
30
|
};
|
|
@@ -9,10 +9,16 @@ export declare const Disposal: {
|
|
|
9
9
|
readonly Unknown: "unknown";
|
|
10
10
|
};
|
|
11
11
|
export type Disposal = OpenEnum<typeof Disposal>;
|
|
12
|
+
export type ForkedAt = {
|
|
13
|
+
generation: number;
|
|
14
|
+
lsn: string;
|
|
15
|
+
};
|
|
12
16
|
export declare const EnvironmentAppStatus: {
|
|
13
17
|
readonly Pending: "pending";
|
|
14
18
|
readonly Starting: "starting";
|
|
15
19
|
readonly Ready: "ready";
|
|
20
|
+
readonly Recovering: "recovering";
|
|
21
|
+
readonly Suspended: "suspended";
|
|
16
22
|
readonly Stopping: "stopping";
|
|
17
23
|
readonly Stopped: "stopped";
|
|
18
24
|
readonly Failed: "failed";
|
|
@@ -25,6 +31,7 @@ export type EnvironmentApp = {
|
|
|
25
31
|
disposal: Disposal;
|
|
26
32
|
errorCode: string | null;
|
|
27
33
|
expiresAt: Date | null;
|
|
34
|
+
forkedAt?: ForkedAt | null | undefined;
|
|
28
35
|
id: string;
|
|
29
36
|
key: string;
|
|
30
37
|
provider: string;
|
|
@@ -37,6 +44,9 @@ export type EnvironmentApp = {
|
|
|
37
44
|
/** @internal */
|
|
38
45
|
export declare const Disposal$inboundSchema: z.ZodMiniType<Disposal, unknown>;
|
|
39
46
|
/** @internal */
|
|
47
|
+
export declare const ForkedAt$inboundSchema: z.ZodMiniType<ForkedAt, unknown>;
|
|
48
|
+
export declare function forkedAtFromJSON(jsonString: string): SafeParseResult<ForkedAt, SDKValidationError>;
|
|
49
|
+
/** @internal */
|
|
40
50
|
export declare const EnvironmentAppStatus$inboundSchema: z.ZodMiniType<EnvironmentAppStatus, unknown>;
|
|
41
51
|
/** @internal */
|
|
42
52
|
export declare const EnvironmentApp$inboundSchema: z.ZodMiniType<EnvironmentApp, unknown>;
|
|
@@ -15,6 +15,8 @@ export const EnvironmentAppStatus = {
|
|
|
15
15
|
Pending: "pending",
|
|
16
16
|
Starting: "starting",
|
|
17
17
|
Ready: "ready",
|
|
18
|
+
Recovering: "recovering",
|
|
19
|
+
Suspended: "suspended",
|
|
18
20
|
Stopping: "stopping",
|
|
19
21
|
Stopped: "stopped",
|
|
20
22
|
Failed: "failed",
|
|
@@ -22,6 +24,15 @@ export const EnvironmentAppStatus = {
|
|
|
22
24
|
/** @internal */
|
|
23
25
|
export const Disposal$inboundSchema = openEnums.inboundSchema(Disposal);
|
|
24
26
|
/** @internal */
|
|
27
|
+
export const ForkedAt$inboundSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
generation: types.number(),
|
|
30
|
+
lsn: types.string(),
|
|
31
|
+
});
|
|
32
|
+
export function forkedAtFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => ForkedAt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForkedAt' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
25
36
|
export const EnvironmentAppStatus$inboundSchema = openEnums.inboundSchema(EnvironmentAppStatus);
|
|
26
37
|
/** @internal */
|
|
27
38
|
export const EnvironmentApp$inboundSchema = z.object({
|
|
@@ -31,6 +42,7 @@ export const EnvironmentApp$inboundSchema = z.object({
|
|
|
31
42
|
disposal: Disposal$inboundSchema,
|
|
32
43
|
errorCode: types.nullable(types.string()),
|
|
33
44
|
expiresAt: types.nullable(types.date()),
|
|
45
|
+
forkedAt: z.optional(z.nullable(z.lazy(() => ForkedAt$inboundSchema))),
|
|
34
46
|
id: types.string(),
|
|
35
47
|
key: types.string(),
|
|
36
48
|
provider: types.string(),
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
import { HistoryBody } from "./history-body.js";
|
|
6
|
+
import { HistoryPosition } from "./history-position.js";
|
|
7
|
+
import { HistoryTransaction } from "./history-transaction.js";
|
|
8
|
+
export type EnvironmentExchangeActor = {
|
|
9
|
+
credentialId: string | null;
|
|
10
|
+
vendorUserId: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type Bodies = {
|
|
13
|
+
request: HistoryBody;
|
|
14
|
+
response: HistoryBody;
|
|
15
|
+
};
|
|
16
|
+
export declare const Channel: {
|
|
17
|
+
readonly Api: "api";
|
|
18
|
+
readonly Ui: "ui";
|
|
19
|
+
readonly Reactor: "reactor";
|
|
20
|
+
readonly Timer: "timer";
|
|
21
|
+
readonly InboundWebhook: "inbound-webhook";
|
|
22
|
+
readonly Bootstrap: "bootstrap";
|
|
23
|
+
readonly Restore: "restore";
|
|
24
|
+
};
|
|
25
|
+
export type Channel = OpenEnum<typeof Channel>;
|
|
26
|
+
export type Operation = {
|
|
27
|
+
id: string | null;
|
|
28
|
+
method: string;
|
|
29
|
+
profile: string;
|
|
30
|
+
route: string;
|
|
31
|
+
target: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const Refusal: {
|
|
34
|
+
readonly Auth: "auth";
|
|
35
|
+
readonly NotServed: "not-served";
|
|
36
|
+
readonly Unsupported: "unsupported";
|
|
37
|
+
readonly Limit: "limit";
|
|
38
|
+
readonly Validation: "validation";
|
|
39
|
+
readonly Conflict: "conflict";
|
|
40
|
+
};
|
|
41
|
+
export type Refusal = OpenEnum<typeof Refusal>;
|
|
42
|
+
export type Outcome = {
|
|
43
|
+
refusal: Refusal | null;
|
|
44
|
+
status: number;
|
|
45
|
+
vendorErrorCode: string | null;
|
|
46
|
+
};
|
|
47
|
+
export declare const State: {
|
|
48
|
+
readonly Recorded: "recorded";
|
|
49
|
+
readonly Unknown: "unknown";
|
|
50
|
+
};
|
|
51
|
+
export type State = OpenEnum<typeof State>;
|
|
52
|
+
export declare const ClockSource: {
|
|
53
|
+
readonly Gateway: "gateway";
|
|
54
|
+
readonly Runner: "runner";
|
|
55
|
+
};
|
|
56
|
+
export type ClockSource = OpenEnum<typeof ClockSource>;
|
|
57
|
+
export type Timing = {
|
|
58
|
+
clockSource: ClockSource;
|
|
59
|
+
databaseMs: number;
|
|
60
|
+
environmentTime: string;
|
|
61
|
+
handlerMs: number;
|
|
62
|
+
leaseWaitMs: number;
|
|
63
|
+
responseReadyAt: string;
|
|
64
|
+
};
|
|
65
|
+
export type Trace = {
|
|
66
|
+
parentSpanId: string | null;
|
|
67
|
+
spanId: string;
|
|
68
|
+
traceId: string;
|
|
69
|
+
};
|
|
70
|
+
export type EnvironmentExchange = {
|
|
71
|
+
actor: EnvironmentExchangeActor | null;
|
|
72
|
+
appKey: string;
|
|
73
|
+
bodies: Bodies | null;
|
|
74
|
+
channel: Channel | null;
|
|
75
|
+
eventIds: Array<string>;
|
|
76
|
+
exchangeId: string;
|
|
77
|
+
objectCount: number;
|
|
78
|
+
objects: Array<string>;
|
|
79
|
+
observedAt: Date;
|
|
80
|
+
operation: Operation | null;
|
|
81
|
+
outcome: Outcome | null;
|
|
82
|
+
position: HistoryPosition;
|
|
83
|
+
state: State;
|
|
84
|
+
timing: Timing | null;
|
|
85
|
+
trace: Trace | null;
|
|
86
|
+
transactions: Array<HistoryTransaction>;
|
|
87
|
+
};
|
|
88
|
+
/** @internal */
|
|
89
|
+
export declare const EnvironmentExchangeActor$inboundSchema: z.ZodMiniType<EnvironmentExchangeActor, unknown>;
|
|
90
|
+
export declare function environmentExchangeActorFromJSON(jsonString: string): SafeParseResult<EnvironmentExchangeActor, SDKValidationError>;
|
|
91
|
+
/** @internal */
|
|
92
|
+
export declare const Bodies$inboundSchema: z.ZodMiniType<Bodies, unknown>;
|
|
93
|
+
export declare function bodiesFromJSON(jsonString: string): SafeParseResult<Bodies, SDKValidationError>;
|
|
94
|
+
/** @internal */
|
|
95
|
+
export declare const Channel$inboundSchema: z.ZodMiniType<Channel, unknown>;
|
|
96
|
+
/** @internal */
|
|
97
|
+
export declare const Operation$inboundSchema: z.ZodMiniType<Operation, unknown>;
|
|
98
|
+
export declare function operationFromJSON(jsonString: string): SafeParseResult<Operation, SDKValidationError>;
|
|
99
|
+
/** @internal */
|
|
100
|
+
export declare const Refusal$inboundSchema: z.ZodMiniType<Refusal, unknown>;
|
|
101
|
+
/** @internal */
|
|
102
|
+
export declare const Outcome$inboundSchema: z.ZodMiniType<Outcome, unknown>;
|
|
103
|
+
export declare function outcomeFromJSON(jsonString: string): SafeParseResult<Outcome, SDKValidationError>;
|
|
104
|
+
/** @internal */
|
|
105
|
+
export declare const State$inboundSchema: z.ZodMiniType<State, unknown>;
|
|
106
|
+
/** @internal */
|
|
107
|
+
export declare const ClockSource$inboundSchema: z.ZodMiniType<ClockSource, unknown>;
|
|
108
|
+
/** @internal */
|
|
109
|
+
export declare const Timing$inboundSchema: z.ZodMiniType<Timing, unknown>;
|
|
110
|
+
export declare function timingFromJSON(jsonString: string): SafeParseResult<Timing, SDKValidationError>;
|
|
111
|
+
/** @internal */
|
|
112
|
+
export declare const Trace$inboundSchema: z.ZodMiniType<Trace, unknown>;
|
|
113
|
+
export declare function traceFromJSON(jsonString: string): SafeParseResult<Trace, SDKValidationError>;
|
|
114
|
+
/** @internal */
|
|
115
|
+
export declare const EnvironmentExchange$inboundSchema: z.ZodMiniType<EnvironmentExchange, unknown>;
|
|
116
|
+
export declare function environmentExchangeFromJSON(jsonString: string): SafeParseResult<EnvironmentExchange, SDKValidationError>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import * as types from "../types/primitives.js";
|
|
8
|
+
import { HistoryBody$inboundSchema } from "./history-body.js";
|
|
9
|
+
import { HistoryPosition$inboundSchema, } from "./history-position.js";
|
|
10
|
+
import { HistoryTransaction$inboundSchema, } from "./history-transaction.js";
|
|
11
|
+
export const Channel = {
|
|
12
|
+
Api: "api",
|
|
13
|
+
Ui: "ui",
|
|
14
|
+
Reactor: "reactor",
|
|
15
|
+
Timer: "timer",
|
|
16
|
+
InboundWebhook: "inbound-webhook",
|
|
17
|
+
Bootstrap: "bootstrap",
|
|
18
|
+
Restore: "restore",
|
|
19
|
+
};
|
|
20
|
+
export const Refusal = {
|
|
21
|
+
Auth: "auth",
|
|
22
|
+
NotServed: "not-served",
|
|
23
|
+
Unsupported: "unsupported",
|
|
24
|
+
Limit: "limit",
|
|
25
|
+
Validation: "validation",
|
|
26
|
+
Conflict: "conflict",
|
|
27
|
+
};
|
|
28
|
+
export const State = {
|
|
29
|
+
Recorded: "recorded",
|
|
30
|
+
Unknown: "unknown",
|
|
31
|
+
};
|
|
32
|
+
export const ClockSource = {
|
|
33
|
+
Gateway: "gateway",
|
|
34
|
+
Runner: "runner",
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const EnvironmentExchangeActor$inboundSchema = z.object({
|
|
38
|
+
credentialId: types.nullable(types.string()),
|
|
39
|
+
vendorUserId: types.nullable(types.string()),
|
|
40
|
+
});
|
|
41
|
+
export function environmentExchangeActorFromJSON(jsonString) {
|
|
42
|
+
return safeParse(jsonString, (x) => EnvironmentExchangeActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentExchangeActor' from JSON`);
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const Bodies$inboundSchema = z.object({
|
|
46
|
+
request: HistoryBody$inboundSchema,
|
|
47
|
+
response: HistoryBody$inboundSchema,
|
|
48
|
+
});
|
|
49
|
+
export function bodiesFromJSON(jsonString) {
|
|
50
|
+
return safeParse(jsonString, (x) => Bodies$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bodies' from JSON`);
|
|
51
|
+
}
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const Channel$inboundSchema = openEnums
|
|
54
|
+
.inboundSchema(Channel);
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const Operation$inboundSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
id: types.nullable(types.string()),
|
|
59
|
+
method: types.string(),
|
|
60
|
+
profile: types.string(),
|
|
61
|
+
route: types.string(),
|
|
62
|
+
target: types.string(),
|
|
63
|
+
});
|
|
64
|
+
export function operationFromJSON(jsonString) {
|
|
65
|
+
return safeParse(jsonString, (x) => Operation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operation' from JSON`);
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const Refusal$inboundSchema = openEnums
|
|
69
|
+
.inboundSchema(Refusal);
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const Outcome$inboundSchema = z.object({
|
|
72
|
+
refusal: types.nullable(Refusal$inboundSchema),
|
|
73
|
+
status: types.number(),
|
|
74
|
+
vendorErrorCode: types.nullable(types.string()),
|
|
75
|
+
});
|
|
76
|
+
export function outcomeFromJSON(jsonString) {
|
|
77
|
+
return safeParse(jsonString, (x) => Outcome$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Outcome' from JSON`);
|
|
78
|
+
}
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const State$inboundSchema = openEnums
|
|
81
|
+
.inboundSchema(State);
|
|
82
|
+
/** @internal */
|
|
83
|
+
export const ClockSource$inboundSchema = openEnums.inboundSchema(ClockSource);
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const Timing$inboundSchema = z.object({
|
|
86
|
+
clockSource: ClockSource$inboundSchema,
|
|
87
|
+
databaseMs: types.number(),
|
|
88
|
+
environmentTime: types.string(),
|
|
89
|
+
handlerMs: types.number(),
|
|
90
|
+
leaseWaitMs: types.number(),
|
|
91
|
+
responseReadyAt: types.string(),
|
|
92
|
+
});
|
|
93
|
+
export function timingFromJSON(jsonString) {
|
|
94
|
+
return safeParse(jsonString, (x) => Timing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Timing' from JSON`);
|
|
95
|
+
}
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const Trace$inboundSchema = z.object({
|
|
98
|
+
parentSpanId: types.nullable(types.string()),
|
|
99
|
+
spanId: types.string(),
|
|
100
|
+
traceId: types.string(),
|
|
101
|
+
});
|
|
102
|
+
export function traceFromJSON(jsonString) {
|
|
103
|
+
return safeParse(jsonString, (x) => Trace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Trace' from JSON`);
|
|
104
|
+
}
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const EnvironmentExchange$inboundSchema = z.object({
|
|
107
|
+
actor: types.nullable(z.lazy(() => EnvironmentExchangeActor$inboundSchema)),
|
|
108
|
+
appKey: types.string(),
|
|
109
|
+
bodies: types.nullable(z.lazy(() => Bodies$inboundSchema)),
|
|
110
|
+
channel: types.nullable(Channel$inboundSchema),
|
|
111
|
+
eventIds: z.array(types.string()),
|
|
112
|
+
exchangeId: types.string(),
|
|
113
|
+
objectCount: types.number(),
|
|
114
|
+
objects: z.array(types.string()),
|
|
115
|
+
observedAt: types.date(),
|
|
116
|
+
operation: types.nullable(z.lazy(() => Operation$inboundSchema)),
|
|
117
|
+
outcome: types.nullable(z.lazy(() => Outcome$inboundSchema)),
|
|
118
|
+
position: HistoryPosition$inboundSchema,
|
|
119
|
+
state: State$inboundSchema,
|
|
120
|
+
timing: types.nullable(z.lazy(() => Timing$inboundSchema)),
|
|
121
|
+
trace: types.nullable(z.lazy(() => Trace$inboundSchema)),
|
|
122
|
+
transactions: z.array(HistoryTransaction$inboundSchema),
|
|
123
|
+
});
|
|
124
|
+
export function environmentExchangeFromJSON(jsonString) {
|
|
125
|
+
return safeParse(jsonString, (x) => EnvironmentExchange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentExchange' from JSON`);
|
|
126
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
|
+
export type Position = {
|
|
5
|
+
generation: number;
|
|
6
|
+
lsn: string;
|
|
7
|
+
};
|
|
8
|
+
export type EnvironmentPositionApp = {
|
|
9
|
+
appInstanceId: string;
|
|
10
|
+
key: string;
|
|
11
|
+
position: Position | null;
|
|
12
|
+
};
|
|
13
|
+
export type EnvironmentPosition = {
|
|
14
|
+
apps: Array<EnvironmentPositionApp>;
|
|
15
|
+
environmentId: string;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const Position$inboundSchema: z.ZodMiniType<Position, unknown>;
|
|
19
|
+
export declare function positionFromJSON(jsonString: string): SafeParseResult<Position, SDKValidationError>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const EnvironmentPositionApp$inboundSchema: z.ZodMiniType<EnvironmentPositionApp, unknown>;
|
|
22
|
+
export declare function environmentPositionAppFromJSON(jsonString: string): SafeParseResult<EnvironmentPositionApp, SDKValidationError>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const EnvironmentPosition$inboundSchema: z.ZodMiniType<EnvironmentPosition, unknown>;
|
|
25
|
+
export declare function environmentPositionFromJSON(jsonString: string): SafeParseResult<EnvironmentPosition, SDKValidationError>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as types from "../types/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const Position$inboundSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
generation: types.number(),
|
|
11
|
+
lsn: types.string(),
|
|
12
|
+
});
|
|
13
|
+
export function positionFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => Position$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Position' from JSON`);
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const EnvironmentPositionApp$inboundSchema = z.object({
|
|
18
|
+
appInstanceId: types.string(),
|
|
19
|
+
key: types.string(),
|
|
20
|
+
position: types.nullable(z.lazy(() => Position$inboundSchema)),
|
|
21
|
+
});
|
|
22
|
+
export function environmentPositionAppFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => EnvironmentPositionApp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentPositionApp' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const EnvironmentPosition$inboundSchema = z.object({
|
|
27
|
+
apps: z.array(z.lazy(() => EnvironmentPositionApp$inboundSchema)),
|
|
28
|
+
environmentId: types.string(),
|
|
29
|
+
});
|
|
30
|
+
export function environmentPositionFromJSON(jsonString) {
|
|
31
|
+
return safeParse(jsonString, (x) => EnvironmentPosition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentPosition' from JSON`);
|
|
32
|
+
}
|
|
@@ -5,7 +5,8 @@ import { Actor } from "./actor.js";
|
|
|
5
5
|
import { AppInstanceSnapshot } from "./app-instance-snapshot.js";
|
|
6
6
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
7
7
|
export declare const Consistency: {
|
|
8
|
-
readonly
|
|
8
|
+
readonly Environment: "environment";
|
|
9
|
+
readonly AppInstance: "app_instance";
|
|
9
10
|
};
|
|
10
11
|
export type Consistency = OpenEnum<typeof Consistency>;
|
|
11
12
|
export declare const EnvironmentSnapshotStatus: {
|
|
@@ -16,7 +17,7 @@ export declare const EnvironmentSnapshotStatus: {
|
|
|
16
17
|
export type EnvironmentSnapshotStatus = OpenEnum<typeof EnvironmentSnapshotStatus>;
|
|
17
18
|
export type EnvironmentSnapshot = {
|
|
18
19
|
appInstanceSnapshots: Array<AppInstanceSnapshot>;
|
|
19
|
-
consistency: Consistency;
|
|
20
|
+
consistency: Consistency | null;
|
|
20
21
|
createdAt: Date;
|
|
21
22
|
createdBy: Actor | null;
|
|
22
23
|
deletedAt: Date | null;
|
|
@@ -8,7 +8,8 @@ import * as types from "../types/primitives.js";
|
|
|
8
8
|
import { Actor$inboundSchema } from "./actor.js";
|
|
9
9
|
import { AppInstanceSnapshot$inboundSchema, } from "./app-instance-snapshot.js";
|
|
10
10
|
export const Consistency = {
|
|
11
|
-
|
|
11
|
+
Environment: "environment",
|
|
12
|
+
AppInstance: "app_instance",
|
|
12
13
|
};
|
|
13
14
|
export const EnvironmentSnapshotStatus = {
|
|
14
15
|
Capturing: "capturing",
|
|
@@ -22,7 +23,7 @@ export const EnvironmentSnapshotStatus$inboundSchema = openEnums.inboundSchema(E
|
|
|
22
23
|
/** @internal */
|
|
23
24
|
export const EnvironmentSnapshot$inboundSchema = z.object({
|
|
24
25
|
appInstanceSnapshots: z.array(AppInstanceSnapshot$inboundSchema),
|
|
25
|
-
consistency: Consistency$inboundSchema,
|
|
26
|
+
consistency: types.nullable(Consistency$inboundSchema),
|
|
26
27
|
createdAt: types.date(),
|
|
27
28
|
createdBy: types.nullable(Actor$inboundSchema),
|
|
28
29
|
deletedAt: types.nullable(types.date()),
|
|
@@ -8,6 +8,8 @@ export declare const EnvironmentStatus: {
|
|
|
8
8
|
readonly Queued: "queued";
|
|
9
9
|
readonly Starting: "starting";
|
|
10
10
|
readonly Running: "running";
|
|
11
|
+
readonly Suspending: "suspending";
|
|
12
|
+
readonly Suspended: "suspended";
|
|
11
13
|
readonly Stopping: "stopping";
|
|
12
14
|
readonly Stopped: "stopped";
|
|
13
15
|
readonly Failed: "failed";
|
|
@@ -31,11 +33,13 @@ export type Environment = {
|
|
|
31
33
|
};
|
|
32
34
|
lifetimeMinutes: number;
|
|
33
35
|
name: string | null;
|
|
36
|
+
sourceEnvironmentId: string | null;
|
|
34
37
|
sourceEnvironmentSnapshotId: string | null;
|
|
35
38
|
startedAt: Date | null;
|
|
36
39
|
status: EnvironmentStatus;
|
|
37
40
|
stopReason: StopReason | null;
|
|
38
41
|
stoppedAt: Date | null;
|
|
42
|
+
suspendedAt: Date | null;
|
|
39
43
|
version: number;
|
|
40
44
|
workspaceId: string;
|
|
41
45
|
};
|
|
@@ -11,6 +11,8 @@ export const EnvironmentStatus = {
|
|
|
11
11
|
Queued: "queued",
|
|
12
12
|
Starting: "starting",
|
|
13
13
|
Running: "running",
|
|
14
|
+
Suspending: "suspending",
|
|
15
|
+
Suspended: "suspended",
|
|
14
16
|
Stopping: "stopping",
|
|
15
17
|
Stopped: "stopped",
|
|
16
18
|
Failed: "failed",
|
|
@@ -36,11 +38,13 @@ export const Environment$inboundSchema = z
|
|
|
36
38
|
labels: z.record(z.string(), types.string()),
|
|
37
39
|
lifetimeMinutes: types.number(),
|
|
38
40
|
name: types.nullable(types.string()),
|
|
41
|
+
sourceEnvironmentId: z._default(z.nullable(types.string()), null),
|
|
39
42
|
sourceEnvironmentSnapshotId: z._default(z.nullable(types.string()), null),
|
|
40
43
|
startedAt: types.nullable(types.date()),
|
|
41
44
|
status: EnvironmentStatus$inboundSchema,
|
|
42
45
|
stopReason: types.nullable(StopReason$inboundSchema),
|
|
43
46
|
stoppedAt: types.nullable(types.date()),
|
|
47
|
+
suspendedAt: types.nullable(types.date()),
|
|
44
48
|
version: types.number(),
|
|
45
49
|
workspaceId: types.string(),
|
|
46
50
|
});
|
|
@@ -4,6 +4,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
export declare const Code: {
|
|
6
6
|
readonly BodyTooLarge: "body-too-large";
|
|
7
|
+
readonly CaptureInProgress: "capture-in-progress";
|
|
7
8
|
readonly ConnectionNotAuthorized: "connection-not-authorized";
|
|
8
9
|
readonly ConnectionUnavailable: "connection-unavailable";
|
|
9
10
|
readonly EnvironmentLimit: "environment-limit";
|
|
@@ -23,12 +24,19 @@ export declare const Code: {
|
|
|
23
24
|
readonly LifetimeTooLong: "lifetime-too-long";
|
|
24
25
|
readonly NotFound: "not-found";
|
|
25
26
|
readonly NotReady: "not-ready";
|
|
27
|
+
readonly NotSnapshottable: "not-snapshottable";
|
|
28
|
+
readonly NotSuspended: "not-suspended";
|
|
26
29
|
readonly OrganizationRequired: "organization-required";
|
|
30
|
+
readonly PositionUnavailable: "position-unavailable";
|
|
31
|
+
readonly ReleaseGone: "release-gone";
|
|
32
|
+
readonly ReleaseLifecycle: "release-lifecycle";
|
|
27
33
|
readonly ReleaseUnavailable: "release-unavailable";
|
|
28
34
|
readonly RequestCapacityReached: "request-capacity-reached";
|
|
29
35
|
readonly RequestTimeout: "request-timeout";
|
|
30
36
|
readonly ServiceUnavailable: "service-unavailable";
|
|
31
37
|
readonly SnapshotLimit: "snapshot-limit";
|
|
38
|
+
readonly SnapshotsUnavailable: "snapshots-unavailable";
|
|
39
|
+
readonly SuspendInProgress: "suspend-in-progress";
|
|
32
40
|
readonly Unauthorized: "unauthorized";
|
|
33
41
|
readonly VersionConflict: "version-conflict";
|
|
34
42
|
readonly WorkspaceArchived: "workspace-archived";
|
|
@@ -7,6 +7,7 @@ import * as openEnums from "../types/enums.js";
|
|
|
7
7
|
import * as types from "../types/primitives.js";
|
|
8
8
|
export const Code = {
|
|
9
9
|
BodyTooLarge: "body-too-large",
|
|
10
|
+
CaptureInProgress: "capture-in-progress",
|
|
10
11
|
ConnectionNotAuthorized: "connection-not-authorized",
|
|
11
12
|
ConnectionUnavailable: "connection-unavailable",
|
|
12
13
|
EnvironmentLimit: "environment-limit",
|
|
@@ -26,12 +27,19 @@ export const Code = {
|
|
|
26
27
|
LifetimeTooLong: "lifetime-too-long",
|
|
27
28
|
NotFound: "not-found",
|
|
28
29
|
NotReady: "not-ready",
|
|
30
|
+
NotSnapshottable: "not-snapshottable",
|
|
31
|
+
NotSuspended: "not-suspended",
|
|
29
32
|
OrganizationRequired: "organization-required",
|
|
33
|
+
PositionUnavailable: "position-unavailable",
|
|
34
|
+
ReleaseGone: "release-gone",
|
|
35
|
+
ReleaseLifecycle: "release-lifecycle",
|
|
30
36
|
ReleaseUnavailable: "release-unavailable",
|
|
31
37
|
RequestCapacityReached: "request-capacity-reached",
|
|
32
38
|
RequestTimeout: "request-timeout",
|
|
33
39
|
ServiceUnavailable: "service-unavailable",
|
|
34
40
|
SnapshotLimit: "snapshot-limit",
|
|
41
|
+
SnapshotsUnavailable: "snapshots-unavailable",
|
|
42
|
+
SuspendInProgress: "suspend-in-progress",
|
|
35
43
|
Unauthorized: "unauthorized",
|
|
36
44
|
VersionConflict: "version-conflict",
|
|
37
45
|
WorkspaceArchived: "workspace-archived",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
export type BlobT = {
|
|
6
|
+
bytes: number;
|
|
7
|
+
sha256: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Coverage: {
|
|
10
|
+
readonly Complete: "complete";
|
|
11
|
+
readonly Redacted: "redacted";
|
|
12
|
+
readonly Truncated: "truncated";
|
|
13
|
+
readonly Omitted: "omitted";
|
|
14
|
+
};
|
|
15
|
+
export type Coverage = OpenEnum<typeof Coverage>;
|
|
16
|
+
export type HistoryBody = {
|
|
17
|
+
blob: BlobT | null;
|
|
18
|
+
coverage: Coverage;
|
|
19
|
+
inline: string | null;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const BlobT$inboundSchema: z.ZodMiniType<BlobT, unknown>;
|
|
23
|
+
export declare function blobFromJSON(jsonString: string): SafeParseResult<BlobT, SDKValidationError>;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const Coverage$inboundSchema: z.ZodMiniType<Coverage, unknown>;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const HistoryBody$inboundSchema: z.ZodMiniType<HistoryBody, unknown>;
|
|
28
|
+
export declare function historyBodyFromJSON(jsonString: string): SafeParseResult<HistoryBody, SDKValidationError>;
|