@usestatemachines/sdk 0.4.0 → 0.6.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 +177 -470
- package/agents/SKILL.md +38 -47
- package/agents/index.js +7 -7
- package/agents/llms.txt +49 -45
- package/agents/prompt.md +11 -11
- package/esm/extensions/client.d.ts +105 -116
- package/esm/extensions/client.js +162 -309
- package/esm/extensions/credentials.d.ts +13 -0
- package/esm/extensions/credentials.js +73 -0
- package/esm/extensions/environment.d.ts +25 -0
- package/esm/extensions/environment.js +1 -0
- package/esm/extensions/errors.d.ts +42 -75
- package/esm/extensions/errors.js +125 -110
- package/esm/extensions/index.d.ts +6 -11
- package/esm/extensions/index.js +2 -7
- package/esm/extensions/wait.d.ts +17 -18
- package/esm/extensions/wait.js +60 -56
- package/esm/extensions/yaml.d.ts +6 -0
- package/esm/extensions/yaml.js +137 -0
- package/esm/funcs/{catalog-release.d.ts → apps-list.d.ts} +1 -1
- package/esm/funcs/apps-list.js +91 -0
- package/esm/funcs/{credential-get.d.ts → apps-versions.d.ts} +1 -1
- package/esm/funcs/{workspaces-events.js → apps-versions.js} +6 -7
- package/esm/funcs/{environments-get-connection.d.ts → audit-events-list.d.ts} +1 -1
- package/esm/funcs/audit-events-list.js +93 -0
- package/esm/funcs/{workspaces-events.d.ts → environments-connect.d.ts} +1 -1
- package/esm/funcs/{environments-reveal.js → environments-connect.js} +7 -6
- package/esm/funcs/environments-create.d.ts +2 -1
- package/esm/funcs/environments-create.js +5 -10
- package/esm/funcs/{environments-events.d.ts → environments-delete.d.ts} +1 -1
- package/esm/funcs/{environments-stop.js → environments-delete.js} +8 -6
- package/esm/funcs/environments-get.d.ts +2 -1
- package/esm/funcs/environments-get.js +2 -1
- package/esm/funcs/environments-list.d.ts +1 -1
- package/esm/funcs/environments-list.js +11 -16
- package/esm/funcs/environments-pause.d.ts +12 -0
- package/esm/funcs/{environments-suspend.js → environments-pause.js} +7 -5
- package/esm/funcs/environments-resume.d.ts +2 -1
- package/esm/funcs/environments-resume.js +3 -1
- package/esm/funcs/environments-update.d.ts +12 -0
- package/esm/funcs/{get-environment-position.js → environments-update.js} +10 -8
- package/esm/funcs/me.d.ts +11 -0
- package/esm/funcs/{catalog-get.js → me.js} +5 -5
- package/esm/funcs/{catalog-get.d.ts → requests-body.d.ts} +1 -1
- package/esm/funcs/{environments-get-connection.js → requests-body.js} +8 -8
- package/esm/funcs/requests-get.d.ts +12 -0
- package/esm/funcs/{catalog-release.js → requests-get.js} +7 -6
- package/esm/funcs/{environments-stop.d.ts → requests-list.d.ts} +1 -1
- package/esm/funcs/{list-environment-history.js → requests-list.js} +15 -12
- package/esm/funcs/requests-stats.d.ts +12 -0
- package/esm/funcs/{environments-events.js → requests-stats.js} +15 -14
- package/esm/funcs/snapshots-create.d.ts +12 -0
- package/esm/funcs/{snapshots-capture.js → snapshots-create.js} +6 -11
- package/esm/funcs/snapshots-delete.d.ts +2 -1
- package/esm/funcs/snapshots-delete.js +2 -1
- package/esm/funcs/snapshots-get.d.ts +2 -1
- package/esm/funcs/snapshots-get.js +2 -1
- package/esm/funcs/snapshots-list.d.ts +1 -1
- package/esm/funcs/snapshots-list.js +9 -13
- package/esm/funcs/snapshots-update.d.ts +2 -1
- package/esm/funcs/snapshots-update.js +2 -1
- package/esm/funcs/workspaces-get.d.ts +2 -1
- package/esm/funcs/workspaces-get.js +2 -1
- package/esm/funcs/workspaces-list.d.ts +1 -1
- package/esm/funcs/workspaces-list.js +3 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/actor.d.ts +2 -3
- package/esm/models/actor.js +2 -3
- package/esm/models/{api-profile.d.ts → api.d.ts} +4 -4
- package/esm/models/{api-profile.js → api.js} +4 -5
- package/esm/models/app.d.ts +9 -1
- package/esm/models/app.js +7 -1
- package/esm/models/{event.d.ts → audit-event.d.ts} +6 -6
- package/esm/models/{event.js → audit-event.js} +7 -6
- package/esm/models/body-preview.d.ts +31 -0
- package/esm/models/body-preview.js +34 -0
- package/esm/models/create-environment.d.ts +51 -0
- package/esm/models/create-environment.js +35 -0
- package/esm/models/credentials.d.ts +31 -0
- package/esm/models/credentials.js +31 -0
- package/esm/models/environment-failure.d.ts +22 -0
- package/esm/models/environment-failure.js +25 -0
- package/esm/models/environment-status.d.ts +14 -0
- package/esm/models/environment-status.js +15 -0
- package/esm/models/environment.d.ts +27 -27
- package/esm/models/environment.js +28 -27
- package/esm/models/error.d.ts +38 -0
- package/esm/models/error.js +39 -0
- package/esm/models/errors/{error-response.d.ts → error.d.ts} +5 -5
- package/esm/models/errors/{error-response.js → error.js} +4 -4
- package/esm/models/errors/index.d.ts +1 -1
- package/esm/models/errors/index.js +1 -1
- package/esm/models/index.d.ts +17 -22
- package/esm/models/index.js +17 -22
- package/esm/models/me.d.ts +66 -0
- package/esm/models/me.js +75 -0
- package/esm/models/operations/create-credentials.d.ts +25 -0
- package/esm/models/operations/create-credentials.js +20 -0
- package/esm/models/operations/create-environment.d.ts +14 -0
- package/esm/models/operations/create-environment.js +18 -0
- package/esm/models/operations/create-snapshot.d.ts +25 -0
- package/esm/models/operations/create-snapshot.js +25 -0
- package/esm/models/operations/delete-environment.d.ts +13 -0
- package/esm/models/operations/delete-environment.js +17 -0
- package/esm/models/operations/delete-snapshot.d.ts +0 -12
- package/esm/models/operations/delete-snapshot.js +0 -9
- package/esm/models/operations/get-environment.d.ts +0 -12
- package/esm/models/operations/get-environment.js +0 -9
- package/esm/models/operations/get-request-body.d.ts +21 -0
- package/esm/models/operations/get-request-body.js +18 -0
- package/esm/models/operations/get-request-stats.d.ts +51 -0
- package/esm/models/operations/get-request-stats.js +40 -0
- package/esm/models/operations/get-request.d.ts +11 -0
- package/esm/models/operations/get-request.js +11 -0
- package/esm/models/operations/get-snapshot.d.ts +0 -12
- package/esm/models/operations/get-snapshot.js +0 -9
- package/esm/models/operations/get-workspace.d.ts +0 -12
- package/esm/models/operations/get-workspace.js +0 -9
- package/esm/models/operations/index.d.ts +13 -15
- package/esm/models/operations/index.js +13 -15
- package/esm/models/operations/list-apps.d.ts +26 -0
- package/esm/models/operations/list-apps.js +23 -0
- package/esm/models/operations/list-audit-events.d.ts +30 -0
- package/esm/models/operations/list-audit-events.js +25 -0
- package/esm/models/operations/list-environments.d.ts +6 -21
- package/esm/models/operations/list-environments.js +3 -16
- package/esm/models/operations/list-requests.d.ts +68 -0
- package/esm/models/operations/list-requests.js +53 -0
- package/esm/models/operations/list-snapshots.d.ts +8 -6
- package/esm/models/operations/list-snapshots.js +4 -3
- package/esm/models/operations/list-versions.d.ts +28 -0
- package/esm/models/operations/list-versions.js +24 -0
- package/esm/models/operations/list-workspaces.d.ts +8 -4
- package/esm/models/operations/list-workspaces.js +7 -4
- package/esm/models/operations/pause-environment.d.ts +13 -0
- package/esm/models/operations/pause-environment.js +17 -0
- package/esm/models/operations/resume-environment.d.ts +2 -12
- package/esm/models/operations/resume-environment.js +8 -11
- package/esm/models/operations/update-environment.d.ts +29 -0
- package/esm/models/operations/update-environment.js +20 -0
- package/esm/models/operations/update-snapshot.d.ts +0 -14
- package/esm/models/operations/update-snapshot.js +0 -10
- package/esm/models/permission.d.ts +17 -0
- package/esm/models/permission.js +18 -0
- package/esm/models/principal.d.ts +20 -0
- package/esm/models/principal.js +24 -0
- package/esm/models/request-detail.d.ts +39 -0
- package/esm/models/request-detail.js +38 -0
- package/esm/models/request-stats.d.ts +26 -0
- package/esm/models/request-stats.js +31 -0
- package/esm/models/request.d.ts +30 -0
- package/esm/models/request.js +34 -0
- package/esm/models/snapshot-status.d.ts +13 -0
- package/esm/models/snapshot-status.js +14 -0
- package/esm/models/snapshot.d.ts +47 -0
- package/esm/models/snapshot.js +54 -0
- package/esm/models/version.d.ts +27 -0
- package/esm/models/version.js +31 -0
- package/esm/models/workspace.d.ts +2 -4
- package/esm/models/workspace.js +2 -4
- package/esm/sdk/apps.d.ts +6 -0
- package/esm/sdk/apps.js +15 -0
- package/esm/sdk/audit-events.d.ts +5 -0
- package/esm/sdk/audit-events.js +11 -0
- package/esm/sdk/environments.d.ts +8 -9
- package/esm/sdk/environments.js +19 -23
- package/esm/sdk/requests.d.ts +9 -0
- package/esm/sdk/requests.js +23 -0
- package/esm/sdk/sdk.d.ts +11 -11
- package/esm/sdk/sdk.js +16 -23
- package/esm/sdk/snapshots.d.ts +6 -5
- package/esm/sdk/snapshots.js +7 -7
- package/esm/sdk/workspaces.d.ts +1 -2
- package/esm/sdk/workspaces.js +0 -4
- package/esm/types/smart-union.js +1 -2
- package/openapi.json +1630 -2380
- package/package.json +15 -13
- package/esm/extensions/apps.d.ts +0 -18
- package/esm/extensions/apps.js +0 -39
- package/esm/extensions/connection.d.ts +0 -42
- package/esm/extensions/connection.js +0 -133
- package/esm/extensions/running-environment.d.ts +0 -46
- package/esm/extensions/running-environment.js +0 -66
- package/esm/funcs/create-environment-definition.d.ts +0 -11
- package/esm/funcs/create-environment-definition.js +0 -94
- package/esm/funcs/credential-get.js +0 -76
- package/esm/funcs/environments-reveal.d.ts +0 -11
- package/esm/funcs/environments-suspend.d.ts +0 -11
- package/esm/funcs/get-environment-exchange.d.ts +0 -11
- package/esm/funcs/get-environment-exchange.js +0 -96
- package/esm/funcs/get-environment-position.d.ts +0 -11
- package/esm/funcs/list-environment-history.d.ts +0 -11
- package/esm/funcs/snapshots-capture.d.ts +0 -11
- package/esm/models/app-instance-snapshot.d.ts +0 -15
- package/esm/models/app-instance-snapshot.js +0 -19
- package/esm/models/catalog.d.ts +0 -12
- package/esm/models/catalog.js +0 -15
- package/esm/models/connection-secret.d.ts +0 -30
- package/esm/models/connection-secret.js +0 -31
- package/esm/models/connection.d.ts +0 -40
- package/esm/models/connection.js +0 -44
- package/esm/models/create-environment-input.d.ts +0 -39
- package/esm/models/create-environment-input.js +0 -25
- package/esm/models/credential-kind.d.ts +0 -9
- package/esm/models/credential-kind.js +0 -10
- package/esm/models/credential.d.ts +0 -48
- package/esm/models/credential.js +0 -44
- package/esm/models/environment-app.d.ts +0 -53
- package/esm/models/environment-app.js +0 -57
- package/esm/models/environment-exchange.d.ts +0 -116
- package/esm/models/environment-exchange.js +0 -126
- package/esm/models/environment-lifetime.d.ts +0 -10
- package/esm/models/environment-lifetime.js +0 -14
- package/esm/models/environment-position.d.ts +0 -25
- package/esm/models/environment-position.js +0 -32
- package/esm/models/environment-snapshot.d.ts +0 -40
- package/esm/models/environment-snapshot.js +0 -42
- package/esm/models/error-response.d.ts +0 -58
- package/esm/models/error-response.js +0 -60
- package/esm/models/event-page.d.ts +0 -11
- package/esm/models/event-page.js +0 -16
- package/esm/models/history-body.d.ts +0 -28
- package/esm/models/history-body.js +0 -33
- package/esm/models/history-cause.d.ts +0 -48
- package/esm/models/history-cause.js +0 -63
- package/esm/models/history-position.d.ts +0 -11
- package/esm/models/history-position.js +0 -15
- package/esm/models/history-transaction.d.ts +0 -16
- package/esm/models/history-transaction.js +0 -20
- package/esm/models/operations/capture-snapshot.d.ts +0 -41
- package/esm/models/operations/capture-snapshot.js +0 -36
- package/esm/models/operations/create-environment-definition.d.ts +0 -225
- package/esm/models/operations/create-environment-definition.js +0 -149
- package/esm/models/operations/create-environments.d.ts +0 -27
- package/esm/models/operations/create-environments.js +0 -27
- package/esm/models/operations/get-catalog.d.ts +0 -13
- package/esm/models/operations/get-catalog.js +0 -13
- package/esm/models/operations/get-connection.d.ts +0 -25
- package/esm/models/operations/get-connection.js +0 -21
- package/esm/models/operations/get-credential.d.ts +0 -13
- package/esm/models/operations/get-credential.js +0 -13
- package/esm/models/operations/get-environment-exchange.d.ts +0 -25
- package/esm/models/operations/get-environment-exchange.js +0 -21
- package/esm/models/operations/get-environment-position.d.ts +0 -23
- package/esm/models/operations/get-environment-position.js +0 -20
- package/esm/models/operations/get-release.d.ts +0 -23
- package/esm/models/operations/get-release.js +0 -20
- package/esm/models/operations/list-environment-events.d.ts +0 -15
- package/esm/models/operations/list-environment-events.js +0 -13
- package/esm/models/operations/list-environment-history.d.ts +0 -28
- package/esm/models/operations/list-environment-history.js +0 -24
- package/esm/models/operations/list-workspace-events.d.ts +0 -15
- package/esm/models/operations/list-workspace-events.js +0 -13
- package/esm/models/operations/reveal-connection.d.ts +0 -59
- package/esm/models/operations/reveal-connection.js +0 -55
- package/esm/models/operations/stop-environment.d.ts +0 -23
- package/esm/models/operations/stop-environment.js +0 -20
- package/esm/models/operations/suspend-environment.d.ts +0 -23
- package/esm/models/operations/suspend-environment.js +0 -20
- package/esm/models/release-actor.d.ts +0 -11
- package/esm/models/release-actor.js +0 -15
- package/esm/models/release.d.ts +0 -37
- package/esm/models/release.js +0 -39
- package/esm/sdk/catalog.d.ts +0 -6
- package/esm/sdk/catalog.js +0 -15
- package/esm/sdk/credential.d.ts +0 -5
- package/esm/sdk/credential.js +0 -11
- package/esm/types/discriminated-union.d.ts +0 -24
- package/esm/types/discriminated-union.js +0 -60
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
5
|
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import * as types from "../../types/primitives.js";
|
|
6
7
|
import * as models from "../index.js";
|
|
7
8
|
export const Archived = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Only: "only",
|
|
9
|
+
True: "true",
|
|
10
|
+
False: "false",
|
|
11
11
|
};
|
|
12
12
|
/** @internal */
|
|
13
13
|
export const Archived$outboundSchema = z.enum(Archived);
|
|
14
14
|
/** @internal */
|
|
15
15
|
export const ListWorkspacesRequest$outboundSchema = z.object({
|
|
16
|
-
|
|
16
|
+
limit: z._default(z.int(), 50),
|
|
17
|
+
cursor: z.optional(z.string()),
|
|
18
|
+
archived: z._default(Archived$outboundSchema, "false"),
|
|
17
19
|
});
|
|
18
20
|
export function listWorkspacesRequestToJSON(listWorkspacesRequest) {
|
|
19
21
|
return JSON.stringify(ListWorkspacesRequest$outboundSchema.parse(listWorkspacesRequest));
|
|
@@ -21,6 +23,7 @@ export function listWorkspacesRequestToJSON(listWorkspacesRequest) {
|
|
|
21
23
|
/** @internal */
|
|
22
24
|
export const ListWorkspacesResponse$inboundSchema = z.object({
|
|
23
25
|
data: z.array(models.Workspace$inboundSchema),
|
|
26
|
+
nextCursor: types.nullable(types.string()),
|
|
24
27
|
});
|
|
25
28
|
export function listWorkspacesResponseFromJSON(jsonString) {
|
|
26
29
|
return safeParse(jsonString, (x) => ListWorkspacesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListWorkspacesResponse' from JSON`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type PauseEnvironmentRequest = {
|
|
3
|
+
environmentId: string;
|
|
4
|
+
idempotencyKey?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type PauseEnvironmentRequest$Outbound = {
|
|
8
|
+
environmentId: string;
|
|
9
|
+
"idempotency-key"?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const PauseEnvironmentRequest$outboundSchema: z.ZodMiniType<PauseEnvironmentRequest$Outbound, PauseEnvironmentRequest>;
|
|
13
|
+
export declare function pauseEnvironmentRequestToJSON(pauseEnvironmentRequest: PauseEnvironmentRequest): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
/** @internal */
|
|
7
|
+
export const PauseEnvironmentRequest$outboundSchema = z.pipe(z.object({
|
|
8
|
+
environmentId: z.string(),
|
|
9
|
+
idempotencyKey: z.optional(z.string()),
|
|
10
|
+
}), z.transform((v) => {
|
|
11
|
+
return remap$(v, {
|
|
12
|
+
idempotencyKey: "idempotency-key",
|
|
13
|
+
});
|
|
14
|
+
}));
|
|
15
|
+
export function pauseEnvironmentRequestToJSON(pauseEnvironmentRequest) {
|
|
16
|
+
return JSON.stringify(PauseEnvironmentRequest$outboundSchema.parse(pauseEnvironmentRequest));
|
|
17
|
+
}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
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
2
|
export type ResumeEnvironmentRequest = {
|
|
6
3
|
environmentId: string;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Environment queued to run again on the data it was suspended with
|
|
10
|
-
*/
|
|
11
|
-
export type ResumeEnvironmentResponse = {
|
|
12
|
-
data: models.Environment;
|
|
4
|
+
idempotencyKey?: string | undefined;
|
|
13
5
|
};
|
|
14
6
|
/** @internal */
|
|
15
7
|
export type ResumeEnvironmentRequest$Outbound = {
|
|
16
8
|
environmentId: string;
|
|
9
|
+
"idempotency-key"?: string | undefined;
|
|
17
10
|
};
|
|
18
11
|
/** @internal */
|
|
19
12
|
export declare const ResumeEnvironmentRequest$outboundSchema: z.ZodMiniType<ResumeEnvironmentRequest$Outbound, ResumeEnvironmentRequest>;
|
|
20
13
|
export declare function resumeEnvironmentRequestToJSON(resumeEnvironmentRequest: ResumeEnvironmentRequest): string;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare const ResumeEnvironmentResponse$inboundSchema: z.ZodMiniType<ResumeEnvironmentResponse, unknown>;
|
|
23
|
-
export declare function resumeEnvironmentResponseFromJSON(jsonString: string): SafeParseResult<ResumeEnvironmentResponse, SDKValidationError>;
|
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
|
-
import {
|
|
6
|
-
import * as models from "../index.js";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
/** @internal */
|
|
8
|
-
export const ResumeEnvironmentRequest$outboundSchema = z.object({
|
|
7
|
+
export const ResumeEnvironmentRequest$outboundSchema = z.pipe(z.object({
|
|
9
8
|
environmentId: z.string(),
|
|
10
|
-
|
|
9
|
+
idempotencyKey: z.optional(z.string()),
|
|
10
|
+
}), z.transform((v) => {
|
|
11
|
+
return remap$(v, {
|
|
12
|
+
idempotencyKey: "idempotency-key",
|
|
13
|
+
});
|
|
14
|
+
}));
|
|
11
15
|
export function resumeEnvironmentRequestToJSON(resumeEnvironmentRequest) {
|
|
12
16
|
return JSON.stringify(ResumeEnvironmentRequest$outboundSchema.parse(resumeEnvironmentRequest));
|
|
13
17
|
}
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const ResumeEnvironmentResponse$inboundSchema = z.object({
|
|
16
|
-
data: models.Environment$inboundSchema,
|
|
17
|
-
});
|
|
18
|
-
export function resumeEnvironmentResponseFromJSON(jsonString) {
|
|
19
|
-
return safeParse(jsonString, (x) => ResumeEnvironmentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResumeEnvironmentResponse' from JSON`);
|
|
20
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type UpdateEnvironmentRequestBody = {
|
|
3
|
+
labels?: {
|
|
4
|
+
[k: string]: string;
|
|
5
|
+
} | undefined;
|
|
6
|
+
name?: string | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type UpdateEnvironmentRequest = {
|
|
9
|
+
environmentId: string;
|
|
10
|
+
body: UpdateEnvironmentRequestBody;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type UpdateEnvironmentRequestBody$Outbound = {
|
|
14
|
+
labels?: {
|
|
15
|
+
[k: string]: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
name?: string | null | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const UpdateEnvironmentRequestBody$outboundSchema: z.ZodMiniType<UpdateEnvironmentRequestBody$Outbound, UpdateEnvironmentRequestBody>;
|
|
21
|
+
export declare function updateEnvironmentRequestBodyToJSON(updateEnvironmentRequestBody: UpdateEnvironmentRequestBody): string;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type UpdateEnvironmentRequest$Outbound = {
|
|
24
|
+
environmentId: string;
|
|
25
|
+
body: UpdateEnvironmentRequestBody$Outbound;
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const UpdateEnvironmentRequest$outboundSchema: z.ZodMiniType<UpdateEnvironmentRequest$Outbound, UpdateEnvironmentRequest>;
|
|
29
|
+
export declare function updateEnvironmentRequestToJSON(updateEnvironmentRequest: UpdateEnvironmentRequest): string;
|
|
@@ -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
|
+
/** @internal */
|
|
6
|
+
export const UpdateEnvironmentRequestBody$outboundSchema = z.object({
|
|
7
|
+
labels: z.optional(z.record(z.string(), z.string())),
|
|
8
|
+
name: z.optional(z.nullable(z.string())),
|
|
9
|
+
});
|
|
10
|
+
export function updateEnvironmentRequestBodyToJSON(updateEnvironmentRequestBody) {
|
|
11
|
+
return JSON.stringify(UpdateEnvironmentRequestBody$outboundSchema.parse(updateEnvironmentRequestBody));
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const UpdateEnvironmentRequest$outboundSchema = z.object({
|
|
15
|
+
environmentId: z.string(),
|
|
16
|
+
body: z.lazy(() => UpdateEnvironmentRequestBody$outboundSchema),
|
|
17
|
+
});
|
|
18
|
+
export function updateEnvironmentRequestToJSON(updateEnvironmentRequest) {
|
|
19
|
+
return JSON.stringify(UpdateEnvironmentRequest$outboundSchema.parse(updateEnvironmentRequest));
|
|
20
|
+
}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
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
2
|
export type UpdateSnapshotRequestBody = {
|
|
6
|
-
expectedVersion: number;
|
|
7
3
|
name: string | null;
|
|
8
4
|
};
|
|
9
5
|
export type UpdateSnapshotRequest = {
|
|
10
6
|
snapshotId: string;
|
|
11
7
|
body: UpdateSnapshotRequestBody;
|
|
12
8
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Environment snapshot renamed
|
|
15
|
-
*/
|
|
16
|
-
export type UpdateSnapshotResponse = {
|
|
17
|
-
data: models.EnvironmentSnapshot;
|
|
18
|
-
};
|
|
19
9
|
/** @internal */
|
|
20
10
|
export type UpdateSnapshotRequestBody$Outbound = {
|
|
21
|
-
expectedVersion: number;
|
|
22
11
|
name: string | null;
|
|
23
12
|
};
|
|
24
13
|
/** @internal */
|
|
@@ -32,6 +21,3 @@ export type UpdateSnapshotRequest$Outbound = {
|
|
|
32
21
|
/** @internal */
|
|
33
22
|
export declare const UpdateSnapshotRequest$outboundSchema: z.ZodMiniType<UpdateSnapshotRequest$Outbound, UpdateSnapshotRequest>;
|
|
34
23
|
export declare function updateSnapshotRequestToJSON(updateSnapshotRequest: UpdateSnapshotRequest): string;
|
|
35
|
-
/** @internal */
|
|
36
|
-
export declare const UpdateSnapshotResponse$inboundSchema: z.ZodMiniType<UpdateSnapshotResponse, unknown>;
|
|
37
|
-
export declare function updateSnapshotResponseFromJSON(jsonString: string): SafeParseResult<UpdateSnapshotResponse, SDKValidationError>;
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
-
import * as models from "../index.js";
|
|
7
5
|
/** @internal */
|
|
8
6
|
export const UpdateSnapshotRequestBody$outboundSchema = z.object({
|
|
9
|
-
expectedVersion: z.int(),
|
|
10
7
|
name: z.nullable(z.string()),
|
|
11
8
|
});
|
|
12
9
|
export function updateSnapshotRequestBodyToJSON(updateSnapshotRequestBody) {
|
|
@@ -20,10 +17,3 @@ export const UpdateSnapshotRequest$outboundSchema = z.object({
|
|
|
20
17
|
export function updateSnapshotRequestToJSON(updateSnapshotRequest) {
|
|
21
18
|
return JSON.stringify(UpdateSnapshotRequest$outboundSchema.parse(updateSnapshotRequest));
|
|
22
19
|
}
|
|
23
|
-
/** @internal */
|
|
24
|
-
export const UpdateSnapshotResponse$inboundSchema = z.object({
|
|
25
|
-
data: models.EnvironmentSnapshot$inboundSchema,
|
|
26
|
-
});
|
|
27
|
-
export function updateSnapshotResponseFromJSON(jsonString) {
|
|
28
|
-
return safeParse(jsonString, (x) => UpdateSnapshotResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSnapshotResponse' from JSON`);
|
|
29
|
-
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const Permission: {
|
|
4
|
+
readonly EnvironmentsRead: "environments:read";
|
|
5
|
+
readonly EnvironmentsWrite: "environments:write";
|
|
6
|
+
readonly EnvironmentsConnect: "environments:connect";
|
|
7
|
+
readonly SnapshotsRead: "snapshots:read";
|
|
8
|
+
readonly SnapshotsWrite: "snapshots:write";
|
|
9
|
+
readonly WorkspacesWrite: "workspaces:write";
|
|
10
|
+
readonly ApiKeysRead: "api_keys:read";
|
|
11
|
+
readonly ApiKeysWrite: "api_keys:write";
|
|
12
|
+
readonly MembersRead: "members:read";
|
|
13
|
+
readonly MembersWrite: "members:write";
|
|
14
|
+
};
|
|
15
|
+
export type Permission = OpenEnum<typeof Permission>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const Permission$inboundSchema: z.ZodMiniType<Permission, unknown>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
export const Permission = {
|
|
6
|
+
EnvironmentsRead: "environments:read",
|
|
7
|
+
EnvironmentsWrite: "environments:write",
|
|
8
|
+
EnvironmentsConnect: "environments:connect",
|
|
9
|
+
SnapshotsRead: "snapshots:read",
|
|
10
|
+
SnapshotsWrite: "snapshots:write",
|
|
11
|
+
WorkspacesWrite: "workspaces:write",
|
|
12
|
+
ApiKeysRead: "api_keys:read",
|
|
13
|
+
ApiKeysWrite: "api_keys:write",
|
|
14
|
+
MembersRead: "members:read",
|
|
15
|
+
MembersWrite: "members:write",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const Permission$inboundSchema = openEnums.inboundSchema(Permission);
|
|
@@ -0,0 +1,20 @@
|
|
|
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 declare const PrincipalType: {
|
|
6
|
+
readonly Member: "member";
|
|
7
|
+
readonly ApiKey: "api_key";
|
|
8
|
+
readonly System: "system";
|
|
9
|
+
};
|
|
10
|
+
export type PrincipalType = OpenEnum<typeof PrincipalType>;
|
|
11
|
+
export type Principal = {
|
|
12
|
+
id: string | null;
|
|
13
|
+
name: string | null;
|
|
14
|
+
type: PrincipalType;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const PrincipalType$inboundSchema: z.ZodMiniType<PrincipalType, unknown>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const Principal$inboundSchema: z.ZodMiniType<Principal, unknown>;
|
|
20
|
+
export declare function principalFromJSON(jsonString: string): SafeParseResult<Principal, SDKValidationError>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
export const PrincipalType = {
|
|
9
|
+
Member: "member",
|
|
10
|
+
ApiKey: "api_key",
|
|
11
|
+
System: "system",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const PrincipalType$inboundSchema = openEnums.inboundSchema(PrincipalType);
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const Principal$inboundSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
id: types.nullable(types.string()),
|
|
19
|
+
name: types.nullable(types.string()),
|
|
20
|
+
type: PrincipalType$inboundSchema,
|
|
21
|
+
});
|
|
22
|
+
export function principalFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => Principal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Principal' from JSON`);
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { BodyPreview } from "./body-preview.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
6
|
+
export declare const RequestDetailRespondedBy: {
|
|
7
|
+
readonly App: "app";
|
|
8
|
+
readonly Gateway: "gateway";
|
|
9
|
+
};
|
|
10
|
+
export type RequestDetailRespondedBy = OpenEnum<typeof RequestDetailRespondedBy>;
|
|
11
|
+
export type RequestDetail = {
|
|
12
|
+
app: string;
|
|
13
|
+
completedAt: Date;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
environmentId: string;
|
|
16
|
+
errorCode: string | null;
|
|
17
|
+
id: string;
|
|
18
|
+
method: string;
|
|
19
|
+
path: string;
|
|
20
|
+
query: string;
|
|
21
|
+
receivedAt: Date;
|
|
22
|
+
requestBytes: number | null;
|
|
23
|
+
respondedBy: RequestDetailRespondedBy;
|
|
24
|
+
responseBytes: number | null;
|
|
25
|
+
responseStatus: number;
|
|
26
|
+
requestBody: BodyPreview;
|
|
27
|
+
requestHeaders: {
|
|
28
|
+
[k: string]: string;
|
|
29
|
+
};
|
|
30
|
+
responseBody: BodyPreview;
|
|
31
|
+
responseHeaders: {
|
|
32
|
+
[k: string]: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** @internal */
|
|
36
|
+
export declare const RequestDetailRespondedBy$inboundSchema: z.ZodMiniType<RequestDetailRespondedBy, unknown>;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const RequestDetail$inboundSchema: z.ZodMiniType<RequestDetail, unknown>;
|
|
39
|
+
export declare function requestDetailFromJSON(jsonString: string): SafeParseResult<RequestDetail, SDKValidationError>;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { BodyPreview$inboundSchema } from "./body-preview.js";
|
|
9
|
+
export const RequestDetailRespondedBy = {
|
|
10
|
+
App: "app",
|
|
11
|
+
Gateway: "gateway",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const RequestDetailRespondedBy$inboundSchema = openEnums.inboundSchema(RequestDetailRespondedBy);
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const RequestDetail$inboundSchema = z.object({
|
|
17
|
+
app: types.string(),
|
|
18
|
+
completedAt: types.date(),
|
|
19
|
+
durationMs: types.number(),
|
|
20
|
+
environmentId: types.string(),
|
|
21
|
+
errorCode: types.nullable(types.string()),
|
|
22
|
+
id: types.string(),
|
|
23
|
+
method: types.string(),
|
|
24
|
+
path: types.string(),
|
|
25
|
+
query: types.string(),
|
|
26
|
+
receivedAt: types.date(),
|
|
27
|
+
requestBytes: types.nullable(types.number()),
|
|
28
|
+
respondedBy: RequestDetailRespondedBy$inboundSchema,
|
|
29
|
+
responseBytes: types.nullable(types.number()),
|
|
30
|
+
responseStatus: types.number(),
|
|
31
|
+
requestBody: BodyPreview$inboundSchema,
|
|
32
|
+
requestHeaders: z.record(z.string(), types.string()),
|
|
33
|
+
responseBody: BodyPreview$inboundSchema,
|
|
34
|
+
responseHeaders: z.record(z.string(), types.string()),
|
|
35
|
+
});
|
|
36
|
+
export function requestDetailFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => RequestDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestDetail' from JSON`);
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 Bucket = {
|
|
5
|
+
clientError: number;
|
|
6
|
+
from: Date;
|
|
7
|
+
serverError: number;
|
|
8
|
+
success: number;
|
|
9
|
+
};
|
|
10
|
+
export type RequestStats = {
|
|
11
|
+
buckets: Array<Bucket>;
|
|
12
|
+
clientErrorCount: number;
|
|
13
|
+
count: number;
|
|
14
|
+
from: Date;
|
|
15
|
+
p50Ms: number | null;
|
|
16
|
+
p95Ms: number | null;
|
|
17
|
+
serverErrorCount: number;
|
|
18
|
+
successCount: number;
|
|
19
|
+
to: Date;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const Bucket$inboundSchema: z.ZodMiniType<Bucket, unknown>;
|
|
23
|
+
export declare function bucketFromJSON(jsonString: string): SafeParseResult<Bucket, SDKValidationError>;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const RequestStats$inboundSchema: z.ZodMiniType<RequestStats, unknown>;
|
|
26
|
+
export declare function requestStatsFromJSON(jsonString: string): SafeParseResult<RequestStats, SDKValidationError>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 Bucket$inboundSchema = z.object({
|
|
9
|
+
clientError: types.number(),
|
|
10
|
+
from: types.date(),
|
|
11
|
+
serverError: types.number(),
|
|
12
|
+
success: types.number(),
|
|
13
|
+
});
|
|
14
|
+
export function bucketFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => Bucket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bucket' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const RequestStats$inboundSchema = z.object({
|
|
19
|
+
buckets: z.array(z.lazy(() => Bucket$inboundSchema)),
|
|
20
|
+
clientErrorCount: types.number(),
|
|
21
|
+
count: types.number(),
|
|
22
|
+
from: types.date(),
|
|
23
|
+
p50Ms: types.nullable(types.number()),
|
|
24
|
+
p95Ms: types.nullable(types.number()),
|
|
25
|
+
serverErrorCount: types.number(),
|
|
26
|
+
successCount: types.number(),
|
|
27
|
+
to: types.date(),
|
|
28
|
+
});
|
|
29
|
+
export function requestStatsFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => RequestStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestStats' from JSON`);
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 declare const RequestRespondedBy: {
|
|
6
|
+
readonly App: "app";
|
|
7
|
+
readonly Gateway: "gateway";
|
|
8
|
+
};
|
|
9
|
+
export type RequestRespondedBy = OpenEnum<typeof RequestRespondedBy>;
|
|
10
|
+
export type RequestT = {
|
|
11
|
+
app: string;
|
|
12
|
+
completedAt: Date;
|
|
13
|
+
durationMs: number;
|
|
14
|
+
environmentId: string;
|
|
15
|
+
errorCode: string | null;
|
|
16
|
+
id: string;
|
|
17
|
+
method: string;
|
|
18
|
+
path: string;
|
|
19
|
+
query: string;
|
|
20
|
+
receivedAt: Date;
|
|
21
|
+
requestBytes: number | null;
|
|
22
|
+
respondedBy: RequestRespondedBy;
|
|
23
|
+
responseBytes: number | null;
|
|
24
|
+
responseStatus: number;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const RequestRespondedBy$inboundSchema: z.ZodMiniType<RequestRespondedBy, unknown>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const RequestT$inboundSchema: z.ZodMiniType<RequestT, unknown>;
|
|
30
|
+
export declare function requestFromJSON(jsonString: string): SafeParseResult<RequestT, SDKValidationError>;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export const RequestRespondedBy = {
|
|
9
|
+
App: "app",
|
|
10
|
+
Gateway: "gateway",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const RequestRespondedBy$inboundSchema = openEnums.inboundSchema(RequestRespondedBy);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const RequestT$inboundSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
app: types.string(),
|
|
18
|
+
completedAt: types.date(),
|
|
19
|
+
durationMs: types.number(),
|
|
20
|
+
environmentId: types.string(),
|
|
21
|
+
errorCode: types.nullable(types.string()),
|
|
22
|
+
id: types.string(),
|
|
23
|
+
method: types.string(),
|
|
24
|
+
path: types.string(),
|
|
25
|
+
query: types.string(),
|
|
26
|
+
receivedAt: types.date(),
|
|
27
|
+
requestBytes: types.nullable(types.number()),
|
|
28
|
+
respondedBy: RequestRespondedBy$inboundSchema,
|
|
29
|
+
responseBytes: types.nullable(types.number()),
|
|
30
|
+
responseStatus: types.number(),
|
|
31
|
+
});
|
|
32
|
+
export function requestFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => RequestT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestT' from JSON`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const SnapshotStatus: {
|
|
4
|
+
readonly Saving: "saving";
|
|
5
|
+
readonly Ready: "ready";
|
|
6
|
+
readonly Failed: "failed";
|
|
7
|
+
readonly Deleted: "deleted";
|
|
8
|
+
};
|
|
9
|
+
export type SnapshotStatus = OpenEnum<typeof SnapshotStatus>;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const SnapshotStatus$inboundSchema: z.ZodMiniType<SnapshotStatus, unknown>;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const SnapshotStatus$outboundSchema: z.ZodMiniType<string, SnapshotStatus>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
export const SnapshotStatus = {
|
|
6
|
+
Saving: "saving",
|
|
7
|
+
Ready: "ready",
|
|
8
|
+
Failed: "failed",
|
|
9
|
+
Deleted: "deleted",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SnapshotStatus$inboundSchema = openEnums.inboundSchema(SnapshotStatus);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const SnapshotStatus$outboundSchema = openEnums.outboundSchema(SnapshotStatus);
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { Principal } from "./principal.js";
|
|
6
|
+
import { SnapshotStatus } from "./snapshot-status.js";
|
|
7
|
+
export type SnapshotApp = {
|
|
8
|
+
appId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
sizeBytes: number | null;
|
|
11
|
+
version: string;
|
|
12
|
+
versionId: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const SnapshotCode: {
|
|
15
|
+
readonly Interrupted: "interrupted";
|
|
16
|
+
readonly InternalError: "internal_error";
|
|
17
|
+
};
|
|
18
|
+
export type SnapshotCode = OpenEnum<typeof SnapshotCode>;
|
|
19
|
+
export type Failure = {
|
|
20
|
+
code: SnapshotCode;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
export type Snapshot = {
|
|
24
|
+
apps: Array<SnapshotApp>;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
createdBy: Principal;
|
|
27
|
+
deletedAt: Date | null;
|
|
28
|
+
environmentId: string;
|
|
29
|
+
failure: Failure | null;
|
|
30
|
+
id: string;
|
|
31
|
+
name: string | null;
|
|
32
|
+
readyAt: Date | null;
|
|
33
|
+
sizeBytes: number | null;
|
|
34
|
+
status: SnapshotStatus;
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
};
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const SnapshotApp$inboundSchema: z.ZodMiniType<SnapshotApp, unknown>;
|
|
39
|
+
export declare function snapshotAppFromJSON(jsonString: string): SafeParseResult<SnapshotApp, SDKValidationError>;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const SnapshotCode$inboundSchema: z.ZodMiniType<SnapshotCode, unknown>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const Failure$inboundSchema: z.ZodMiniType<Failure, unknown>;
|
|
44
|
+
export declare function failureFromJSON(jsonString: string): SafeParseResult<Failure, SDKValidationError>;
|
|
45
|
+
/** @internal */
|
|
46
|
+
export declare const Snapshot$inboundSchema: z.ZodMiniType<Snapshot, unknown>;
|
|
47
|
+
export declare function snapshotFromJSON(jsonString: string): SafeParseResult<Snapshot, SDKValidationError>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { Principal$inboundSchema } from "./principal.js";
|
|
9
|
+
import { SnapshotStatus$inboundSchema, } from "./snapshot-status.js";
|
|
10
|
+
export const SnapshotCode = {
|
|
11
|
+
Interrupted: "interrupted",
|
|
12
|
+
InternalError: "internal_error",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const SnapshotApp$inboundSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
appId: types.string(),
|
|
18
|
+
name: types.string(),
|
|
19
|
+
sizeBytes: types.nullable(types.number()),
|
|
20
|
+
version: types.string(),
|
|
21
|
+
versionId: types.string(),
|
|
22
|
+
});
|
|
23
|
+
export function snapshotAppFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => SnapshotApp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotApp' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const SnapshotCode$inboundSchema = openEnums.inboundSchema(SnapshotCode);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const Failure$inboundSchema = z.object({
|
|
30
|
+
code: SnapshotCode$inboundSchema,
|
|
31
|
+
message: types.string(),
|
|
32
|
+
});
|
|
33
|
+
export function failureFromJSON(jsonString) {
|
|
34
|
+
return safeParse(jsonString, (x) => Failure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Failure' from JSON`);
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const Snapshot$inboundSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
apps: z.array(z.lazy(() => SnapshotApp$inboundSchema)),
|
|
40
|
+
createdAt: types.date(),
|
|
41
|
+
createdBy: Principal$inboundSchema,
|
|
42
|
+
deletedAt: types.nullable(types.date()),
|
|
43
|
+
environmentId: types.string(),
|
|
44
|
+
failure: types.nullable(z.lazy(() => Failure$inboundSchema)),
|
|
45
|
+
id: types.string(),
|
|
46
|
+
name: types.nullable(types.string()),
|
|
47
|
+
readyAt: types.nullable(types.date()),
|
|
48
|
+
sizeBytes: types.nullable(types.number()),
|
|
49
|
+
status: SnapshotStatus$inboundSchema,
|
|
50
|
+
workspaceId: types.string(),
|
|
51
|
+
});
|
|
52
|
+
export function snapshotFromJSON(jsonString) {
|
|
53
|
+
return safeParse(jsonString, (x) => Snapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Snapshot' from JSON`);
|
|
54
|
+
}
|