@usestatemachines/sdk 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -75
- package/agents/SKILL.md +33 -46
- package/agents/index.js +7 -7
- package/agents/llms.txt +25 -40
- package/agents/prompt.md +11 -34
- package/esm/extensions/apps.d.ts +18 -0
- package/esm/extensions/apps.js +39 -0
- package/esm/extensions/client.d.ts +66 -3
- package/esm/extensions/client.js +236 -35
- package/esm/extensions/errors.d.ts +50 -6
- package/esm/extensions/errors.js +37 -3
- package/esm/extensions/index.d.ts +5 -3
- package/esm/extensions/index.js +2 -1
- package/esm/extensions/running-environment.d.ts +32 -0
- package/esm/extensions/running-environment.js +44 -0
- package/esm/extensions/signal.d.ts +1 -2
- package/esm/extensions/signal.js +9 -4
- package/esm/extensions/wait.d.ts +11 -3
- package/esm/extensions/wait.js +23 -13
- package/esm/funcs/create-environment-definition.d.ts +11 -0
- package/esm/funcs/create-environment-definition.js +94 -0
- package/esm/funcs/environments-list.js +1 -0
- package/esm/funcs/snapshots-capture.d.ts +11 -0
- package/esm/funcs/snapshots-capture.js +94 -0
- package/esm/funcs/snapshots-delete.d.ts +11 -0
- package/esm/funcs/snapshots-delete.js +92 -0
- package/esm/funcs/snapshots-get.d.ts +11 -0
- package/esm/funcs/snapshots-get.js +92 -0
- package/esm/funcs/snapshots-list.d.ts +11 -0
- package/esm/funcs/snapshots-list.js +98 -0
- package/esm/funcs/snapshots-update.d.ts +11 -0
- package/esm/funcs/snapshots-update.js +93 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/app-instance-snapshot.d.ts +15 -0
- package/esm/models/app-instance-snapshot.js +19 -0
- package/esm/models/connection-secret.d.ts +16 -0
- package/esm/models/connection-secret.js +13 -0
- package/esm/models/connection.d.ts +14 -0
- package/esm/models/connection.js +14 -0
- package/esm/models/create-environment-input.d.ts +6 -2
- package/esm/models/create-environment-input.js +3 -1
- package/esm/models/environment-app.d.ts +1 -0
- package/esm/models/environment-app.js +1 -0
- package/esm/models/environment-snapshot.d.ts +39 -0
- package/esm/models/environment-snapshot.js +41 -0
- package/esm/models/environment.d.ts +1 -0
- package/esm/models/environment.js +1 -0
- package/esm/models/error-response.d.ts +5 -0
- package/esm/models/error-response.js +5 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/operations/capture-snapshot.d.ts +41 -0
- package/esm/models/operations/capture-snapshot.js +36 -0
- package/esm/models/operations/create-environment-definition.d.ts +143 -0
- package/esm/models/operations/create-environment-definition.js +90 -0
- package/esm/models/operations/delete-snapshot.d.ts +23 -0
- package/esm/models/operations/delete-snapshot.js +20 -0
- package/esm/models/operations/get-snapshot.d.ts +23 -0
- package/esm/models/operations/get-snapshot.js +20 -0
- package/esm/models/operations/index.d.ts +6 -0
- package/esm/models/operations/index.js +6 -0
- package/esm/models/operations/list-environments.d.ts +2 -0
- package/esm/models/operations/list-environments.js +1 -0
- package/esm/models/operations/list-snapshots.d.ts +30 -0
- package/esm/models/operations/list-snapshots.js +25 -0
- package/esm/models/operations/reveal-connection.d.ts +26 -4
- package/esm/models/operations/reveal-connection.js +28 -2
- package/esm/models/operations/update-snapshot.d.ts +37 -0
- package/esm/models/operations/update-snapshot.js +29 -0
- package/esm/sdk/sdk.d.ts +6 -1
- package/esm/sdk/sdk.js +10 -0
- package/esm/sdk/snapshots.d.ts +9 -0
- package/esm/sdk/snapshots.js +27 -0
- package/openapi.json +1471 -144
- package/package.json +10 -11
|
@@ -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
|
+
}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
|
+
export type Native = {
|
|
5
|
+
authentication: string;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
credentials: {
|
|
8
|
+
[k: string]: string;
|
|
9
|
+
};
|
|
10
|
+
key: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
4
15
|
export type ConnectionSecret = {
|
|
5
16
|
actorId: string;
|
|
6
17
|
actorToken: string;
|
|
7
18
|
appKey: string;
|
|
19
|
+
connectionKey: string | null;
|
|
8
20
|
environmentId: string;
|
|
9
21
|
environmentToken: string;
|
|
10
22
|
expiresAt: Date;
|
|
23
|
+
native?: Native | undefined;
|
|
11
24
|
};
|
|
12
25
|
/** @internal */
|
|
26
|
+
export declare const Native$inboundSchema: z.ZodMiniType<Native, unknown>;
|
|
27
|
+
export declare function nativeFromJSON(jsonString: string): SafeParseResult<Native, SDKValidationError>;
|
|
28
|
+
/** @internal */
|
|
13
29
|
export declare const ConnectionSecret$inboundSchema: z.ZodMiniType<ConnectionSecret, unknown>;
|
|
14
30
|
export declare function connectionSecretFromJSON(jsonString: string): SafeParseResult<ConnectionSecret, SDKValidationError>;
|
|
@@ -5,13 +5,26 @@ import * as z from "zod/v4-mini";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
import * as types from "../types/primitives.js";
|
|
7
7
|
/** @internal */
|
|
8
|
+
export const Native$inboundSchema = z.object({
|
|
9
|
+
authentication: types.string(),
|
|
10
|
+
baseUrl: types.string(),
|
|
11
|
+
credentials: z.record(z.string(), types.string()),
|
|
12
|
+
key: types.string(),
|
|
13
|
+
parameters: z.record(z.string(), types.string()),
|
|
14
|
+
});
|
|
15
|
+
export function nativeFromJSON(jsonString) {
|
|
16
|
+
return safeParse(jsonString, (x) => Native$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Native' from JSON`);
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
8
19
|
export const ConnectionSecret$inboundSchema = z.object({
|
|
9
20
|
actorId: types.string(),
|
|
10
21
|
actorToken: types.string(),
|
|
11
22
|
appKey: types.string(),
|
|
23
|
+
connectionKey: types.nullable(types.string()),
|
|
12
24
|
environmentId: types.string(),
|
|
13
25
|
environmentToken: types.string(),
|
|
14
26
|
expiresAt: types.date(),
|
|
27
|
+
native: types.optional(z.lazy(() => Native$inboundSchema)),
|
|
15
28
|
});
|
|
16
29
|
export function connectionSecretFromJSON(jsonString) {
|
|
17
30
|
return safeParse(jsonString, (x) => ConnectionSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectionSecret' from JSON`);
|
|
@@ -4,6 +4,15 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { ApiProfile } from "./api-profile.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
6
6
|
import { ReleaseActor } from "./release-actor.js";
|
|
7
|
+
export type Connection1 = {
|
|
8
|
+
actorId: string;
|
|
9
|
+
authentication: string;
|
|
10
|
+
key: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
14
|
+
secrets: Array<string>;
|
|
15
|
+
};
|
|
7
16
|
export declare const ConnectionStatus: {
|
|
8
17
|
readonly Starting: "starting";
|
|
9
18
|
readonly Ready: "ready";
|
|
@@ -15,11 +24,16 @@ export type Connection = {
|
|
|
15
24
|
apis: Array<ApiProfile>;
|
|
16
25
|
appKey: string;
|
|
17
26
|
baseUrl: string | null;
|
|
27
|
+
connections: Array<Connection1>;
|
|
28
|
+
defaultConnection: string | null;
|
|
18
29
|
environmentId: string;
|
|
19
30
|
expiresAt: Date | null;
|
|
20
31
|
status: ConnectionStatus;
|
|
21
32
|
};
|
|
22
33
|
/** @internal */
|
|
34
|
+
export declare const Connection1$inboundSchema: z.ZodMiniType<Connection1, unknown>;
|
|
35
|
+
export declare function connection1FromJSON(jsonString: string): SafeParseResult<Connection1, SDKValidationError>;
|
|
36
|
+
/** @internal */
|
|
23
37
|
export declare const ConnectionStatus$inboundSchema: z.ZodMiniType<ConnectionStatus, unknown>;
|
|
24
38
|
/** @internal */
|
|
25
39
|
export declare const Connection$inboundSchema: z.ZodMiniType<Connection, unknown>;
|
package/esm/models/connection.js
CHANGED
|
@@ -13,6 +13,18 @@ export const ConnectionStatus = {
|
|
|
13
13
|
Unavailable: "unavailable",
|
|
14
14
|
};
|
|
15
15
|
/** @internal */
|
|
16
|
+
export const Connection1$inboundSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
actorId: types.string(),
|
|
19
|
+
authentication: types.string(),
|
|
20
|
+
key: types.string(),
|
|
21
|
+
parameters: z.record(z.string(), types.string()),
|
|
22
|
+
secrets: z.array(types.string()),
|
|
23
|
+
});
|
|
24
|
+
export function connection1FromJSON(jsonString) {
|
|
25
|
+
return safeParse(jsonString, (x) => Connection1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connection1' from JSON`);
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
16
28
|
export const ConnectionStatus$inboundSchema = openEnums.inboundSchema(ConnectionStatus);
|
|
17
29
|
/** @internal */
|
|
18
30
|
export const Connection$inboundSchema = z
|
|
@@ -21,6 +33,8 @@ export const Connection$inboundSchema = z
|
|
|
21
33
|
apis: z.array(ApiProfile$inboundSchema),
|
|
22
34
|
appKey: types.string(),
|
|
23
35
|
baseUrl: types.nullable(types.string()),
|
|
36
|
+
connections: z.array(z.lazy(() => Connection1$inboundSchema)),
|
|
37
|
+
defaultConnection: types.nullable(types.string()),
|
|
24
38
|
environmentId: types.string(),
|
|
25
39
|
expiresAt: types.nullable(types.date()),
|
|
26
40
|
status: ConnectionStatus$inboundSchema,
|
|
@@ -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),
|