@usestatemachines/sdk 0.2.0 → 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 +95 -5
- package/agents/SKILL.md +10 -3
- package/agents/index.js +6 -6
- package/agents/llms.txt +8 -2
- package/agents/prompt.md +1 -1
- package/esm/extensions/apps.d.ts +11 -1
- package/esm/extensions/apps.js +16 -0
- package/esm/extensions/client.d.ts +36 -3
- package/esm/extensions/client.js +96 -11
- 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 +4 -1
- package/esm/extensions/running-environment.js +9 -0
- package/esm/extensions/wait.d.ts +10 -3
- package/esm/extensions/wait.js +22 -12
- 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/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 +1 -0
- package/esm/models/error-response.js +1 -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/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 +5 -0
- package/esm/models/operations/index.js +5 -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/update-snapshot.d.ts +37 -0
- package/esm/models/operations/update-snapshot.js +29 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/snapshots.d.ts +9 -0
- package/esm/sdk/snapshots.js +27 -0
- package/openapi.json +1195 -255
- package/package.json +10 -11
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
export function snapshotsGet(client, request, options) {
|
|
16
|
+
return new APIPromise($do(client, request, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, request, options) {
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.GetSnapshotRequest$outboundSchema, value), "Input validation failed");
|
|
20
|
+
if (!parsed.ok) {
|
|
21
|
+
return [parsed, { status: "invalid" }];
|
|
22
|
+
}
|
|
23
|
+
const payload = parsed.value;
|
|
24
|
+
const body = null;
|
|
25
|
+
const pathParams = {
|
|
26
|
+
snapshotId: encodeSimple("snapshotId", payload.snapshotId, {
|
|
27
|
+
explode: false,
|
|
28
|
+
charEncoding: "percent",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const path = pathToFunc("/v1/snapshots/{snapshotId}")(pathParams);
|
|
32
|
+
const headers = new Headers(compactMap({
|
|
33
|
+
Accept: "application/json",
|
|
34
|
+
}));
|
|
35
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
36
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
37
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
38
|
+
const context = {
|
|
39
|
+
options: client._options,
|
|
40
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
41
|
+
operationID: "getSnapshot",
|
|
42
|
+
oAuth2Scopes: null,
|
|
43
|
+
resolvedSecurity: requestSecurity,
|
|
44
|
+
securitySource: client._options.apiKey,
|
|
45
|
+
retryConfig: options?.retries
|
|
46
|
+
|| client._options.retryConfig
|
|
47
|
+
|| {
|
|
48
|
+
strategy: "backoff",
|
|
49
|
+
backoff: {
|
|
50
|
+
initialInterval: 1000,
|
|
51
|
+
maxInterval: 5000,
|
|
52
|
+
exponent: 1.5,
|
|
53
|
+
maxElapsedTime: 600000,
|
|
54
|
+
},
|
|
55
|
+
retryConnectionErrors: true,
|
|
56
|
+
}
|
|
57
|
+
|| { strategy: "none" },
|
|
58
|
+
retryCodes: options?.retryCodes || ["502", "503", "504"],
|
|
59
|
+
};
|
|
60
|
+
const requestRes = client._createRequest(context, {
|
|
61
|
+
security: requestSecurity,
|
|
62
|
+
method: "GET",
|
|
63
|
+
baseURL: options?.serverURL,
|
|
64
|
+
path: path,
|
|
65
|
+
headers: headers,
|
|
66
|
+
body: body,
|
|
67
|
+
userAgent: client._options.userAgent,
|
|
68
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
69
|
+
}, options);
|
|
70
|
+
if (!requestRes.ok) {
|
|
71
|
+
return [requestRes, { status: "invalid" }];
|
|
72
|
+
}
|
|
73
|
+
const req = requestRes.value;
|
|
74
|
+
const doResult = await client._do(req, {
|
|
75
|
+
context,
|
|
76
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
77
|
+
retryConfig: context.retryConfig,
|
|
78
|
+
retryCodes: context.retryCodes,
|
|
79
|
+
});
|
|
80
|
+
if (!doResult.ok) {
|
|
81
|
+
return [doResult, { status: "request-error", request: req }];
|
|
82
|
+
}
|
|
83
|
+
const response = doResult.value;
|
|
84
|
+
const responseFields = {
|
|
85
|
+
HttpMeta: { Response: response, Request: req },
|
|
86
|
+
};
|
|
87
|
+
const [result] = await M.match(M.json(200, operations.GetSnapshotResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorResponse$inboundSchema), M.jsonErr([500, 503], errors.ErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
|
+
if (!result.ok) {
|
|
89
|
+
return [result, { status: "complete", request: req, response }];
|
|
90
|
+
}
|
|
91
|
+
return [result, { status: "complete", request: req, response }];
|
|
92
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StateMachinesCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
export declare function snapshotsList(client: StateMachinesCore, request: operations.ListSnapshotsRequest, options?: RequestOptions): APIPromise<Result<operations.ListSnapshotsResponse, errors.ErrorResponse | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
export function snapshotsList(client, request, options) {
|
|
16
|
+
return new APIPromise($do(client, request, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, request, options) {
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.ListSnapshotsRequest$outboundSchema, value), "Input validation failed");
|
|
20
|
+
if (!parsed.ok) {
|
|
21
|
+
return [parsed, { status: "invalid" }];
|
|
22
|
+
}
|
|
23
|
+
const payload = parsed.value;
|
|
24
|
+
const body = null;
|
|
25
|
+
const pathParams = {
|
|
26
|
+
workspaceId: encodeSimple("workspaceId", payload.workspaceId, {
|
|
27
|
+
explode: false,
|
|
28
|
+
charEncoding: "percent",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const path = pathToFunc("/v1/workspaces/{workspaceId}/snapshots")(pathParams);
|
|
32
|
+
const query = encodeFormQuery({
|
|
33
|
+
"cursor": payload.cursor,
|
|
34
|
+
"limit": payload.limit,
|
|
35
|
+
"sourceEnvironmentId": payload.sourceEnvironmentId,
|
|
36
|
+
});
|
|
37
|
+
const headers = new Headers(compactMap({
|
|
38
|
+
Accept: "application/json",
|
|
39
|
+
}));
|
|
40
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
41
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
42
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
43
|
+
const context = {
|
|
44
|
+
options: client._options,
|
|
45
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
46
|
+
operationID: "listSnapshots",
|
|
47
|
+
oAuth2Scopes: null,
|
|
48
|
+
resolvedSecurity: requestSecurity,
|
|
49
|
+
securitySource: client._options.apiKey,
|
|
50
|
+
retryConfig: options?.retries
|
|
51
|
+
|| client._options.retryConfig
|
|
52
|
+
|| {
|
|
53
|
+
strategy: "backoff",
|
|
54
|
+
backoff: {
|
|
55
|
+
initialInterval: 1000,
|
|
56
|
+
maxInterval: 5000,
|
|
57
|
+
exponent: 1.5,
|
|
58
|
+
maxElapsedTime: 600000,
|
|
59
|
+
},
|
|
60
|
+
retryConnectionErrors: true,
|
|
61
|
+
}
|
|
62
|
+
|| { strategy: "none" },
|
|
63
|
+
retryCodes: options?.retryCodes || ["502", "503", "504"],
|
|
64
|
+
};
|
|
65
|
+
const requestRes = client._createRequest(context, {
|
|
66
|
+
security: requestSecurity,
|
|
67
|
+
method: "GET",
|
|
68
|
+
baseURL: options?.serverURL,
|
|
69
|
+
path: path,
|
|
70
|
+
headers: headers,
|
|
71
|
+
query: query,
|
|
72
|
+
body: body,
|
|
73
|
+
userAgent: client._options.userAgent,
|
|
74
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
75
|
+
}, options);
|
|
76
|
+
if (!requestRes.ok) {
|
|
77
|
+
return [requestRes, { status: "invalid" }];
|
|
78
|
+
}
|
|
79
|
+
const req = requestRes.value;
|
|
80
|
+
const doResult = await client._do(req, {
|
|
81
|
+
context,
|
|
82
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
83
|
+
retryConfig: context.retryConfig,
|
|
84
|
+
retryCodes: context.retryCodes,
|
|
85
|
+
});
|
|
86
|
+
if (!doResult.ok) {
|
|
87
|
+
return [doResult, { status: "request-error", request: req }];
|
|
88
|
+
}
|
|
89
|
+
const response = doResult.value;
|
|
90
|
+
const responseFields = {
|
|
91
|
+
HttpMeta: { Response: response, Request: req },
|
|
92
|
+
};
|
|
93
|
+
const [result] = await M.match(M.json(200, operations.ListSnapshotsResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorResponse$inboundSchema), M.jsonErr([500, 503], errors.ErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
94
|
+
if (!result.ok) {
|
|
95
|
+
return [result, { status: "complete", request: req, response }];
|
|
96
|
+
}
|
|
97
|
+
return [result, { status: "complete", request: req, response }];
|
|
98
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StateMachinesCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
export declare function snapshotsUpdate(client: StateMachinesCore, request: operations.UpdateSnapshotRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateSnapshotResponse, errors.ErrorResponse | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
export function snapshotsUpdate(client, request, options) {
|
|
16
|
+
return new APIPromise($do(client, request, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, request, options) {
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.UpdateSnapshotRequest$outboundSchema, value), "Input validation failed");
|
|
20
|
+
if (!parsed.ok) {
|
|
21
|
+
return [parsed, { status: "invalid" }];
|
|
22
|
+
}
|
|
23
|
+
const payload = parsed.value;
|
|
24
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
25
|
+
const pathParams = {
|
|
26
|
+
snapshotId: encodeSimple("snapshotId", payload.snapshotId, {
|
|
27
|
+
explode: false,
|
|
28
|
+
charEncoding: "percent",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const path = pathToFunc("/v1/snapshots/{snapshotId}")(pathParams);
|
|
32
|
+
const headers = new Headers(compactMap({
|
|
33
|
+
"Content-Type": "application/json",
|
|
34
|
+
Accept: "application/json",
|
|
35
|
+
}));
|
|
36
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
37
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
38
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
39
|
+
const context = {
|
|
40
|
+
options: client._options,
|
|
41
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
42
|
+
operationID: "updateSnapshot",
|
|
43
|
+
oAuth2Scopes: null,
|
|
44
|
+
resolvedSecurity: requestSecurity,
|
|
45
|
+
securitySource: client._options.apiKey,
|
|
46
|
+
retryConfig: options?.retries
|
|
47
|
+
|| client._options.retryConfig
|
|
48
|
+
|| {
|
|
49
|
+
strategy: "backoff",
|
|
50
|
+
backoff: {
|
|
51
|
+
initialInterval: 1000,
|
|
52
|
+
maxInterval: 5000,
|
|
53
|
+
exponent: 1.5,
|
|
54
|
+
maxElapsedTime: 600000,
|
|
55
|
+
},
|
|
56
|
+
retryConnectionErrors: true,
|
|
57
|
+
}
|
|
58
|
+
|| { strategy: "none" },
|
|
59
|
+
retryCodes: options?.retryCodes || ["502", "503", "504"],
|
|
60
|
+
};
|
|
61
|
+
const requestRes = client._createRequest(context, {
|
|
62
|
+
security: requestSecurity,
|
|
63
|
+
method: "PATCH",
|
|
64
|
+
baseURL: options?.serverURL,
|
|
65
|
+
path: path,
|
|
66
|
+
headers: headers,
|
|
67
|
+
body: body,
|
|
68
|
+
userAgent: client._options.userAgent,
|
|
69
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
70
|
+
}, options);
|
|
71
|
+
if (!requestRes.ok) {
|
|
72
|
+
return [requestRes, { status: "invalid" }];
|
|
73
|
+
}
|
|
74
|
+
const req = requestRes.value;
|
|
75
|
+
const doResult = await client._do(req, {
|
|
76
|
+
context,
|
|
77
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
78
|
+
retryConfig: context.retryConfig,
|
|
79
|
+
retryCodes: context.retryCodes,
|
|
80
|
+
});
|
|
81
|
+
if (!doResult.ok) {
|
|
82
|
+
return [doResult, { status: "request-error", request: req }];
|
|
83
|
+
}
|
|
84
|
+
const response = doResult.value;
|
|
85
|
+
const responseFields = {
|
|
86
|
+
HttpMeta: { Response: response, Request: req },
|
|
87
|
+
};
|
|
88
|
+
const [result] = await M.match(M.json(200, operations.UpdateSnapshotResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorResponse$inboundSchema), M.jsonErr([500, 503], errors.ErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
89
|
+
if (!result.ok) {
|
|
90
|
+
return [result, { status: "complete", request: req, response }];
|
|
91
|
+
}
|
|
92
|
+
return [result, { status: "complete", request: req, response }];
|
|
93
|
+
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1.0.0";
|
|
34
|
-
readonly sdkVersion: "0.
|
|
34
|
+
readonly sdkVersion: "0.3.0";
|
|
35
35
|
readonly genVersion: "2.941.0";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.0 2.941.0 1.0.0 @usestatemachines/sdk";
|
|
37
37
|
};
|
package/esm/lib/config.js
CHANGED
|
@@ -24,7 +24,7 @@ export function serverURLFromOptions(options) {
|
|
|
24
24
|
export const SDK_METADATA = {
|
|
25
25
|
language: "typescript",
|
|
26
26
|
openapiDocVersion: "1.0.0",
|
|
27
|
-
sdkVersion: "0.
|
|
27
|
+
sdkVersion: "0.3.0",
|
|
28
28
|
genVersion: "2.941.0",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.3.0 2.941.0 1.0.0 @usestatemachines/sdk",
|
|
30
30
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
|
+
export type AppInstanceSnapshot = {
|
|
5
|
+
appId: string;
|
|
6
|
+
appInstanceKey: string;
|
|
7
|
+
appReleaseId: string;
|
|
8
|
+
capturedAt: Date | null;
|
|
9
|
+
id: string;
|
|
10
|
+
sizeBytes: number | null;
|
|
11
|
+
sourceAppInstanceId: string;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const AppInstanceSnapshot$inboundSchema: z.ZodMiniType<AppInstanceSnapshot, unknown>;
|
|
15
|
+
export declare function appInstanceSnapshotFromJSON(jsonString: string): SafeParseResult<AppInstanceSnapshot, SDKValidationError>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as types from "../types/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const AppInstanceSnapshot$inboundSchema = z.object({
|
|
9
|
+
appId: types.string(),
|
|
10
|
+
appInstanceKey: types.string(),
|
|
11
|
+
appReleaseId: types.string(),
|
|
12
|
+
capturedAt: types.nullable(types.date()),
|
|
13
|
+
id: types.string(),
|
|
14
|
+
sizeBytes: types.nullable(types.number()),
|
|
15
|
+
sourceAppInstanceId: types.string(),
|
|
16
|
+
});
|
|
17
|
+
export function appInstanceSnapshotFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => AppInstanceSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppInstanceSnapshot' from JSON`);
|
|
19
|
+
}
|
|
@@ -5,12 +5,14 @@ export type CreateEnvironmentInputApp = {
|
|
|
5
5
|
key: string;
|
|
6
6
|
};
|
|
7
7
|
export type CreateEnvironmentInput = {
|
|
8
|
-
apps
|
|
8
|
+
apps?: Array<CreateEnvironmentInputApp> | undefined;
|
|
9
9
|
labels?: {
|
|
10
10
|
[k: string]: string;
|
|
11
11
|
} | undefined;
|
|
12
12
|
lifetimeMinutes?: number | undefined;
|
|
13
13
|
name?: string | undefined;
|
|
14
|
+
snapshotAppInstanceKeys?: Array<string> | undefined;
|
|
15
|
+
snapshotId?: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
/** @internal */
|
|
16
18
|
export type CreateEnvironmentInputApp$Outbound = {
|
|
@@ -23,12 +25,14 @@ export declare const CreateEnvironmentInputApp$outboundSchema: z.ZodMiniType<Cre
|
|
|
23
25
|
export declare function createEnvironmentInputAppToJSON(createEnvironmentInputApp: CreateEnvironmentInputApp): string;
|
|
24
26
|
/** @internal */
|
|
25
27
|
export type CreateEnvironmentInput$Outbound = {
|
|
26
|
-
apps
|
|
28
|
+
apps?: Array<CreateEnvironmentInputApp$Outbound> | undefined;
|
|
27
29
|
labels?: {
|
|
28
30
|
[k: string]: string;
|
|
29
31
|
} | undefined;
|
|
30
32
|
lifetimeMinutes?: number | undefined;
|
|
31
33
|
name?: string | undefined;
|
|
34
|
+
snapshotAppInstanceKeys?: Array<string> | undefined;
|
|
35
|
+
snapshotId?: string | undefined;
|
|
32
36
|
};
|
|
33
37
|
/** @internal */
|
|
34
38
|
export declare const CreateEnvironmentInput$outboundSchema: z.ZodMiniType<CreateEnvironmentInput$Outbound, CreateEnvironmentInput>;
|
|
@@ -13,10 +13,12 @@ export function createEnvironmentInputAppToJSON(createEnvironmentInputApp) {
|
|
|
13
13
|
}
|
|
14
14
|
/** @internal */
|
|
15
15
|
export const CreateEnvironmentInput$outboundSchema = z.object({
|
|
16
|
-
apps: z.array(z.lazy(() => CreateEnvironmentInputApp$outboundSchema)),
|
|
16
|
+
apps: z.optional(z.array(z.lazy(() => CreateEnvironmentInputApp$outboundSchema))),
|
|
17
17
|
labels: z.optional(z.record(z.string(), z.string())),
|
|
18
18
|
lifetimeMinutes: z.optional(z.int()),
|
|
19
19
|
name: z.optional(z.string()),
|
|
20
|
+
snapshotAppInstanceKeys: z.optional(z.array(z.string())),
|
|
21
|
+
snapshotId: z.optional(z.string()),
|
|
20
22
|
});
|
|
21
23
|
export function createEnvironmentInputToJSON(createEnvironmentInput) {
|
|
22
24
|
return JSON.stringify(CreateEnvironmentInput$outboundSchema.parse(createEnvironmentInput));
|
|
@@ -36,6 +36,7 @@ export const EnvironmentApp$inboundSchema = z.object({
|
|
|
36
36
|
provider: types.string(),
|
|
37
37
|
readyAt: types.nullable(types.date()),
|
|
38
38
|
region: types.nullable(types.string()),
|
|
39
|
+
sourceAppInstanceSnapshotId: z._default(z.nullable(types.string()), null),
|
|
39
40
|
status: EnvironmentAppStatus$inboundSchema,
|
|
40
41
|
stoppedAt: types.nullable(types.date()),
|
|
41
42
|
});
|
|
@@ -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 { Actor } from "./actor.js";
|
|
5
|
+
import { AppInstanceSnapshot } from "./app-instance-snapshot.js";
|
|
6
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
7
|
+
export declare const Consistency: {
|
|
8
|
+
readonly PerAppInstance: "per-app-instance";
|
|
9
|
+
};
|
|
10
|
+
export type Consistency = OpenEnum<typeof Consistency>;
|
|
11
|
+
export declare const EnvironmentSnapshotStatus: {
|
|
12
|
+
readonly Capturing: "capturing";
|
|
13
|
+
readonly Ready: "ready";
|
|
14
|
+
readonly Failed: "failed";
|
|
15
|
+
};
|
|
16
|
+
export type EnvironmentSnapshotStatus = OpenEnum<typeof EnvironmentSnapshotStatus>;
|
|
17
|
+
export type EnvironmentSnapshot = {
|
|
18
|
+
appInstanceSnapshots: Array<AppInstanceSnapshot>;
|
|
19
|
+
consistency: Consistency;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
createdBy: Actor | null;
|
|
22
|
+
deletedAt: Date | null;
|
|
23
|
+
errorCode: string | null;
|
|
24
|
+
id: string;
|
|
25
|
+
name: string | null;
|
|
26
|
+
readyAt: Date | null;
|
|
27
|
+
sizeBytes: number | null;
|
|
28
|
+
sourceEnvironmentId: string;
|
|
29
|
+
status: EnvironmentSnapshotStatus;
|
|
30
|
+
version: number;
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
};
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const Consistency$inboundSchema: z.ZodMiniType<Consistency, unknown>;
|
|
35
|
+
/** @internal */
|
|
36
|
+
export declare const EnvironmentSnapshotStatus$inboundSchema: z.ZodMiniType<EnvironmentSnapshotStatus, unknown>;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const EnvironmentSnapshot$inboundSchema: z.ZodMiniType<EnvironmentSnapshot, unknown>;
|
|
39
|
+
export declare function environmentSnapshotFromJSON(jsonString: string): SafeParseResult<EnvironmentSnapshot, SDKValidationError>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import * as types from "../types/primitives.js";
|
|
8
|
+
import { Actor$inboundSchema } from "./actor.js";
|
|
9
|
+
import { AppInstanceSnapshot$inboundSchema, } from "./app-instance-snapshot.js";
|
|
10
|
+
export const Consistency = {
|
|
11
|
+
PerAppInstance: "per-app-instance",
|
|
12
|
+
};
|
|
13
|
+
export const EnvironmentSnapshotStatus = {
|
|
14
|
+
Capturing: "capturing",
|
|
15
|
+
Ready: "ready",
|
|
16
|
+
Failed: "failed",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Consistency$inboundSchema = openEnums.inboundSchema(Consistency);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const EnvironmentSnapshotStatus$inboundSchema = openEnums.inboundSchema(EnvironmentSnapshotStatus);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const EnvironmentSnapshot$inboundSchema = z.object({
|
|
24
|
+
appInstanceSnapshots: z.array(AppInstanceSnapshot$inboundSchema),
|
|
25
|
+
consistency: Consistency$inboundSchema,
|
|
26
|
+
createdAt: types.date(),
|
|
27
|
+
createdBy: types.nullable(Actor$inboundSchema),
|
|
28
|
+
deletedAt: types.nullable(types.date()),
|
|
29
|
+
errorCode: types.nullable(types.string()),
|
|
30
|
+
id: types.string(),
|
|
31
|
+
name: types.nullable(types.string()),
|
|
32
|
+
readyAt: types.nullable(types.date()),
|
|
33
|
+
sizeBytes: types.nullable(types.number()),
|
|
34
|
+
sourceEnvironmentId: types.string(),
|
|
35
|
+
status: EnvironmentSnapshotStatus$inboundSchema,
|
|
36
|
+
version: types.number(),
|
|
37
|
+
workspaceId: types.string(),
|
|
38
|
+
});
|
|
39
|
+
export function environmentSnapshotFromJSON(jsonString) {
|
|
40
|
+
return safeParse(jsonString, (x) => EnvironmentSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentSnapshot' from JSON`);
|
|
41
|
+
}
|
|
@@ -36,6 +36,7 @@ export const Environment$inboundSchema = z
|
|
|
36
36
|
labels: z.record(z.string(), types.string()),
|
|
37
37
|
lifetimeMinutes: types.number(),
|
|
38
38
|
name: types.nullable(types.string()),
|
|
39
|
+
sourceEnvironmentSnapshotId: z._default(z.nullable(types.string()), null),
|
|
39
40
|
startedAt: types.nullable(types.date()),
|
|
40
41
|
status: EnvironmentStatus$inboundSchema,
|
|
41
42
|
stopReason: types.nullable(StopReason$inboundSchema),
|
|
@@ -28,6 +28,7 @@ export declare const Code: {
|
|
|
28
28
|
readonly RequestCapacityReached: "request-capacity-reached";
|
|
29
29
|
readonly RequestTimeout: "request-timeout";
|
|
30
30
|
readonly ServiceUnavailable: "service-unavailable";
|
|
31
|
+
readonly SnapshotLimit: "snapshot-limit";
|
|
31
32
|
readonly Unauthorized: "unauthorized";
|
|
32
33
|
readonly VersionConflict: "version-conflict";
|
|
33
34
|
readonly WorkspaceArchived: "workspace-archived";
|
|
@@ -31,6 +31,7 @@ export const Code = {
|
|
|
31
31
|
RequestCapacityReached: "request-capacity-reached",
|
|
32
32
|
RequestTimeout: "request-timeout",
|
|
33
33
|
ServiceUnavailable: "service-unavailable",
|
|
34
|
+
SnapshotLimit: "snapshot-limit",
|
|
34
35
|
Unauthorized: "unauthorized",
|
|
35
36
|
VersionConflict: "version-conflict",
|
|
36
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>;
|