@usestatemachines/sdk 0.2.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 +158 -18
- package/agents/SKILL.md +18 -8
- package/agents/index.js +6 -6
- package/agents/llms.txt +22 -9
- package/agents/prompt.md +2 -2
- package/esm/extensions/apps.d.ts +11 -1
- package/esm/extensions/apps.js +16 -0
- package/esm/extensions/client.d.ts +47 -4
- package/esm/extensions/client.js +107 -12
- package/esm/extensions/errors.d.ts +26 -1
- package/esm/extensions/errors.js +34 -1
- package/esm/extensions/index.d.ts +4 -4
- package/esm/extensions/index.js +1 -1
- package/esm/extensions/running-environment.d.ts +20 -3
- package/esm/extensions/running-environment.js +33 -2
- package/esm/extensions/wait.d.ts +13 -4
- package/esm/extensions/wait.js +38 -13
- package/esm/funcs/environments-list.js +1 -0
- 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/funcs/snapshots-capture.d.ts +11 -0
- package/esm/funcs/snapshots-capture.js +94 -0
- package/esm/funcs/snapshots-delete.d.ts +11 -0
- package/esm/funcs/snapshots-delete.js +92 -0
- package/esm/funcs/snapshots-get.d.ts +11 -0
- package/esm/funcs/snapshots-get.js +92 -0
- package/esm/funcs/snapshots-list.d.ts +11 -0
- package/esm/funcs/snapshots-list.js +98 -0
- package/esm/funcs/snapshots-update.d.ts +11 -0
- package/esm/funcs/snapshots-update.js +93 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/app-instance-snapshot.d.ts +15 -0
- package/esm/models/app-instance-snapshot.js +19 -0
- package/esm/models/create-environment-input.d.ts +6 -2
- package/esm/models/create-environment-input.js +3 -1
- package/esm/models/environment-app.d.ts +11 -0
- package/esm/models/environment-app.js +13 -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 +40 -0
- package/esm/models/environment-snapshot.js +42 -0
- package/esm/models/environment.d.ts +5 -0
- package/esm/models/environment.js +5 -0
- package/esm/models/error-response.d.ts +9 -0
- package/esm/models/error-response.js +9 -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 +8 -0
- package/esm/models/index.js +8 -0
- package/esm/models/operations/capture-snapshot.d.ts +41 -0
- package/esm/models/operations/capture-snapshot.js +36 -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/delete-snapshot.d.ts +23 -0
- package/esm/models/operations/delete-snapshot.js +20 -0
- 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/get-snapshot.d.ts +23 -0
- package/esm/models/operations/get-snapshot.js +20 -0
- package/esm/models/operations/index.d.ts +10 -0
- package/esm/models/operations/index.js +10 -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/list-environments.d.ts +2 -0
- package/esm/models/operations/list-environments.js +1 -0
- package/esm/models/operations/list-snapshots.d.ts +30 -0
- package/esm/models/operations/list-snapshots.js +25 -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/operations/update-snapshot.d.ts +37 -0
- package/esm/models/operations/update-snapshot.js +29 -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 +6 -0
- package/esm/sdk/sdk.js +17 -0
- package/esm/sdk/snapshots.d.ts +9 -0
- package/esm/sdk/snapshots.js +27 -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 +2473 -242
- package/package.json +11 -11
|
@@ -0,0 +1,15 @@
|
|
|
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 AppInstanceSnapshot = {
|
|
5
|
+
appId: string;
|
|
6
|
+
appInstanceKey: string;
|
|
7
|
+
appReleaseId: string;
|
|
8
|
+
capturedAt: Date | null;
|
|
9
|
+
id: string;
|
|
10
|
+
sizeBytes: number | null;
|
|
11
|
+
sourceAppInstanceId: string;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const AppInstanceSnapshot$inboundSchema: z.ZodMiniType<AppInstanceSnapshot, unknown>;
|
|
15
|
+
export declare function appInstanceSnapshotFromJSON(jsonString: string): SafeParseResult<AppInstanceSnapshot, SDKValidationError>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 AppInstanceSnapshot$inboundSchema = z.object({
|
|
9
|
+
appId: types.string(),
|
|
10
|
+
appInstanceKey: types.string(),
|
|
11
|
+
appReleaseId: types.string(),
|
|
12
|
+
capturedAt: types.nullable(types.date()),
|
|
13
|
+
id: types.string(),
|
|
14
|
+
sizeBytes: types.nullable(types.number()),
|
|
15
|
+
sourceAppInstanceId: types.string(),
|
|
16
|
+
});
|
|
17
|
+
export function appInstanceSnapshotFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => AppInstanceSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppInstanceSnapshot' from JSON`);
|
|
19
|
+
}
|
|
@@ -5,12 +5,14 @@ export type CreateEnvironmentInputApp = {
|
|
|
5
5
|
key: string;
|
|
6
6
|
};
|
|
7
7
|
export type CreateEnvironmentInput = {
|
|
8
|
-
apps
|
|
8
|
+
apps?: Array<CreateEnvironmentInputApp> | undefined;
|
|
9
9
|
labels?: {
|
|
10
10
|
[k: string]: string;
|
|
11
11
|
} | undefined;
|
|
12
12
|
lifetimeMinutes?: number | undefined;
|
|
13
13
|
name?: string | undefined;
|
|
14
|
+
snapshotAppInstanceKeys?: Array<string> | undefined;
|
|
15
|
+
snapshotId?: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
/** @internal */
|
|
16
18
|
export type CreateEnvironmentInputApp$Outbound = {
|
|
@@ -23,12 +25,14 @@ export declare const CreateEnvironmentInputApp$outboundSchema: z.ZodMiniType<Cre
|
|
|
23
25
|
export declare function createEnvironmentInputAppToJSON(createEnvironmentInputApp: CreateEnvironmentInputApp): string;
|
|
24
26
|
/** @internal */
|
|
25
27
|
export type CreateEnvironmentInput$Outbound = {
|
|
26
|
-
apps
|
|
28
|
+
apps?: Array<CreateEnvironmentInputApp$Outbound> | undefined;
|
|
27
29
|
labels?: {
|
|
28
30
|
[k: string]: string;
|
|
29
31
|
} | undefined;
|
|
30
32
|
lifetimeMinutes?: number | undefined;
|
|
31
33
|
name?: string | undefined;
|
|
34
|
+
snapshotAppInstanceKeys?: Array<string> | undefined;
|
|
35
|
+
snapshotId?: string | undefined;
|
|
32
36
|
};
|
|
33
37
|
/** @internal */
|
|
34
38
|
export declare const CreateEnvironmentInput$outboundSchema: z.ZodMiniType<CreateEnvironmentInput$Outbound, CreateEnvironmentInput>;
|
|
@@ -13,10 +13,12 @@ export function createEnvironmentInputAppToJSON(createEnvironmentInputApp) {
|
|
|
13
13
|
}
|
|
14
14
|
/** @internal */
|
|
15
15
|
export const CreateEnvironmentInput$outboundSchema = z.object({
|
|
16
|
-
apps: z.array(z.lazy(() => CreateEnvironmentInputApp$outboundSchema)),
|
|
16
|
+
apps: z.optional(z.array(z.lazy(() => CreateEnvironmentInputApp$outboundSchema))),
|
|
17
17
|
labels: z.optional(z.record(z.string(), z.string())),
|
|
18
18
|
lifetimeMinutes: z.optional(z.int()),
|
|
19
19
|
name: z.optional(z.string()),
|
|
20
|
+
snapshotAppInstanceKeys: z.optional(z.array(z.string())),
|
|
21
|
+
snapshotId: z.optional(z.string()),
|
|
20
22
|
});
|
|
21
23
|
export function createEnvironmentInputToJSON(createEnvironmentInput) {
|
|
22
24
|
return JSON.stringify(CreateEnvironmentInput$outboundSchema.parse(createEnvironmentInput));
|
|
@@ -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,17 +31,22 @@ 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;
|
|
31
38
|
readyAt: Date | null;
|
|
32
39
|
region: string | null;
|
|
40
|
+
sourceAppInstanceSnapshotId: string | null;
|
|
33
41
|
status: EnvironmentAppStatus;
|
|
34
42
|
stoppedAt: Date | null;
|
|
35
43
|
};
|
|
36
44
|
/** @internal */
|
|
37
45
|
export declare const Disposal$inboundSchema: z.ZodMiniType<Disposal, unknown>;
|
|
38
46
|
/** @internal */
|
|
47
|
+
export declare const ForkedAt$inboundSchema: z.ZodMiniType<ForkedAt, unknown>;
|
|
48
|
+
export declare function forkedAtFromJSON(jsonString: string): SafeParseResult<ForkedAt, SDKValidationError>;
|
|
49
|
+
/** @internal */
|
|
39
50
|
export declare const EnvironmentAppStatus$inboundSchema: z.ZodMiniType<EnvironmentAppStatus, unknown>;
|
|
40
51
|
/** @internal */
|
|
41
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,11 +42,13 @@ 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(),
|
|
37
49
|
readyAt: types.nullable(types.date()),
|
|
38
50
|
region: types.nullable(types.string()),
|
|
51
|
+
sourceAppInstanceSnapshotId: z._default(z.nullable(types.string()), null),
|
|
39
52
|
status: EnvironmentAppStatus$inboundSchema,
|
|
40
53
|
stoppedAt: types.nullable(types.date()),
|
|
41
54
|
});
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { Actor } from "./actor.js";
|
|
5
|
+
import { AppInstanceSnapshot } from "./app-instance-snapshot.js";
|
|
6
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
7
|
+
export declare const Consistency: {
|
|
8
|
+
readonly Environment: "environment";
|
|
9
|
+
readonly AppInstance: "app_instance";
|
|
10
|
+
};
|
|
11
|
+
export type Consistency = OpenEnum<typeof Consistency>;
|
|
12
|
+
export declare const EnvironmentSnapshotStatus: {
|
|
13
|
+
readonly Capturing: "capturing";
|
|
14
|
+
readonly Ready: "ready";
|
|
15
|
+
readonly Failed: "failed";
|
|
16
|
+
};
|
|
17
|
+
export type EnvironmentSnapshotStatus = OpenEnum<typeof EnvironmentSnapshotStatus>;
|
|
18
|
+
export type EnvironmentSnapshot = {
|
|
19
|
+
appInstanceSnapshots: Array<AppInstanceSnapshot>;
|
|
20
|
+
consistency: Consistency | null;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
createdBy: Actor | null;
|
|
23
|
+
deletedAt: Date | null;
|
|
24
|
+
errorCode: string | null;
|
|
25
|
+
id: string;
|
|
26
|
+
name: string | null;
|
|
27
|
+
readyAt: Date | null;
|
|
28
|
+
sizeBytes: number | null;
|
|
29
|
+
sourceEnvironmentId: string;
|
|
30
|
+
status: EnvironmentSnapshotStatus;
|
|
31
|
+
version: number;
|
|
32
|
+
workspaceId: string;
|
|
33
|
+
};
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare const Consistency$inboundSchema: z.ZodMiniType<Consistency, unknown>;
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const EnvironmentSnapshotStatus$inboundSchema: z.ZodMiniType<EnvironmentSnapshotStatus, unknown>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const EnvironmentSnapshot$inboundSchema: z.ZodMiniType<EnvironmentSnapshot, unknown>;
|
|
40
|
+
export declare function environmentSnapshotFromJSON(jsonString: string): SafeParseResult<EnvironmentSnapshot, SDKValidationError>;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { Actor$inboundSchema } from "./actor.js";
|
|
9
|
+
import { AppInstanceSnapshot$inboundSchema, } from "./app-instance-snapshot.js";
|
|
10
|
+
export const Consistency = {
|
|
11
|
+
Environment: "environment",
|
|
12
|
+
AppInstance: "app_instance",
|
|
13
|
+
};
|
|
14
|
+
export const EnvironmentSnapshotStatus = {
|
|
15
|
+
Capturing: "capturing",
|
|
16
|
+
Ready: "ready",
|
|
17
|
+
Failed: "failed",
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Consistency$inboundSchema = openEnums.inboundSchema(Consistency);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const EnvironmentSnapshotStatus$inboundSchema = openEnums.inboundSchema(EnvironmentSnapshotStatus);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const EnvironmentSnapshot$inboundSchema = z.object({
|
|
25
|
+
appInstanceSnapshots: z.array(AppInstanceSnapshot$inboundSchema),
|
|
26
|
+
consistency: types.nullable(Consistency$inboundSchema),
|
|
27
|
+
createdAt: types.date(),
|
|
28
|
+
createdBy: types.nullable(Actor$inboundSchema),
|
|
29
|
+
deletedAt: types.nullable(types.date()),
|
|
30
|
+
errorCode: types.nullable(types.string()),
|
|
31
|
+
id: types.string(),
|
|
32
|
+
name: types.nullable(types.string()),
|
|
33
|
+
readyAt: types.nullable(types.date()),
|
|
34
|
+
sizeBytes: types.nullable(types.number()),
|
|
35
|
+
sourceEnvironmentId: types.string(),
|
|
36
|
+
status: EnvironmentSnapshotStatus$inboundSchema,
|
|
37
|
+
version: types.number(),
|
|
38
|
+
workspaceId: types.string(),
|
|
39
|
+
});
|
|
40
|
+
export function environmentSnapshotFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => EnvironmentSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentSnapshot' from JSON`);
|
|
42
|
+
}
|
|
@@ -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,10 +33,13 @@ export type Environment = {
|
|
|
31
33
|
};
|
|
32
34
|
lifetimeMinutes: number;
|
|
33
35
|
name: string | null;
|
|
36
|
+
sourceEnvironmentId: string | null;
|
|
37
|
+
sourceEnvironmentSnapshotId: string | null;
|
|
34
38
|
startedAt: Date | null;
|
|
35
39
|
status: EnvironmentStatus;
|
|
36
40
|
stopReason: StopReason | null;
|
|
37
41
|
stoppedAt: Date | null;
|
|
42
|
+
suspendedAt: Date | null;
|
|
38
43
|
version: number;
|
|
39
44
|
workspaceId: string;
|
|
40
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,10 +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),
|
|
42
|
+
sourceEnvironmentSnapshotId: z._default(z.nullable(types.string()), null),
|
|
39
43
|
startedAt: types.nullable(types.date()),
|
|
40
44
|
status: EnvironmentStatus$inboundSchema,
|
|
41
45
|
stopReason: types.nullable(StopReason$inboundSchema),
|
|
42
46
|
stoppedAt: types.nullable(types.date()),
|
|
47
|
+
suspendedAt: types.nullable(types.date()),
|
|
43
48
|
version: types.number(),
|
|
44
49
|
workspaceId: types.string(),
|
|
45
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,11 +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";
|
|
37
|
+
readonly SnapshotLimit: "snapshot-limit";
|
|
38
|
+
readonly SnapshotsUnavailable: "snapshots-unavailable";
|
|
39
|
+
readonly SuspendInProgress: "suspend-in-progress";
|
|
31
40
|
readonly Unauthorized: "unauthorized";
|
|
32
41
|
readonly VersionConflict: "version-conflict";
|
|
33
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,11 +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",
|
|
40
|
+
SnapshotLimit: "snapshot-limit",
|
|
41
|
+
SnapshotsUnavailable: "snapshots-unavailable",
|
|
42
|
+
SuspendInProgress: "suspend-in-progress",
|
|
34
43
|
Unauthorized: "unauthorized",
|
|
35
44
|
VersionConflict: "version-conflict",
|
|
36
45
|
WorkspaceArchived: "workspace-archived",
|