@usestatemachines/sdk 0.1.1 → 0.3.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 +265 -75
- package/agents/SKILL.md +33 -46
- package/agents/index.js +7 -7
- package/agents/llms.txt +25 -40
- package/agents/prompt.md +11 -34
- package/esm/extensions/apps.d.ts +18 -0
- package/esm/extensions/apps.js +39 -0
- package/esm/extensions/client.d.ts +66 -3
- package/esm/extensions/client.js +236 -35
- package/esm/extensions/errors.d.ts +50 -6
- package/esm/extensions/errors.js +37 -3
- package/esm/extensions/index.d.ts +5 -3
- package/esm/extensions/index.js +2 -1
- package/esm/extensions/running-environment.d.ts +32 -0
- package/esm/extensions/running-environment.js +44 -0
- package/esm/extensions/signal.d.ts +1 -2
- package/esm/extensions/signal.js +9 -4
- package/esm/extensions/wait.d.ts +11 -3
- package/esm/extensions/wait.js +23 -13
- package/esm/funcs/create-environment-definition.d.ts +11 -0
- package/esm/funcs/create-environment-definition.js +94 -0
- package/esm/funcs/environments-list.js +1 -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/connection-secret.d.ts +16 -0
- package/esm/models/connection-secret.js +13 -0
- package/esm/models/connection.d.ts +14 -0
- package/esm/models/connection.js +14 -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 +1 -0
- package/esm/models/environment-app.js +1 -0
- package/esm/models/environment-snapshot.d.ts +39 -0
- package/esm/models/environment-snapshot.js +41 -0
- package/esm/models/environment.d.ts +1 -0
- package/esm/models/environment.js +1 -0
- package/esm/models/error-response.d.ts +5 -0
- package/esm/models/error-response.js +5 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -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 +143 -0
- package/esm/models/operations/create-environment-definition.js +90 -0
- package/esm/models/operations/delete-snapshot.d.ts +23 -0
- package/esm/models/operations/delete-snapshot.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 +6 -0
- package/esm/models/operations/index.js +6 -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/reveal-connection.d.ts +26 -4
- package/esm/models/operations/reveal-connection.js +28 -2
- package/esm/models/operations/update-snapshot.d.ts +37 -0
- package/esm/models/operations/update-snapshot.js +29 -0
- package/esm/sdk/sdk.d.ts +6 -1
- package/esm/sdk/sdk.js +10 -0
- package/esm/sdk/snapshots.d.ts +9 -0
- package/esm/sdk/snapshots.js +27 -0
- package/openapi.json +1471 -144
- package/package.json +10 -11
|
@@ -4,15 +4,19 @@ 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 ConnectionNotAuthorized: "connection-not-authorized";
|
|
7
8
|
readonly ConnectionUnavailable: "connection-unavailable";
|
|
8
9
|
readonly EnvironmentLimit: "environment-limit";
|
|
9
10
|
readonly Forbidden: "forbidden";
|
|
10
11
|
readonly IdempotencyConflict: "idempotency-conflict";
|
|
11
12
|
readonly IdentityRequestRejected: "identity-request-rejected";
|
|
13
|
+
readonly InitializationBusy: "initialization-busy";
|
|
14
|
+
readonly InitializationUnavailable: "initialization-unavailable";
|
|
12
15
|
readonly InternalError: "internal-error";
|
|
13
16
|
readonly InvalidCursor: "invalid-cursor";
|
|
14
17
|
readonly InvalidRequest: "invalid-request";
|
|
15
18
|
readonly InvalidResponse: "invalid-response";
|
|
19
|
+
readonly InvalidSetup: "invalid-setup";
|
|
16
20
|
readonly InvalidWebhook: "invalid-webhook";
|
|
17
21
|
readonly LastOwner: "last-owner";
|
|
18
22
|
readonly LastWorkspace: "last-workspace";
|
|
@@ -24,6 +28,7 @@ export declare const Code: {
|
|
|
24
28
|
readonly RequestCapacityReached: "request-capacity-reached";
|
|
25
29
|
readonly RequestTimeout: "request-timeout";
|
|
26
30
|
readonly ServiceUnavailable: "service-unavailable";
|
|
31
|
+
readonly SnapshotLimit: "snapshot-limit";
|
|
27
32
|
readonly Unauthorized: "unauthorized";
|
|
28
33
|
readonly VersionConflict: "version-conflict";
|
|
29
34
|
readonly WorkspaceArchived: "workspace-archived";
|
|
@@ -7,15 +7,19 @@ 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
|
+
ConnectionNotAuthorized: "connection-not-authorized",
|
|
10
11
|
ConnectionUnavailable: "connection-unavailable",
|
|
11
12
|
EnvironmentLimit: "environment-limit",
|
|
12
13
|
Forbidden: "forbidden",
|
|
13
14
|
IdempotencyConflict: "idempotency-conflict",
|
|
14
15
|
IdentityRequestRejected: "identity-request-rejected",
|
|
16
|
+
InitializationBusy: "initialization-busy",
|
|
17
|
+
InitializationUnavailable: "initialization-unavailable",
|
|
15
18
|
InternalError: "internal-error",
|
|
16
19
|
InvalidCursor: "invalid-cursor",
|
|
17
20
|
InvalidRequest: "invalid-request",
|
|
18
21
|
InvalidResponse: "invalid-response",
|
|
22
|
+
InvalidSetup: "invalid-setup",
|
|
19
23
|
InvalidWebhook: "invalid-webhook",
|
|
20
24
|
LastOwner: "last-owner",
|
|
21
25
|
LastWorkspace: "last-workspace",
|
|
@@ -27,6 +31,7 @@ export const Code = {
|
|
|
27
31
|
RequestCapacityReached: "request-capacity-reached",
|
|
28
32
|
RequestTimeout: "request-timeout",
|
|
29
33
|
ServiceUnavailable: "service-unavailable",
|
|
34
|
+
SnapshotLimit: "snapshot-limit",
|
|
30
35
|
Unauthorized: "unauthorized",
|
|
31
36
|
VersionConflict: "version-conflict",
|
|
32
37
|
WorkspaceArchived: "workspace-archived",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./actor.js";
|
|
2
2
|
export * from "./api-profile.js";
|
|
3
|
+
export * from "./app-instance-snapshot.js";
|
|
3
4
|
export * from "./app.js";
|
|
4
5
|
export * from "./catalog.js";
|
|
5
6
|
export * from "./connection-secret.js";
|
|
@@ -9,6 +10,7 @@ export * from "./credential-kind.js";
|
|
|
9
10
|
export * from "./credential.js";
|
|
10
11
|
export * from "./environment-app.js";
|
|
11
12
|
export * from "./environment-lifetime.js";
|
|
13
|
+
export * from "./environment-snapshot.js";
|
|
12
14
|
export * from "./environment.js";
|
|
13
15
|
export * from "./error-response.js";
|
|
14
16
|
export * from "./event-page.js";
|
package/esm/models/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from "./actor.js";
|
|
5
5
|
export * from "./api-profile.js";
|
|
6
|
+
export * from "./app-instance-snapshot.js";
|
|
6
7
|
export * from "./app.js";
|
|
7
8
|
export * from "./catalog.js";
|
|
8
9
|
export * from "./connection-secret.js";
|
|
@@ -12,6 +13,7 @@ export * from "./credential-kind.js";
|
|
|
12
13
|
export * from "./credential.js";
|
|
13
14
|
export * from "./environment-app.js";
|
|
14
15
|
export * from "./environment-lifetime.js";
|
|
16
|
+
export * from "./environment-snapshot.js";
|
|
15
17
|
export * from "./environment.js";
|
|
16
18
|
export * from "./error-response.js";
|
|
17
19
|
export * from "./event-page.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type CaptureSnapshotRequestBody = {
|
|
6
|
+
appInstanceKeys?: Array<string> | undefined;
|
|
7
|
+
environmentId: string;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type CaptureSnapshotRequest = {
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
idempotencyKey: string;
|
|
13
|
+
body: CaptureSnapshotRequestBody;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Environment snapshot capture accepted
|
|
17
|
+
*/
|
|
18
|
+
export type CaptureSnapshotResponse = {
|
|
19
|
+
data: models.EnvironmentSnapshot;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type CaptureSnapshotRequestBody$Outbound = {
|
|
23
|
+
appInstanceKeys?: Array<string> | undefined;
|
|
24
|
+
environmentId: string;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const CaptureSnapshotRequestBody$outboundSchema: z.ZodMiniType<CaptureSnapshotRequestBody$Outbound, CaptureSnapshotRequestBody>;
|
|
29
|
+
export declare function captureSnapshotRequestBodyToJSON(captureSnapshotRequestBody: CaptureSnapshotRequestBody): string;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type CaptureSnapshotRequest$Outbound = {
|
|
32
|
+
workspaceId: string;
|
|
33
|
+
"idempotency-key": string;
|
|
34
|
+
body: CaptureSnapshotRequestBody$Outbound;
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const CaptureSnapshotRequest$outboundSchema: z.ZodMiniType<CaptureSnapshotRequest$Outbound, CaptureSnapshotRequest>;
|
|
38
|
+
export declare function captureSnapshotRequestToJSON(captureSnapshotRequest: CaptureSnapshotRequest): string;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const CaptureSnapshotResponse$inboundSchema: z.ZodMiniType<CaptureSnapshotResponse, unknown>;
|
|
41
|
+
export declare function captureSnapshotResponseFromJSON(jsonString: string): SafeParseResult<CaptureSnapshotResponse, SDKValidationError>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const CaptureSnapshotRequestBody$outboundSchema = z.object({
|
|
10
|
+
appInstanceKeys: z.optional(z.array(z.string())),
|
|
11
|
+
environmentId: z.string(),
|
|
12
|
+
name: z.optional(z.string()),
|
|
13
|
+
});
|
|
14
|
+
export function captureSnapshotRequestBodyToJSON(captureSnapshotRequestBody) {
|
|
15
|
+
return JSON.stringify(CaptureSnapshotRequestBody$outboundSchema.parse(captureSnapshotRequestBody));
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const CaptureSnapshotRequest$outboundSchema = z.pipe(z.object({
|
|
19
|
+
workspaceId: z.string(),
|
|
20
|
+
idempotencyKey: z.string(),
|
|
21
|
+
body: z.lazy(() => CaptureSnapshotRequestBody$outboundSchema),
|
|
22
|
+
}), z.transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
idempotencyKey: "idempotency-key",
|
|
25
|
+
});
|
|
26
|
+
}));
|
|
27
|
+
export function captureSnapshotRequestToJSON(captureSnapshotRequest) {
|
|
28
|
+
return JSON.stringify(CaptureSnapshotRequest$outboundSchema.parse(captureSnapshotRequest));
|
|
29
|
+
}
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const CaptureSnapshotResponse$inboundSchema = z.object({
|
|
32
|
+
data: models.EnvironmentSnapshot$inboundSchema,
|
|
33
|
+
});
|
|
34
|
+
export function captureSnapshotResponseFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => CaptureSnapshotResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureSnapshotResponse' from JSON`);
|
|
36
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type From = {
|
|
6
|
+
snapshot: string;
|
|
7
|
+
};
|
|
8
|
+
export type CreateEnvironmentDefinitionRequestBody2 = {
|
|
9
|
+
from: From;
|
|
10
|
+
version?: number | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type Apps = {
|
|
13
|
+
app: string;
|
|
14
|
+
/**
|
|
15
|
+
* Native values validated by the selected replica release.
|
|
16
|
+
*/
|
|
17
|
+
configure?: {
|
|
18
|
+
[k: string]: any;
|
|
19
|
+
} | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Native values validated by the selected replica release.
|
|
22
|
+
*/
|
|
23
|
+
connections?: {
|
|
24
|
+
[k: string]: any;
|
|
25
|
+
} | undefined;
|
|
26
|
+
defaultConnection?: string | undefined;
|
|
27
|
+
preset?: string | undefined;
|
|
28
|
+
release?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Native values validated by the selected replica release.
|
|
31
|
+
*/
|
|
32
|
+
resources?: {
|
|
33
|
+
[k: string]: any;
|
|
34
|
+
} | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Native values validated by the selected replica release.
|
|
37
|
+
*/
|
|
38
|
+
settings?: {
|
|
39
|
+
[k: string]: any;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
export type AppsUnion = Array<string> | {
|
|
43
|
+
[k: string]: Apps;
|
|
44
|
+
};
|
|
45
|
+
export type CreateEnvironmentDefinitionRequestBody1 = {
|
|
46
|
+
apps: Array<string> | {
|
|
47
|
+
[k: string]: Apps;
|
|
48
|
+
};
|
|
49
|
+
labels?: {
|
|
50
|
+
[k: string]: string;
|
|
51
|
+
} | undefined;
|
|
52
|
+
lifetimeMinutes?: number | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
version?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
export type CreateEnvironmentDefinitionRequestBody = CreateEnvironmentDefinitionRequestBody1 | CreateEnvironmentDefinitionRequestBody2;
|
|
57
|
+
export type CreateEnvironmentDefinitionRequest = {
|
|
58
|
+
workspaceId: string;
|
|
59
|
+
idempotencyKey: string;
|
|
60
|
+
body: CreateEnvironmentDefinitionRequestBody1 | CreateEnvironmentDefinitionRequestBody2;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Environment accepted from its setup definition
|
|
64
|
+
*/
|
|
65
|
+
export type CreateEnvironmentDefinitionResponse = {
|
|
66
|
+
data: models.Environment;
|
|
67
|
+
};
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type From$Outbound = {
|
|
70
|
+
snapshot: string;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export declare const From$outboundSchema: z.ZodMiniType<From$Outbound, From>;
|
|
74
|
+
export declare function fromToJSON(from: From): string;
|
|
75
|
+
/** @internal */
|
|
76
|
+
export type CreateEnvironmentDefinitionRequestBody2$Outbound = {
|
|
77
|
+
from: From$Outbound;
|
|
78
|
+
version: number;
|
|
79
|
+
};
|
|
80
|
+
/** @internal */
|
|
81
|
+
export declare const CreateEnvironmentDefinitionRequestBody2$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody2$Outbound, CreateEnvironmentDefinitionRequestBody2>;
|
|
82
|
+
export declare function createEnvironmentDefinitionRequestBody2ToJSON(createEnvironmentDefinitionRequestBody2: CreateEnvironmentDefinitionRequestBody2): string;
|
|
83
|
+
/** @internal */
|
|
84
|
+
export type Apps$Outbound = {
|
|
85
|
+
app: string;
|
|
86
|
+
configure?: {
|
|
87
|
+
[k: string]: any;
|
|
88
|
+
} | undefined;
|
|
89
|
+
connections?: {
|
|
90
|
+
[k: string]: any;
|
|
91
|
+
} | undefined;
|
|
92
|
+
defaultConnection?: string | undefined;
|
|
93
|
+
preset?: string | undefined;
|
|
94
|
+
release?: string | undefined;
|
|
95
|
+
resources?: {
|
|
96
|
+
[k: string]: any;
|
|
97
|
+
} | undefined;
|
|
98
|
+
settings?: {
|
|
99
|
+
[k: string]: any;
|
|
100
|
+
} | undefined;
|
|
101
|
+
};
|
|
102
|
+
/** @internal */
|
|
103
|
+
export declare const Apps$outboundSchema: z.ZodMiniType<Apps$Outbound, Apps>;
|
|
104
|
+
export declare function appsToJSON(apps: Apps): string;
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type AppsUnion$Outbound = Array<string> | {
|
|
107
|
+
[k: string]: Apps$Outbound;
|
|
108
|
+
};
|
|
109
|
+
/** @internal */
|
|
110
|
+
export declare const AppsUnion$outboundSchema: z.ZodMiniType<AppsUnion$Outbound, AppsUnion>;
|
|
111
|
+
export declare function appsUnionToJSON(appsUnion: AppsUnion): string;
|
|
112
|
+
/** @internal */
|
|
113
|
+
export type CreateEnvironmentDefinitionRequestBody1$Outbound = {
|
|
114
|
+
apps: Array<string> | {
|
|
115
|
+
[k: string]: Apps$Outbound;
|
|
116
|
+
};
|
|
117
|
+
labels?: {
|
|
118
|
+
[k: string]: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
lifetimeMinutes?: number | undefined;
|
|
121
|
+
name?: string | undefined;
|
|
122
|
+
version: number;
|
|
123
|
+
};
|
|
124
|
+
/** @internal */
|
|
125
|
+
export declare const CreateEnvironmentDefinitionRequestBody1$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody1$Outbound, CreateEnvironmentDefinitionRequestBody1>;
|
|
126
|
+
export declare function createEnvironmentDefinitionRequestBody1ToJSON(createEnvironmentDefinitionRequestBody1: CreateEnvironmentDefinitionRequestBody1): string;
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type CreateEnvironmentDefinitionRequestBody$Outbound = CreateEnvironmentDefinitionRequestBody1$Outbound | CreateEnvironmentDefinitionRequestBody2$Outbound;
|
|
129
|
+
/** @internal */
|
|
130
|
+
export declare const CreateEnvironmentDefinitionRequestBody$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody$Outbound, CreateEnvironmentDefinitionRequestBody>;
|
|
131
|
+
export declare function createEnvironmentDefinitionRequestBodyToJSON(createEnvironmentDefinitionRequestBody: CreateEnvironmentDefinitionRequestBody): string;
|
|
132
|
+
/** @internal */
|
|
133
|
+
export type CreateEnvironmentDefinitionRequest$Outbound = {
|
|
134
|
+
workspaceId: string;
|
|
135
|
+
"idempotency-key": string;
|
|
136
|
+
body: CreateEnvironmentDefinitionRequestBody1$Outbound | CreateEnvironmentDefinitionRequestBody2$Outbound;
|
|
137
|
+
};
|
|
138
|
+
/** @internal */
|
|
139
|
+
export declare const CreateEnvironmentDefinitionRequest$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequest$Outbound, CreateEnvironmentDefinitionRequest>;
|
|
140
|
+
export declare function createEnvironmentDefinitionRequestToJSON(createEnvironmentDefinitionRequest: CreateEnvironmentDefinitionRequest): string;
|
|
141
|
+
/** @internal */
|
|
142
|
+
export declare const CreateEnvironmentDefinitionResponse$inboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionResponse, unknown>;
|
|
143
|
+
export declare function createEnvironmentDefinitionResponseFromJSON(jsonString: string): SafeParseResult<CreateEnvironmentDefinitionResponse, SDKValidationError>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { smartUnion } from "../../types/smart-union.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const From$outboundSchema = z.object({
|
|
11
|
+
snapshot: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export function fromToJSON(from) {
|
|
14
|
+
return JSON.stringify(From$outboundSchema.parse(from));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const CreateEnvironmentDefinitionRequestBody2$outboundSchema = z.object({
|
|
18
|
+
from: z.lazy(() => From$outboundSchema),
|
|
19
|
+
version: z._default(z.number(), 1),
|
|
20
|
+
});
|
|
21
|
+
export function createEnvironmentDefinitionRequestBody2ToJSON(createEnvironmentDefinitionRequestBody2) {
|
|
22
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody2$outboundSchema.parse(createEnvironmentDefinitionRequestBody2));
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const Apps$outboundSchema = z.object({
|
|
26
|
+
app: z.string(),
|
|
27
|
+
configure: z.optional(z.record(z.string(), z.any())),
|
|
28
|
+
connections: z.optional(z.record(z.string(), z.any())),
|
|
29
|
+
defaultConnection: z.optional(z.string()),
|
|
30
|
+
preset: z.optional(z.string()),
|
|
31
|
+
release: z.optional(z.string()),
|
|
32
|
+
resources: z.optional(z.record(z.string(), z.any())),
|
|
33
|
+
settings: z.optional(z.record(z.string(), z.any())),
|
|
34
|
+
});
|
|
35
|
+
export function appsToJSON(apps) {
|
|
36
|
+
return JSON.stringify(Apps$outboundSchema.parse(apps));
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const AppsUnion$outboundSchema = smartUnion([
|
|
40
|
+
z.array(z.string()),
|
|
41
|
+
z.record(z.string(), z.lazy(() => Apps$outboundSchema)),
|
|
42
|
+
]);
|
|
43
|
+
export function appsUnionToJSON(appsUnion) {
|
|
44
|
+
return JSON.stringify(AppsUnion$outboundSchema.parse(appsUnion));
|
|
45
|
+
}
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const CreateEnvironmentDefinitionRequestBody1$outboundSchema = z.object({
|
|
48
|
+
apps: smartUnion([
|
|
49
|
+
z.array(z.string()),
|
|
50
|
+
z.record(z.string(), z.lazy(() => Apps$outboundSchema)),
|
|
51
|
+
]),
|
|
52
|
+
labels: z.optional(z.record(z.string(), z.string())),
|
|
53
|
+
lifetimeMinutes: z.optional(z.int()),
|
|
54
|
+
name: z.optional(z.string()),
|
|
55
|
+
version: z._default(z.number(), 1),
|
|
56
|
+
});
|
|
57
|
+
export function createEnvironmentDefinitionRequestBody1ToJSON(createEnvironmentDefinitionRequestBody1) {
|
|
58
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody1$outboundSchema.parse(createEnvironmentDefinitionRequestBody1));
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const CreateEnvironmentDefinitionRequestBody$outboundSchema = smartUnion([
|
|
62
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody1$outboundSchema),
|
|
63
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody2$outboundSchema),
|
|
64
|
+
]);
|
|
65
|
+
export function createEnvironmentDefinitionRequestBodyToJSON(createEnvironmentDefinitionRequestBody) {
|
|
66
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody$outboundSchema.parse(createEnvironmentDefinitionRequestBody));
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const CreateEnvironmentDefinitionRequest$outboundSchema = z.pipe(z.object({
|
|
70
|
+
workspaceId: z.string(),
|
|
71
|
+
idempotencyKey: z.string(),
|
|
72
|
+
body: smartUnion([
|
|
73
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody1$outboundSchema),
|
|
74
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody2$outboundSchema),
|
|
75
|
+
]),
|
|
76
|
+
}), z.transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
idempotencyKey: "idempotency-key",
|
|
79
|
+
});
|
|
80
|
+
}));
|
|
81
|
+
export function createEnvironmentDefinitionRequestToJSON(createEnvironmentDefinitionRequest) {
|
|
82
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequest$outboundSchema.parse(createEnvironmentDefinitionRequest));
|
|
83
|
+
}
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const CreateEnvironmentDefinitionResponse$inboundSchema = z.object({
|
|
86
|
+
data: models.Environment$inboundSchema,
|
|
87
|
+
});
|
|
88
|
+
export function createEnvironmentDefinitionResponseFromJSON(jsonString) {
|
|
89
|
+
return safeParse(jsonString, (x) => CreateEnvironmentDefinitionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEnvironmentDefinitionResponse' from JSON`);
|
|
90
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type DeleteSnapshotRequest = {
|
|
6
|
+
snapshotId: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Environment snapshot removed from the library
|
|
10
|
+
*/
|
|
11
|
+
export type DeleteSnapshotResponse = {
|
|
12
|
+
data: models.EnvironmentSnapshot;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type DeleteSnapshotRequest$Outbound = {
|
|
16
|
+
snapshotId: string;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const DeleteSnapshotRequest$outboundSchema: z.ZodMiniType<DeleteSnapshotRequest$Outbound, DeleteSnapshotRequest>;
|
|
20
|
+
export declare function deleteSnapshotRequestToJSON(deleteSnapshotRequest: DeleteSnapshotRequest): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const DeleteSnapshotResponse$inboundSchema: z.ZodMiniType<DeleteSnapshotResponse, unknown>;
|
|
23
|
+
export declare function deleteSnapshotResponseFromJSON(jsonString: string): SafeParseResult<DeleteSnapshotResponse, SDKValidationError>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 models from "../index.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DeleteSnapshotRequest$outboundSchema = z.object({
|
|
9
|
+
snapshotId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function deleteSnapshotRequestToJSON(deleteSnapshotRequest) {
|
|
12
|
+
return JSON.stringify(DeleteSnapshotRequest$outboundSchema.parse(deleteSnapshotRequest));
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const DeleteSnapshotResponse$inboundSchema = z.object({
|
|
16
|
+
data: models.EnvironmentSnapshot$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
export function deleteSnapshotResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => DeleteSnapshotResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteSnapshotResponse' from JSON`);
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type GetSnapshotRequest = {
|
|
6
|
+
snapshotId: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Environment snapshot and its app instance snapshots
|
|
10
|
+
*/
|
|
11
|
+
export type GetSnapshotResponse = {
|
|
12
|
+
data: models.EnvironmentSnapshot;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetSnapshotRequest$Outbound = {
|
|
16
|
+
snapshotId: string;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const GetSnapshotRequest$outboundSchema: z.ZodMiniType<GetSnapshotRequest$Outbound, GetSnapshotRequest>;
|
|
20
|
+
export declare function getSnapshotRequestToJSON(getSnapshotRequest: GetSnapshotRequest): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const GetSnapshotResponse$inboundSchema: z.ZodMiniType<GetSnapshotResponse, unknown>;
|
|
23
|
+
export declare function getSnapshotResponseFromJSON(jsonString: string): SafeParseResult<GetSnapshotResponse, SDKValidationError>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 models from "../index.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const GetSnapshotRequest$outboundSchema = z.object({
|
|
9
|
+
snapshotId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function getSnapshotRequestToJSON(getSnapshotRequest) {
|
|
12
|
+
return JSON.stringify(GetSnapshotRequest$outboundSchema.parse(getSnapshotRequest));
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const GetSnapshotResponse$inboundSchema = z.object({
|
|
16
|
+
data: models.EnvironmentSnapshot$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
export function getSnapshotResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => GetSnapshotResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSnapshotResponse' from JSON`);
|
|
20
|
+
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
export * from "./capture-snapshot.js";
|
|
2
|
+
export * from "./create-environment-definition.js";
|
|
1
3
|
export * from "./create-environments.js";
|
|
4
|
+
export * from "./delete-snapshot.js";
|
|
2
5
|
export * from "./get-catalog.js";
|
|
3
6
|
export * from "./get-connection.js";
|
|
4
7
|
export * from "./get-credential.js";
|
|
5
8
|
export * from "./get-environment.js";
|
|
6
9
|
export * from "./get-release.js";
|
|
10
|
+
export * from "./get-snapshot.js";
|
|
7
11
|
export * from "./get-workspace.js";
|
|
8
12
|
export * from "./list-environment-events.js";
|
|
9
13
|
export * from "./list-environments.js";
|
|
14
|
+
export * from "./list-snapshots.js";
|
|
10
15
|
export * from "./list-workspace-events.js";
|
|
11
16
|
export * from "./list-workspaces.js";
|
|
12
17
|
export * from "./reveal-connection.js";
|
|
13
18
|
export * from "./stop-environment.js";
|
|
19
|
+
export * from "./update-snapshot.js";
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
export * from "./capture-snapshot.js";
|
|
5
|
+
export * from "./create-environment-definition.js";
|
|
4
6
|
export * from "./create-environments.js";
|
|
7
|
+
export * from "./delete-snapshot.js";
|
|
5
8
|
export * from "./get-catalog.js";
|
|
6
9
|
export * from "./get-connection.js";
|
|
7
10
|
export * from "./get-credential.js";
|
|
8
11
|
export * from "./get-environment.js";
|
|
9
12
|
export * from "./get-release.js";
|
|
13
|
+
export * from "./get-snapshot.js";
|
|
10
14
|
export * from "./get-workspace.js";
|
|
11
15
|
export * from "./list-environment-events.js";
|
|
12
16
|
export * from "./list-environments.js";
|
|
17
|
+
export * from "./list-snapshots.js";
|
|
13
18
|
export * from "./list-workspace-events.js";
|
|
14
19
|
export * from "./list-workspaces.js";
|
|
15
20
|
export * from "./reveal-connection.js";
|
|
16
21
|
export * from "./stop-environment.js";
|
|
22
|
+
export * from "./update-snapshot.js";
|
|
@@ -15,6 +15,7 @@ export type ListEnvironmentsRequest = {
|
|
|
15
15
|
limit?: number | undefined;
|
|
16
16
|
cursor?: string | undefined;
|
|
17
17
|
status?: Status | undefined;
|
|
18
|
+
snapshotId?: string | undefined;
|
|
18
19
|
search?: string | undefined;
|
|
19
20
|
label?: string | Array<string> | undefined;
|
|
20
21
|
};
|
|
@@ -38,6 +39,7 @@ export type ListEnvironmentsRequest$Outbound = {
|
|
|
38
39
|
limit: number;
|
|
39
40
|
cursor?: string | undefined;
|
|
40
41
|
status: string;
|
|
42
|
+
snapshotId?: string | undefined;
|
|
41
43
|
search?: string | undefined;
|
|
42
44
|
label?: string | Array<string> | undefined;
|
|
43
45
|
};
|
|
@@ -24,6 +24,7 @@ export const ListEnvironmentsRequest$outboundSchema = z.object({
|
|
|
24
24
|
limit: z._default(z.int(), 50),
|
|
25
25
|
cursor: z.optional(z.string()),
|
|
26
26
|
status: z._default(Status$outboundSchema, "all"),
|
|
27
|
+
snapshotId: z.optional(z.string()),
|
|
27
28
|
search: z.optional(z.string()),
|
|
28
29
|
label: z.optional(smartUnion([z.string(), z.array(z.string())])),
|
|
29
30
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type ListSnapshotsRequest = {
|
|
6
|
+
workspaceId: string;
|
|
7
|
+
limit?: number | undefined;
|
|
8
|
+
cursor?: string | undefined;
|
|
9
|
+
sourceEnvironmentId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Workspace environment snapshots, newest first
|
|
13
|
+
*/
|
|
14
|
+
export type ListSnapshotsResponse = {
|
|
15
|
+
data: Array<models.EnvironmentSnapshot>;
|
|
16
|
+
nextCursor: string | null;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export type ListSnapshotsRequest$Outbound = {
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
limit: number;
|
|
22
|
+
cursor?: string | undefined;
|
|
23
|
+
sourceEnvironmentId?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ListSnapshotsRequest$outboundSchema: z.ZodMiniType<ListSnapshotsRequest$Outbound, ListSnapshotsRequest>;
|
|
27
|
+
export declare function listSnapshotsRequestToJSON(listSnapshotsRequest: ListSnapshotsRequest): string;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const ListSnapshotsResponse$inboundSchema: z.ZodMiniType<ListSnapshotsResponse, unknown>;
|
|
30
|
+
export declare function listSnapshotsResponseFromJSON(jsonString: string): SafeParseResult<ListSnapshotsResponse, SDKValidationError>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ListSnapshotsRequest$outboundSchema = z.object({
|
|
10
|
+
workspaceId: z.string(),
|
|
11
|
+
limit: z._default(z.int(), 50),
|
|
12
|
+
cursor: z.optional(z.string()),
|
|
13
|
+
sourceEnvironmentId: z.optional(z.string()),
|
|
14
|
+
});
|
|
15
|
+
export function listSnapshotsRequestToJSON(listSnapshotsRequest) {
|
|
16
|
+
return JSON.stringify(ListSnapshotsRequest$outboundSchema.parse(listSnapshotsRequest));
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ListSnapshotsResponse$inboundSchema = z.object({
|
|
20
|
+
data: z.array(models.EnvironmentSnapshot$inboundSchema),
|
|
21
|
+
nextCursor: types.nullable(types.string()),
|
|
22
|
+
});
|
|
23
|
+
export function listSnapshotsResponseFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => ListSnapshotsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListSnapshotsResponse' from JSON`);
|
|
25
|
+
}
|