@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,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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type GetEnvironmentExchangeRequest = {
|
|
6
|
+
environmentId: string;
|
|
7
|
+
exchangeId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* One exchange of the environment, with the position a fork after it starts from
|
|
11
|
+
*/
|
|
12
|
+
export type GetEnvironmentExchangeResponse = {
|
|
13
|
+
data: models.EnvironmentExchange;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type GetEnvironmentExchangeRequest$Outbound = {
|
|
17
|
+
environmentId: string;
|
|
18
|
+
exchangeId: string;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const GetEnvironmentExchangeRequest$outboundSchema: z.ZodMiniType<GetEnvironmentExchangeRequest$Outbound, GetEnvironmentExchangeRequest>;
|
|
22
|
+
export declare function getEnvironmentExchangeRequestToJSON(getEnvironmentExchangeRequest: GetEnvironmentExchangeRequest): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const GetEnvironmentExchangeResponse$inboundSchema: z.ZodMiniType<GetEnvironmentExchangeResponse, unknown>;
|
|
25
|
+
export declare function getEnvironmentExchangeResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentExchangeResponse, SDKValidationError>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 GetEnvironmentExchangeRequest$outboundSchema = z.object({
|
|
9
|
+
environmentId: z.string(),
|
|
10
|
+
exchangeId: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export function getEnvironmentExchangeRequestToJSON(getEnvironmentExchangeRequest) {
|
|
13
|
+
return JSON.stringify(GetEnvironmentExchangeRequest$outboundSchema.parse(getEnvironmentExchangeRequest));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const GetEnvironmentExchangeResponse$inboundSchema = z.object({
|
|
17
|
+
data: models.EnvironmentExchange$inboundSchema,
|
|
18
|
+
});
|
|
19
|
+
export function getEnvironmentExchangeResponseFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => GetEnvironmentExchangeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentExchangeResponse' from JSON`);
|
|
21
|
+
}
|
|
@@ -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 GetEnvironmentPositionRequest = {
|
|
6
|
+
environmentId: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Each app's current head position, as a fork from it would start
|
|
10
|
+
*/
|
|
11
|
+
export type GetEnvironmentPositionResponse = {
|
|
12
|
+
data: models.EnvironmentPosition;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetEnvironmentPositionRequest$Outbound = {
|
|
16
|
+
environmentId: string;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const GetEnvironmentPositionRequest$outboundSchema: z.ZodMiniType<GetEnvironmentPositionRequest$Outbound, GetEnvironmentPositionRequest>;
|
|
20
|
+
export declare function getEnvironmentPositionRequestToJSON(getEnvironmentPositionRequest: GetEnvironmentPositionRequest): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const GetEnvironmentPositionResponse$inboundSchema: z.ZodMiniType<GetEnvironmentPositionResponse, unknown>;
|
|
23
|
+
export declare function getEnvironmentPositionResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentPositionResponse, 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 GetEnvironmentPositionRequest$outboundSchema = z.object({
|
|
9
|
+
environmentId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function getEnvironmentPositionRequestToJSON(getEnvironmentPositionRequest) {
|
|
12
|
+
return JSON.stringify(GetEnvironmentPositionRequest$outboundSchema.parse(getEnvironmentPositionRequest));
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const GetEnvironmentPositionResponse$inboundSchema = z.object({
|
|
16
|
+
data: models.EnvironmentPosition$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
export function getEnvironmentPositionResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => GetEnvironmentPositionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentPositionResponse' 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,14 +1,24 @@
|
|
|
1
|
+
export * from "./capture-snapshot.js";
|
|
1
2
|
export * from "./create-environment-definition.js";
|
|
2
3
|
export * from "./create-environments.js";
|
|
4
|
+
export * from "./delete-snapshot.js";
|
|
3
5
|
export * from "./get-catalog.js";
|
|
4
6
|
export * from "./get-connection.js";
|
|
5
7
|
export * from "./get-credential.js";
|
|
8
|
+
export * from "./get-environment-exchange.js";
|
|
9
|
+
export * from "./get-environment-position.js";
|
|
6
10
|
export * from "./get-environment.js";
|
|
7
11
|
export * from "./get-release.js";
|
|
12
|
+
export * from "./get-snapshot.js";
|
|
8
13
|
export * from "./get-workspace.js";
|
|
9
14
|
export * from "./list-environment-events.js";
|
|
15
|
+
export * from "./list-environment-history.js";
|
|
10
16
|
export * from "./list-environments.js";
|
|
17
|
+
export * from "./list-snapshots.js";
|
|
11
18
|
export * from "./list-workspace-events.js";
|
|
12
19
|
export * from "./list-workspaces.js";
|
|
20
|
+
export * from "./resume-environment.js";
|
|
13
21
|
export * from "./reveal-connection.js";
|
|
14
22
|
export * from "./stop-environment.js";
|
|
23
|
+
export * from "./suspend-environment.js";
|
|
24
|
+
export * from "./update-snapshot.js";
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
export * from "./capture-snapshot.js";
|
|
4
5
|
export * from "./create-environment-definition.js";
|
|
5
6
|
export * from "./create-environments.js";
|
|
7
|
+
export * from "./delete-snapshot.js";
|
|
6
8
|
export * from "./get-catalog.js";
|
|
7
9
|
export * from "./get-connection.js";
|
|
8
10
|
export * from "./get-credential.js";
|
|
11
|
+
export * from "./get-environment-exchange.js";
|
|
12
|
+
export * from "./get-environment-position.js";
|
|
9
13
|
export * from "./get-environment.js";
|
|
10
14
|
export * from "./get-release.js";
|
|
15
|
+
export * from "./get-snapshot.js";
|
|
11
16
|
export * from "./get-workspace.js";
|
|
12
17
|
export * from "./list-environment-events.js";
|
|
18
|
+
export * from "./list-environment-history.js";
|
|
13
19
|
export * from "./list-environments.js";
|
|
20
|
+
export * from "./list-snapshots.js";
|
|
14
21
|
export * from "./list-workspace-events.js";
|
|
15
22
|
export * from "./list-workspaces.js";
|
|
23
|
+
export * from "./resume-environment.js";
|
|
16
24
|
export * from "./reveal-connection.js";
|
|
17
25
|
export * from "./stop-environment.js";
|
|
26
|
+
export * from "./suspend-environment.js";
|
|
27
|
+
export * from "./update-snapshot.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
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 ListEnvironmentHistoryRequest = {
|
|
6
|
+
environmentId: string;
|
|
7
|
+
limit?: number | undefined;
|
|
8
|
+
cursor?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The environment's exchanges in gateway order, each with its transactions and events
|
|
12
|
+
*/
|
|
13
|
+
export type ListEnvironmentHistoryResponse = {
|
|
14
|
+
data: Array<models.EnvironmentExchange>;
|
|
15
|
+
nextCursor: string | null;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export type ListEnvironmentHistoryRequest$Outbound = {
|
|
19
|
+
environmentId: string;
|
|
20
|
+
limit: number;
|
|
21
|
+
cursor?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const ListEnvironmentHistoryRequest$outboundSchema: z.ZodMiniType<ListEnvironmentHistoryRequest$Outbound, ListEnvironmentHistoryRequest>;
|
|
25
|
+
export declare function listEnvironmentHistoryRequestToJSON(listEnvironmentHistoryRequest: ListEnvironmentHistoryRequest): string;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const ListEnvironmentHistoryResponse$inboundSchema: z.ZodMiniType<ListEnvironmentHistoryResponse, unknown>;
|
|
28
|
+
export declare function listEnvironmentHistoryResponseFromJSON(jsonString: string): SafeParseResult<ListEnvironmentHistoryResponse, 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 types from "../../types/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ListEnvironmentHistoryRequest$outboundSchema = z.object({
|
|
10
|
+
environmentId: z.string(),
|
|
11
|
+
limit: z._default(z.int(), 50),
|
|
12
|
+
cursor: z.optional(z.string()),
|
|
13
|
+
});
|
|
14
|
+
export function listEnvironmentHistoryRequestToJSON(listEnvironmentHistoryRequest) {
|
|
15
|
+
return JSON.stringify(ListEnvironmentHistoryRequest$outboundSchema.parse(listEnvironmentHistoryRequest));
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ListEnvironmentHistoryResponse$inboundSchema = z.object({
|
|
19
|
+
data: z.array(models.EnvironmentExchange$inboundSchema),
|
|
20
|
+
nextCursor: types.nullable(types.string()),
|
|
21
|
+
});
|
|
22
|
+
export function listEnvironmentHistoryResponseFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => ListEnvironmentHistoryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListEnvironmentHistoryResponse' from JSON`);
|
|
24
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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 ResumeEnvironmentRequest = {
|
|
6
|
+
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;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type ResumeEnvironmentRequest$Outbound = {
|
|
16
|
+
environmentId: string;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ResumeEnvironmentRequest$outboundSchema: z.ZodMiniType<ResumeEnvironmentRequest$Outbound, ResumeEnvironmentRequest>;
|
|
20
|
+
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>;
|
|
@@ -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 ResumeEnvironmentRequest$outboundSchema = z.object({
|
|
9
|
+
environmentId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function resumeEnvironmentRequestToJSON(resumeEnvironmentRequest) {
|
|
12
|
+
return JSON.stringify(ResumeEnvironmentRequest$outboundSchema.parse(resumeEnvironmentRequest));
|
|
13
|
+
}
|
|
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,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 SuspendEnvironmentRequest = {
|
|
6
|
+
environmentId: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Environment suspending or suspended: its sandboxes go, its data stays for a resume
|
|
10
|
+
*/
|
|
11
|
+
export type SuspendEnvironmentResponse = {
|
|
12
|
+
data: models.Environment;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type SuspendEnvironmentRequest$Outbound = {
|
|
16
|
+
environmentId: string;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const SuspendEnvironmentRequest$outboundSchema: z.ZodMiniType<SuspendEnvironmentRequest$Outbound, SuspendEnvironmentRequest>;
|
|
20
|
+
export declare function suspendEnvironmentRequestToJSON(suspendEnvironmentRequest: SuspendEnvironmentRequest): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const SuspendEnvironmentResponse$inboundSchema: z.ZodMiniType<SuspendEnvironmentResponse, unknown>;
|
|
23
|
+
export declare function suspendEnvironmentResponseFromJSON(jsonString: string): SafeParseResult<SuspendEnvironmentResponse, 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 SuspendEnvironmentRequest$outboundSchema = z.object({
|
|
9
|
+
environmentId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function suspendEnvironmentRequestToJSON(suspendEnvironmentRequest) {
|
|
12
|
+
return JSON.stringify(SuspendEnvironmentRequest$outboundSchema.parse(suspendEnvironmentRequest));
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const SuspendEnvironmentResponse$inboundSchema = z.object({
|
|
16
|
+
data: models.Environment$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
export function suspendEnvironmentResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => SuspendEnvironmentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SuspendEnvironmentResponse' from JSON`);
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 UpdateSnapshotRequestBody = {
|
|
6
|
+
expectedVersion: number;
|
|
7
|
+
name: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type UpdateSnapshotRequest = {
|
|
10
|
+
snapshotId: string;
|
|
11
|
+
body: UpdateSnapshotRequestBody;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Environment snapshot renamed
|
|
15
|
+
*/
|
|
16
|
+
export type UpdateSnapshotResponse = {
|
|
17
|
+
data: models.EnvironmentSnapshot;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type UpdateSnapshotRequestBody$Outbound = {
|
|
21
|
+
expectedVersion: number;
|
|
22
|
+
name: string | null;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const UpdateSnapshotRequestBody$outboundSchema: z.ZodMiniType<UpdateSnapshotRequestBody$Outbound, UpdateSnapshotRequestBody>;
|
|
26
|
+
export declare function updateSnapshotRequestBodyToJSON(updateSnapshotRequestBody: UpdateSnapshotRequestBody): string;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type UpdateSnapshotRequest$Outbound = {
|
|
29
|
+
snapshotId: string;
|
|
30
|
+
body: UpdateSnapshotRequestBody$Outbound;
|
|
31
|
+
};
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const UpdateSnapshotRequest$outboundSchema: z.ZodMiniType<UpdateSnapshotRequest$Outbound, UpdateSnapshotRequest>;
|
|
34
|
+
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>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 UpdateSnapshotRequestBody$outboundSchema = z.object({
|
|
9
|
+
expectedVersion: z.int(),
|
|
10
|
+
name: z.nullable(z.string()),
|
|
11
|
+
});
|
|
12
|
+
export function updateSnapshotRequestBodyToJSON(updateSnapshotRequestBody) {
|
|
13
|
+
return JSON.stringify(UpdateSnapshotRequestBody$outboundSchema.parse(updateSnapshotRequestBody));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const UpdateSnapshotRequest$outboundSchema = z.object({
|
|
17
|
+
snapshotId: z.string(),
|
|
18
|
+
body: z.lazy(() => UpdateSnapshotRequestBody$outboundSchema),
|
|
19
|
+
});
|
|
20
|
+
export function updateSnapshotRequestToJSON(updateSnapshotRequest) {
|
|
21
|
+
return JSON.stringify(UpdateSnapshotRequest$outboundSchema.parse(updateSnapshotRequest));
|
|
22
|
+
}
|
|
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
|
+
}
|
package/esm/models/release.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ export declare const Qualification: {
|
|
|
9
9
|
readonly Qualified: "qualified";
|
|
10
10
|
};
|
|
11
11
|
export type Qualification = OpenEnum<typeof Qualification>;
|
|
12
|
+
export declare const ReleaseStatus: {
|
|
13
|
+
readonly Candidate: "candidate";
|
|
14
|
+
readonly Default: "default";
|
|
15
|
+
readonly Available: "available";
|
|
16
|
+
readonly Retired: "retired";
|
|
17
|
+
readonly Gone: "gone";
|
|
18
|
+
};
|
|
19
|
+
export type ReleaseStatus = OpenEnum<typeof ReleaseStatus>;
|
|
12
20
|
export type Release = {
|
|
13
21
|
actors: Array<ReleaseActor>;
|
|
14
22
|
apis: Array<ApiProfile>;
|
|
@@ -17,10 +25,13 @@ export type Release = {
|
|
|
17
25
|
id: string;
|
|
18
26
|
qualification: Qualification;
|
|
19
27
|
retiredAt: Date | null;
|
|
28
|
+
status: ReleaseStatus;
|
|
20
29
|
version: string;
|
|
21
30
|
};
|
|
22
31
|
/** @internal */
|
|
23
32
|
export declare const Qualification$inboundSchema: z.ZodMiniType<Qualification, unknown>;
|
|
24
33
|
/** @internal */
|
|
34
|
+
export declare const ReleaseStatus$inboundSchema: z.ZodMiniType<ReleaseStatus, unknown>;
|
|
35
|
+
/** @internal */
|
|
25
36
|
export declare const Release$inboundSchema: z.ZodMiniType<Release, unknown>;
|
|
26
37
|
export declare function releaseFromJSON(jsonString: string): SafeParseResult<Release, SDKValidationError>;
|
package/esm/models/release.js
CHANGED
|
@@ -11,9 +11,18 @@ export const Qualification = {
|
|
|
11
11
|
Development: "development",
|
|
12
12
|
Qualified: "qualified",
|
|
13
13
|
};
|
|
14
|
+
export const ReleaseStatus = {
|
|
15
|
+
Candidate: "candidate",
|
|
16
|
+
Default: "default",
|
|
17
|
+
Available: "available",
|
|
18
|
+
Retired: "retired",
|
|
19
|
+
Gone: "gone",
|
|
20
|
+
};
|
|
14
21
|
/** @internal */
|
|
15
22
|
export const Qualification$inboundSchema = openEnums.inboundSchema(Qualification);
|
|
16
23
|
/** @internal */
|
|
24
|
+
export const ReleaseStatus$inboundSchema = openEnums.inboundSchema(ReleaseStatus);
|
|
25
|
+
/** @internal */
|
|
17
26
|
export const Release$inboundSchema = z.object({
|
|
18
27
|
actors: z.array(ReleaseActor$inboundSchema),
|
|
19
28
|
apis: z.array(ApiProfile$inboundSchema),
|
|
@@ -22,6 +31,7 @@ export const Release$inboundSchema = z.object({
|
|
|
22
31
|
id: types.string(),
|
|
23
32
|
qualification: Qualification$inboundSchema,
|
|
24
33
|
retiredAt: types.nullable(types.date()),
|
|
34
|
+
status: ReleaseStatus$inboundSchema,
|
|
25
35
|
version: types.string(),
|
|
26
36
|
});
|
|
27
37
|
export function releaseFromJSON(jsonString) {
|
|
@@ -6,7 +6,9 @@ export declare class Environments extends ClientSDK {
|
|
|
6
6
|
getConnection(request: operations.GetConnectionRequest, options?: RequestOptions): Promise<operations.GetConnectionResponse>;
|
|
7
7
|
reveal(request: operations.RevealConnectionRequest, options?: RequestOptions): Promise<operations.RevealConnectionResponse>;
|
|
8
8
|
events(request: operations.ListEnvironmentEventsRequest, options?: RequestOptions): Promise<models.EventPage>;
|
|
9
|
+
resume(request: operations.ResumeEnvironmentRequest, options?: RequestOptions): Promise<operations.ResumeEnvironmentResponse>;
|
|
9
10
|
stop(request: operations.StopEnvironmentRequest, options?: RequestOptions): Promise<operations.StopEnvironmentResponse>;
|
|
11
|
+
suspend(request: operations.SuspendEnvironmentRequest, options?: RequestOptions): Promise<operations.SuspendEnvironmentResponse>;
|
|
10
12
|
list(request: operations.ListEnvironmentsRequest, options?: RequestOptions): Promise<operations.ListEnvironmentsResponse>;
|
|
11
13
|
create(request: operations.CreateEnvironmentsRequest, options?: RequestOptions): Promise<operations.CreateEnvironmentsResponse>;
|
|
12
14
|
}
|
package/esm/sdk/environments.js
CHANGED
|
@@ -6,8 +6,10 @@ import { environmentsEvents } from "../funcs/environments-events.js";
|
|
|
6
6
|
import { environmentsGetConnection } from "../funcs/environments-get-connection.js";
|
|
7
7
|
import { environmentsGet } from "../funcs/environments-get.js";
|
|
8
8
|
import { environmentsList } from "../funcs/environments-list.js";
|
|
9
|
+
import { environmentsResume } from "../funcs/environments-resume.js";
|
|
9
10
|
import { environmentsReveal } from "../funcs/environments-reveal.js";
|
|
10
11
|
import { environmentsStop } from "../funcs/environments-stop.js";
|
|
12
|
+
import { environmentsSuspend } from "../funcs/environments-suspend.js";
|
|
11
13
|
import { ClientSDK } from "../lib/sdks.js";
|
|
12
14
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
15
|
export class Environments extends ClientSDK {
|
|
@@ -23,9 +25,15 @@ export class Environments extends ClientSDK {
|
|
|
23
25
|
async events(request, options) {
|
|
24
26
|
return unwrapAsync(environmentsEvents(this, request, options));
|
|
25
27
|
}
|
|
28
|
+
async resume(request, options) {
|
|
29
|
+
return unwrapAsync(environmentsResume(this, request, options));
|
|
30
|
+
}
|
|
26
31
|
async stop(request, options) {
|
|
27
32
|
return unwrapAsync(environmentsStop(this, request, options));
|
|
28
33
|
}
|
|
34
|
+
async suspend(request, options) {
|
|
35
|
+
return unwrapAsync(environmentsSuspend(this, request, options));
|
|
36
|
+
}
|
|
29
37
|
async list(request, options) {
|
|
30
38
|
return unwrapAsync(environmentsList(this, request, options));
|
|
31
39
|
}
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
3
3
|
import { Catalog } from "./catalog.js";
|
|
4
4
|
import { Credential } from "./credential.js";
|
|
5
5
|
import { Environments } from "./environments.js";
|
|
6
|
+
import { Snapshots } from "./snapshots.js";
|
|
6
7
|
import { Workspaces } from "./workspaces.js";
|
|
7
8
|
export declare class StateMachines extends ClientSDK {
|
|
8
9
|
private _catalog?;
|
|
@@ -11,7 +12,12 @@ export declare class StateMachines extends ClientSDK {
|
|
|
11
12
|
get credential(): Credential;
|
|
12
13
|
private _environments?;
|
|
13
14
|
get environments(): Environments;
|
|
15
|
+
private _snapshots?;
|
|
16
|
+
get snapshots(): Snapshots;
|
|
14
17
|
private _workspaces?;
|
|
15
18
|
get workspaces(): Workspaces;
|
|
19
|
+
listEnvironmentHistory(request: operations.ListEnvironmentHistoryRequest, options?: RequestOptions): Promise<operations.ListEnvironmentHistoryResponse>;
|
|
20
|
+
getEnvironmentPosition(request: operations.GetEnvironmentPositionRequest, options?: RequestOptions): Promise<operations.GetEnvironmentPositionResponse>;
|
|
21
|
+
getEnvironmentExchange(request: operations.GetEnvironmentExchangeRequest, options?: RequestOptions): Promise<operations.GetEnvironmentExchangeResponse>;
|
|
16
22
|
createEnvironmentDefinition(request: operations.CreateEnvironmentDefinitionRequest, options?: RequestOptions): Promise<operations.CreateEnvironmentDefinitionResponse>;
|
|
17
23
|
}
|