@usestatemachines/sdk 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -521
- package/agents/SKILL.md +38 -47
- package/agents/index.js +7 -7
- package/agents/llms.txt +50 -46
- package/agents/prompt.md +11 -11
- package/esm/extensions/client.d.ts +104 -127
- package/esm/extensions/client.js +162 -322
- package/esm/extensions/credentials.d.ts +13 -0
- package/esm/extensions/credentials.js +73 -0
- package/esm/extensions/environment.d.ts +25 -0
- package/esm/extensions/environment.js +1 -0
- package/esm/extensions/errors.d.ts +42 -75
- package/esm/extensions/errors.js +125 -110
- package/esm/extensions/index.d.ts +6 -11
- package/esm/extensions/index.js +2 -7
- package/esm/extensions/wait.d.ts +17 -18
- package/esm/extensions/wait.js +60 -56
- package/esm/extensions/yaml.d.ts +6 -0
- package/esm/extensions/yaml.js +137 -0
- package/esm/funcs/{catalog-release.d.ts → apps-list.d.ts} +1 -1
- package/esm/funcs/{environments-get-connection.js → apps-list.js} +11 -16
- package/esm/funcs/{credential-get.d.ts → apps-versions.d.ts} +1 -1
- package/esm/funcs/{workspaces-events.js → apps-versions.js} +6 -7
- package/esm/funcs/{environments-get-connection.d.ts → audit-events-list.d.ts} +1 -1
- package/esm/funcs/audit-events-list.js +93 -0
- package/esm/funcs/{workspaces-events.d.ts → environments-connect.d.ts} +1 -1
- package/esm/funcs/{environments-reveal.js → environments-connect.js} +7 -6
- package/esm/funcs/environments-create.d.ts +2 -1
- package/esm/funcs/environments-create.js +5 -10
- package/esm/funcs/{environments-events.d.ts → environments-delete.d.ts} +1 -1
- package/esm/funcs/{environments-stop.js → environments-delete.js} +7 -6
- package/esm/funcs/environments-get.d.ts +2 -1
- package/esm/funcs/environments-get.js +2 -1
- package/esm/funcs/environments-list.d.ts +1 -1
- package/esm/funcs/environments-list.js +11 -16
- package/esm/funcs/environments-pause.d.ts +12 -0
- package/esm/funcs/{environments-suspend.js → environments-pause.js} +6 -5
- package/esm/funcs/environments-resume.d.ts +2 -1
- package/esm/funcs/environments-resume.js +2 -1
- package/esm/funcs/environments-update.d.ts +12 -0
- package/esm/funcs/{environments-events.js → environments-update.js} +9 -13
- package/esm/funcs/me.d.ts +11 -0
- package/esm/funcs/{catalog-get.js → me.js} +5 -5
- package/esm/funcs/{catalog-get.d.ts → requests-body.d.ts} +1 -1
- package/esm/funcs/{environments-get-request-payload.js → requests-body.js} +5 -9
- package/esm/funcs/{environments-get-request-stats.d.ts → requests-get.d.ts} +2 -1
- package/esm/funcs/{catalog-release.js → requests-get.js} +7 -6
- package/esm/funcs/{environments-stop.d.ts → requests-list.d.ts} +1 -1
- package/esm/funcs/{environments-list-requests.js → requests-list.js} +9 -14
- package/esm/funcs/requests-stats.d.ts +12 -0
- package/esm/funcs/{environments-get-request-stats.js → requests-stats.js} +10 -14
- package/esm/funcs/snapshots-create.d.ts +12 -0
- package/esm/funcs/{snapshots-capture.js → snapshots-create.js} +6 -11
- package/esm/funcs/snapshots-delete.d.ts +2 -1
- package/esm/funcs/snapshots-delete.js +2 -1
- package/esm/funcs/snapshots-get.d.ts +2 -1
- package/esm/funcs/snapshots-get.js +2 -1
- package/esm/funcs/snapshots-list.d.ts +1 -1
- package/esm/funcs/snapshots-list.js +9 -13
- package/esm/funcs/snapshots-update.d.ts +2 -1
- package/esm/funcs/snapshots-update.js +2 -1
- package/esm/funcs/workspaces-get.d.ts +2 -1
- package/esm/funcs/workspaces-get.js +2 -1
- package/esm/funcs/workspaces-list.d.ts +1 -1
- package/esm/funcs/workspaces-list.js +3 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/actor.d.ts +2 -3
- package/esm/models/actor.js +2 -3
- package/esm/models/{api-profile.d.ts → api.d.ts} +4 -4
- package/esm/models/{api-profile.js → api.js} +4 -5
- package/esm/models/app.d.ts +9 -1
- package/esm/models/app.js +7 -1
- package/esm/models/{event.d.ts → audit-event.d.ts} +6 -6
- package/esm/models/{event.js → audit-event.js} +7 -6
- package/esm/models/{request-payload-preview.d.ts → body-preview.d.ts} +4 -4
- package/esm/models/{request-payload-preview.js → body-preview.js} +5 -4
- package/esm/models/create-environment.d.ts +51 -0
- package/esm/models/create-environment.js +35 -0
- package/esm/models/credentials.d.ts +31 -0
- package/esm/models/credentials.js +31 -0
- package/esm/models/environment-failure.d.ts +22 -0
- package/esm/models/environment-failure.js +25 -0
- package/esm/models/environment-status.d.ts +14 -0
- package/esm/models/environment-status.js +15 -0
- package/esm/models/environment.d.ts +27 -27
- package/esm/models/environment.js +28 -27
- package/esm/models/error.d.ts +38 -0
- package/esm/models/error.js +39 -0
- package/esm/models/errors/{error-response.d.ts → error.d.ts} +5 -5
- package/esm/models/errors/{error-response.js → error.js} +4 -4
- package/esm/models/errors/index.d.ts +1 -1
- package/esm/models/errors/index.js +1 -1
- package/esm/models/index.d.ts +17 -20
- package/esm/models/index.js +17 -20
- package/esm/models/me.d.ts +66 -0
- package/esm/models/me.js +75 -0
- package/esm/models/operations/create-credentials.d.ts +25 -0
- package/esm/models/operations/create-credentials.js +20 -0
- package/esm/models/operations/create-environment.d.ts +14 -0
- package/esm/models/operations/create-environment.js +18 -0
- package/esm/models/operations/create-snapshot.d.ts +25 -0
- package/esm/models/operations/create-snapshot.js +25 -0
- package/esm/models/operations/delete-environment.d.ts +13 -0
- package/esm/models/operations/delete-environment.js +17 -0
- package/esm/models/operations/delete-snapshot.d.ts +0 -12
- package/esm/models/operations/delete-snapshot.js +0 -9
- package/esm/models/operations/get-environment.d.ts +0 -12
- package/esm/models/operations/get-environment.js +0 -9
- package/esm/models/operations/get-request-body.d.ts +21 -0
- package/esm/models/operations/{get-environment-request-payload.js → get-request-body.js} +3 -4
- package/esm/models/operations/get-request-stats.d.ts +51 -0
- package/esm/models/operations/get-request-stats.js +40 -0
- package/esm/models/operations/get-request.d.ts +11 -0
- package/esm/models/operations/get-request.js +11 -0
- package/esm/models/operations/get-snapshot.d.ts +0 -12
- package/esm/models/operations/get-snapshot.js +0 -9
- package/esm/models/operations/get-workspace.d.ts +0 -12
- package/esm/models/operations/get-workspace.js +0 -9
- package/esm/models/operations/index.d.ts +13 -16
- package/esm/models/operations/index.js +13 -16
- package/esm/models/operations/list-apps.d.ts +26 -0
- package/esm/models/operations/list-apps.js +23 -0
- package/esm/models/operations/list-audit-events.d.ts +30 -0
- package/esm/models/operations/list-audit-events.js +25 -0
- package/esm/models/operations/list-environments.d.ts +6 -21
- package/esm/models/operations/list-environments.js +3 -16
- package/esm/models/operations/list-requests.d.ts +68 -0
- package/esm/models/operations/list-requests.js +53 -0
- package/esm/models/operations/list-snapshots.d.ts +8 -6
- package/esm/models/operations/list-snapshots.js +4 -3
- package/esm/models/operations/list-versions.d.ts +28 -0
- package/esm/models/operations/list-versions.js +24 -0
- package/esm/models/operations/list-workspaces.d.ts +8 -4
- package/esm/models/operations/list-workspaces.js +7 -4
- package/esm/models/operations/pause-environment.d.ts +13 -0
- package/esm/models/operations/pause-environment.js +17 -0
- package/esm/models/operations/resume-environment.d.ts +0 -12
- package/esm/models/operations/resume-environment.js +0 -9
- package/esm/models/operations/update-environment.d.ts +29 -0
- package/esm/models/operations/update-environment.js +20 -0
- package/esm/models/operations/update-snapshot.d.ts +0 -14
- package/esm/models/operations/update-snapshot.js +0 -10
- package/esm/models/permission.d.ts +17 -0
- package/esm/models/permission.js +18 -0
- package/esm/models/principal.d.ts +20 -0
- package/esm/models/principal.js +24 -0
- package/esm/models/request-detail.d.ts +39 -0
- package/esm/models/request-detail.js +38 -0
- package/esm/models/{environment-request-stats.d.ts → request-stats.d.ts} +3 -3
- package/esm/models/{environment-request-stats.js → request-stats.js} +3 -3
- package/esm/models/request.d.ts +30 -0
- package/esm/models/{environment-request.js → request.js} +11 -11
- package/esm/models/snapshot-status.d.ts +13 -0
- package/esm/models/snapshot-status.js +14 -0
- package/esm/models/snapshot.d.ts +47 -0
- package/esm/models/snapshot.js +54 -0
- package/esm/models/version.d.ts +27 -0
- package/esm/models/version.js +31 -0
- package/esm/models/workspace.d.ts +2 -4
- package/esm/models/workspace.js +2 -4
- package/esm/sdk/apps.d.ts +6 -0
- package/esm/sdk/apps.js +15 -0
- package/esm/sdk/audit-events.d.ts +5 -0
- package/esm/sdk/audit-events.js +11 -0
- package/esm/sdk/environments.d.ts +8 -13
- package/esm/sdk/environments.js +18 -38
- package/esm/sdk/requests.d.ts +9 -0
- package/esm/sdk/requests.js +23 -0
- package/esm/sdk/sdk.d.ts +11 -8
- package/esm/sdk/sdk.js +16 -11
- package/esm/sdk/snapshots.d.ts +6 -5
- package/esm/sdk/snapshots.js +7 -7
- package/esm/sdk/workspaces.d.ts +1 -2
- package/esm/sdk/workspaces.js +0 -4
- package/openapi.json +1697 -2507
- package/package.json +15 -13
- package/esm/extensions/apps.d.ts +0 -18
- package/esm/extensions/apps.js +0 -39
- package/esm/extensions/connection.d.ts +0 -42
- package/esm/extensions/connection.js +0 -133
- package/esm/extensions/running-environment.d.ts +0 -46
- package/esm/extensions/running-environment.js +0 -66
- package/esm/funcs/create-environment-definition.d.ts +0 -11
- package/esm/funcs/create-environment-definition.js +0 -94
- package/esm/funcs/credential-get.js +0 -76
- package/esm/funcs/environments-get-request-payload.d.ts +0 -11
- package/esm/funcs/environments-get-request.d.ts +0 -11
- package/esm/funcs/environments-get-request.js +0 -96
- package/esm/funcs/environments-list-requests.d.ts +0 -11
- package/esm/funcs/environments-reveal.d.ts +0 -11
- package/esm/funcs/environments-suspend.d.ts +0 -11
- package/esm/funcs/snapshots-capture.d.ts +0 -11
- package/esm/models/app-instance-snapshot.d.ts +0 -15
- package/esm/models/app-instance-snapshot.js +0 -19
- package/esm/models/catalog.d.ts +0 -12
- package/esm/models/catalog.js +0 -15
- package/esm/models/connection-secret.d.ts +0 -30
- package/esm/models/connection-secret.js +0 -31
- package/esm/models/connection.d.ts +0 -40
- package/esm/models/connection.js +0 -44
- package/esm/models/create-environment-input.d.ts +0 -39
- package/esm/models/create-environment-input.js +0 -25
- package/esm/models/credential-kind.d.ts +0 -9
- package/esm/models/credential-kind.js +0 -10
- package/esm/models/credential.d.ts +0 -48
- package/esm/models/credential.js +0 -44
- package/esm/models/environment-app.d.ts +0 -45
- package/esm/models/environment-app.js +0 -47
- package/esm/models/environment-lifetime.d.ts +0 -10
- package/esm/models/environment-lifetime.js +0 -14
- package/esm/models/environment-request-detail.d.ts +0 -40
- package/esm/models/environment-request-detail.js +0 -39
- package/esm/models/environment-request.d.ts +0 -31
- package/esm/models/environment-snapshot.d.ts +0 -40
- package/esm/models/environment-snapshot.js +0 -42
- package/esm/models/error-response.d.ts +0 -57
- package/esm/models/error-response.js +0 -59
- package/esm/models/event-page.d.ts +0 -11
- package/esm/models/event-page.js +0 -16
- package/esm/models/operations/capture-snapshot.d.ts +0 -41
- package/esm/models/operations/capture-snapshot.js +0 -36
- package/esm/models/operations/create-environment-definition.d.ts +0 -153
- package/esm/models/operations/create-environment-definition.js +0 -93
- package/esm/models/operations/create-environments.d.ts +0 -27
- package/esm/models/operations/create-environments.js +0 -27
- package/esm/models/operations/get-catalog.d.ts +0 -13
- package/esm/models/operations/get-catalog.js +0 -13
- package/esm/models/operations/get-connection.d.ts +0 -25
- package/esm/models/operations/get-connection.js +0 -21
- package/esm/models/operations/get-credential.d.ts +0 -13
- package/esm/models/operations/get-credential.js +0 -13
- package/esm/models/operations/get-environment-request-payload.d.ts +0 -23
- package/esm/models/operations/get-environment-request-stats.d.ts +0 -70
- package/esm/models/operations/get-environment-request-stats.js +0 -55
- package/esm/models/operations/get-environment-request.d.ts +0 -25
- package/esm/models/operations/get-environment-request.js +0 -21
- package/esm/models/operations/get-release.d.ts +0 -23
- package/esm/models/operations/get-release.js +0 -20
- package/esm/models/operations/list-environment-events.d.ts +0 -15
- package/esm/models/operations/list-environment-events.js +0 -13
- package/esm/models/operations/list-environment-requests.d.ts +0 -75
- package/esm/models/operations/list-environment-requests.js +0 -59
- package/esm/models/operations/list-workspace-events.d.ts +0 -15
- package/esm/models/operations/list-workspace-events.js +0 -13
- package/esm/models/operations/reveal-connection.d.ts +0 -59
- package/esm/models/operations/reveal-connection.js +0 -55
- package/esm/models/operations/stop-environment.d.ts +0 -25
- package/esm/models/operations/stop-environment.js +0 -26
- package/esm/models/operations/suspend-environment.d.ts +0 -25
- package/esm/models/operations/suspend-environment.js +0 -26
- package/esm/models/release-actor.d.ts +0 -11
- package/esm/models/release-actor.js +0 -15
- package/esm/models/release.d.ts +0 -37
- package/esm/models/release.js +0 -39
- package/esm/sdk/catalog.d.ts +0 -6
- package/esm/sdk/catalog.js +0 -15
- package/esm/sdk/credential.d.ts +0 -5
- package/esm/sdk/credential.js +0 -11
|
@@ -0,0 +1,12 @@
|
|
|
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 models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
export declare function requestsStats(client: StateMachinesCore, request: operations.GetRequestStatsRequest, options?: RequestOptions): APIPromise<Result<models.RequestStats, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
|
-
import { encodeFormQuery
|
|
5
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
6
|
import { matchStatusCode } from "../lib/http.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -10,31 +10,27 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
|
-
export function
|
|
16
|
+
export function requestsStats(client, request, options) {
|
|
16
17
|
return new APIPromise($do(client, request, options));
|
|
17
18
|
}
|
|
18
19
|
async function $do(client, request, options) {
|
|
19
|
-
const parsed = safeParse(request, (value) => z.parse(operations.
|
|
20
|
+
const parsed = safeParse(request, (value) => z.parse(operations.GetRequestStatsRequest$outboundSchema, value), "Input validation failed");
|
|
20
21
|
if (!parsed.ok) {
|
|
21
22
|
return [parsed, { status: "invalid" }];
|
|
22
23
|
}
|
|
23
24
|
const payload = parsed.value;
|
|
24
25
|
const body = null;
|
|
25
|
-
const
|
|
26
|
-
environmentId: encodeSimple("environmentId", payload.environmentId, {
|
|
27
|
-
explode: false,
|
|
28
|
-
charEncoding: "percent",
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
const path = pathToFunc("/v1/environments/{environmentId}/requests/stats")(pathParams);
|
|
26
|
+
const path = pathToFunc("/v1/requests/stats")();
|
|
32
27
|
const query = encodeFormQuery({
|
|
33
|
-
"
|
|
28
|
+
"app": payload.app,
|
|
29
|
+
"environmentId": payload.environmentId,
|
|
34
30
|
"from": payload.from,
|
|
35
31
|
"method": payload.method,
|
|
32
|
+
"responseStatus": payload.responseStatus,
|
|
36
33
|
"search": payload.search,
|
|
37
|
-
"status": payload.status,
|
|
38
34
|
"statusClass": payload.statusClass,
|
|
39
35
|
"to": payload.to,
|
|
40
36
|
"writesOnly": payload.writesOnly,
|
|
@@ -48,7 +44,7 @@ async function $do(client, request, options) {
|
|
|
48
44
|
const context = {
|
|
49
45
|
options: client._options,
|
|
50
46
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
51
|
-
operationID: "
|
|
47
|
+
operationID: "getRequestStats",
|
|
52
48
|
oAuth2Scopes: null,
|
|
53
49
|
resolvedSecurity: requestSecurity,
|
|
54
50
|
securitySource: client._options.apiKey,
|
|
@@ -95,7 +91,7 @@ async function $do(client, request, options) {
|
|
|
95
91
|
const responseFields = {
|
|
96
92
|
HttpMeta: { Response: response, Request: req },
|
|
97
93
|
};
|
|
98
|
-
const [result] = await M.match(M.json(200,
|
|
94
|
+
const [result] = await M.match(M.json(200, models.RequestStats$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
99
95
|
if (!result.ok) {
|
|
100
96
|
return [result, { status: "complete", request: req, response }];
|
|
101
97
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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 models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
export declare function snapshotsCreate(client: StateMachinesCore, request: operations.CreateSnapshotRequest, options?: RequestOptions): APIPromise<Result<models.Snapshot, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -10,25 +10,20 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
|
-
export function
|
|
16
|
+
export function snapshotsCreate(client, request, options) {
|
|
16
17
|
return new APIPromise($do(client, request, options));
|
|
17
18
|
}
|
|
18
19
|
async function $do(client, request, options) {
|
|
19
|
-
const parsed = safeParse(request, (value) => z.parse(operations.
|
|
20
|
+
const parsed = safeParse(request, (value) => z.parse(operations.CreateSnapshotRequest$outboundSchema, value), "Input validation failed");
|
|
20
21
|
if (!parsed.ok) {
|
|
21
22
|
return [parsed, { status: "invalid" }];
|
|
22
23
|
}
|
|
23
24
|
const payload = parsed.value;
|
|
24
25
|
const body = encodeJSON("body", payload.body, { explode: true });
|
|
25
|
-
const
|
|
26
|
-
workspaceId: encodeSimple("workspaceId", payload.workspaceId, {
|
|
27
|
-
explode: false,
|
|
28
|
-
charEncoding: "percent",
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
const path = pathToFunc("/v1/workspaces/{workspaceId}/snapshots")(pathParams);
|
|
26
|
+
const path = pathToFunc("/v1/snapshots")();
|
|
32
27
|
const headers = new Headers(compactMap({
|
|
33
28
|
"Content-Type": "application/json",
|
|
34
29
|
Accept: "application/json",
|
|
@@ -40,7 +35,7 @@ async function $do(client, request, options) {
|
|
|
40
35
|
const context = {
|
|
41
36
|
options: client._options,
|
|
42
37
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
43
|
-
operationID: "
|
|
38
|
+
operationID: "createSnapshot",
|
|
44
39
|
oAuth2Scopes: null,
|
|
45
40
|
resolvedSecurity: requestSecurity,
|
|
46
41
|
securitySource: client._options.apiKey,
|
|
@@ -86,7 +81,7 @@ async function $do(client, request, options) {
|
|
|
86
81
|
const responseFields = {
|
|
87
82
|
HttpMeta: { Response: response, Request: req },
|
|
88
83
|
};
|
|
89
|
-
const [result] = await M.match(M.json(202,
|
|
84
|
+
const [result] = await M.match(M.json([200, 202], models.Snapshot$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
90
85
|
if (!result.ok) {
|
|
91
86
|
return [result, { status: "complete", request: req, response }];
|
|
92
87
|
}
|
|
@@ -5,7 +5,8 @@ import * as errors from "../models/errors/index.js";
|
|
|
5
5
|
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
6
|
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
7
|
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
8
9
|
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function snapshotsDelete(client: StateMachinesCore, request: operations.DeleteSnapshotRequest, options?: RequestOptions): APIPromise<Result<
|
|
12
|
+
export declare function snapshotsDelete(client: StateMachinesCore, request: operations.DeleteSnapshotRequest, options?: RequestOptions): APIPromise<Result<models.Snapshot, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -10,6 +10,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
16
|
export function snapshotsDelete(client, request, options) {
|
|
@@ -84,7 +85,7 @@ async function $do(client, request, options) {
|
|
|
84
85
|
const responseFields = {
|
|
85
86
|
HttpMeta: { Response: response, Request: req },
|
|
86
87
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200,
|
|
88
|
+
const [result] = await M.match(M.json(200, models.Snapshot$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
89
|
if (!result.ok) {
|
|
89
90
|
return [result, { status: "complete", request: req, response }];
|
|
90
91
|
}
|
|
@@ -5,7 +5,8 @@ import * as errors from "../models/errors/index.js";
|
|
|
5
5
|
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
6
|
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
7
|
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
8
9
|
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function snapshotsGet(client: StateMachinesCore, request: operations.GetSnapshotRequest, options?: RequestOptions): APIPromise<Result<
|
|
12
|
+
export declare function snapshotsGet(client: StateMachinesCore, request: operations.GetSnapshotRequest, options?: RequestOptions): APIPromise<Result<models.Snapshot, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -10,6 +10,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
16
|
export function snapshotsGet(client, request, options) {
|
|
@@ -84,7 +85,7 @@ async function $do(client, request, options) {
|
|
|
84
85
|
const responseFields = {
|
|
85
86
|
HttpMeta: { Response: response, Request: req },
|
|
86
87
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200,
|
|
88
|
+
const [result] = await M.match(M.json(200, models.Snapshot$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
89
|
if (!result.ok) {
|
|
89
90
|
return [result, { status: "complete", request: req, response }];
|
|
90
91
|
}
|
|
@@ -8,4 +8,4 @@ import { StateMachinesHTTPError } from "../models/errors/state-machines-http-err
|
|
|
8
8
|
import * as operations from "../models/operations/index.js";
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function snapshotsList(client: StateMachinesCore, request
|
|
11
|
+
export declare function snapshotsList(client: StateMachinesCore, request?: operations.ListSnapshotsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListSnapshotsResponse, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
|
-
import { encodeFormQuery
|
|
5
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
6
|
import { matchStatusCode } from "../lib/http.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -16,23 +16,19 @@ export function snapshotsList(client, request, options) {
|
|
|
16
16
|
return new APIPromise($do(client, request, options));
|
|
17
17
|
}
|
|
18
18
|
async function $do(client, request, options) {
|
|
19
|
-
const parsed = safeParse(request, (value) => z.parse(operations.ListSnapshotsRequest$outboundSchema, value), "Input validation failed");
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(z.optional(operations.ListSnapshotsRequest$outboundSchema), value), "Input validation failed");
|
|
20
20
|
if (!parsed.ok) {
|
|
21
21
|
return [parsed, { status: "invalid" }];
|
|
22
22
|
}
|
|
23
23
|
const payload = parsed.value;
|
|
24
24
|
const body = null;
|
|
25
|
-
const
|
|
26
|
-
workspaceId: encodeSimple("workspaceId", payload.workspaceId, {
|
|
27
|
-
explode: false,
|
|
28
|
-
charEncoding: "percent",
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
const path = pathToFunc("/v1/workspaces/{workspaceId}/snapshots")(pathParams);
|
|
25
|
+
const path = pathToFunc("/v1/snapshots")();
|
|
32
26
|
const query = encodeFormQuery({
|
|
33
|
-
"cursor": payload
|
|
34
|
-
"
|
|
35
|
-
"
|
|
27
|
+
"cursor": payload?.cursor,
|
|
28
|
+
"environmentId": payload?.environmentId,
|
|
29
|
+
"limit": payload?.limit,
|
|
30
|
+
"status": payload?.status,
|
|
31
|
+
"workspaceId": payload?.workspaceId,
|
|
36
32
|
});
|
|
37
33
|
const headers = new Headers(compactMap({
|
|
38
34
|
Accept: "application/json",
|
|
@@ -90,7 +86,7 @@ async function $do(client, request, options) {
|
|
|
90
86
|
const responseFields = {
|
|
91
87
|
HttpMeta: { Response: response, Request: req },
|
|
92
88
|
};
|
|
93
|
-
const [result] = await M.match(M.json(200, operations.ListSnapshotsResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.
|
|
89
|
+
const [result] = await M.match(M.json(200, operations.ListSnapshotsResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
94
90
|
if (!result.ok) {
|
|
95
91
|
return [result, { status: "complete", request: req, response }];
|
|
96
92
|
}
|
|
@@ -5,7 +5,8 @@ import * as errors from "../models/errors/index.js";
|
|
|
5
5
|
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
6
|
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
7
|
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
8
9
|
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function snapshotsUpdate(client: StateMachinesCore, request: operations.UpdateSnapshotRequest, options?: RequestOptions): APIPromise<Result<
|
|
12
|
+
export declare function snapshotsUpdate(client: StateMachinesCore, request: operations.UpdateSnapshotRequest, options?: RequestOptions): APIPromise<Result<models.Snapshot, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -10,6 +10,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
16
|
export function snapshotsUpdate(client, request, options) {
|
|
@@ -85,7 +86,7 @@ async function $do(client, request, options) {
|
|
|
85
86
|
const responseFields = {
|
|
86
87
|
HttpMeta: { Response: response, Request: req },
|
|
87
88
|
};
|
|
88
|
-
const [result] = await M.match(M.json(200,
|
|
89
|
+
const [result] = await M.match(M.json(200, models.Snapshot$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
89
90
|
if (!result.ok) {
|
|
90
91
|
return [result, { status: "complete", request: req, response }];
|
|
91
92
|
}
|
|
@@ -5,7 +5,8 @@ import * as errors from "../models/errors/index.js";
|
|
|
5
5
|
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
6
|
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
7
|
import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
8
9
|
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function workspacesGet(client: StateMachinesCore, request: operations.GetWorkspaceRequest, options?: RequestOptions): APIPromise<Result<
|
|
12
|
+
export declare function workspacesGet(client: StateMachinesCore, request: operations.GetWorkspaceRequest, options?: RequestOptions): APIPromise<Result<models.Workspace, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -10,6 +10,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
13
14
|
import * as operations from "../models/operations/index.js";
|
|
14
15
|
import { APIPromise } from "../types/async.js";
|
|
15
16
|
export function workspacesGet(client, request, options) {
|
|
@@ -84,7 +85,7 @@ async function $do(client, request, options) {
|
|
|
84
85
|
const responseFields = {
|
|
85
86
|
HttpMeta: { Response: response, Request: req },
|
|
86
87
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200,
|
|
88
|
+
const [result] = await M.match(M.json(200, models.Workspace$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
88
89
|
if (!result.ok) {
|
|
89
90
|
return [result, { status: "complete", request: req, response }];
|
|
90
91
|
}
|
|
@@ -8,4 +8,4 @@ import { StateMachinesHTTPError } from "../models/errors/state-machines-http-err
|
|
|
8
8
|
import * as operations from "../models/operations/index.js";
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
|
-
export declare function workspacesList(client: StateMachinesCore, request?: operations.ListWorkspacesRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListWorkspacesResponse, errors.
|
|
11
|
+
export declare function workspacesList(client: StateMachinesCore, request?: operations.ListWorkspacesRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListWorkspacesResponse, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -25,6 +25,8 @@ async function $do(client, request, options) {
|
|
|
25
25
|
const path = pathToFunc("/v1/workspaces")();
|
|
26
26
|
const query = encodeFormQuery({
|
|
27
27
|
"archived": payload?.archived,
|
|
28
|
+
"cursor": payload?.cursor,
|
|
29
|
+
"limit": payload?.limit,
|
|
28
30
|
});
|
|
29
31
|
const headers = new Headers(compactMap({
|
|
30
32
|
Accept: "application/json",
|
|
@@ -82,7 +84,7 @@ async function $do(client, request, options) {
|
|
|
82
84
|
const responseFields = {
|
|
83
85
|
HttpMeta: { Response: response, Request: req },
|
|
84
86
|
};
|
|
85
|
-
const [result] = await M.match(M.json(200, operations.ListWorkspacesResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.
|
|
87
|
+
const [result] = await M.match(M.json(200, operations.ListWorkspacesResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
86
88
|
if (!result.ok) {
|
|
87
89
|
return [result, { status: "complete", request: req, response }];
|
|
88
90
|
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { RetryConfig } from "./retries.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Contains the list of servers available to the SDK
|
|
6
6
|
*/
|
|
7
|
-
export declare const ServerList: readonly ["https://
|
|
7
|
+
export declare const ServerList: readonly ["https://api.usestatemachines.com"];
|
|
8
8
|
export type SDKOptions = {
|
|
9
9
|
apiKey?: string | (() => Promise<string>) | undefined;
|
|
10
10
|
httpClient?: HTTPClient;
|
|
@@ -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.6.1";
|
|
35
35
|
readonly genVersion: "2.941.0";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.6.1 2.941.0 1.0.0 @usestatemachines/sdk";
|
|
37
37
|
};
|
package/esm/lib/config.js
CHANGED
|
@@ -6,7 +6,7 @@ import { pathToFunc } from "./url.js";
|
|
|
6
6
|
* Contains the list of servers available to the SDK
|
|
7
7
|
*/
|
|
8
8
|
export const ServerList = [
|
|
9
|
-
"https://
|
|
9
|
+
"https://api.usestatemachines.com",
|
|
10
10
|
];
|
|
11
11
|
export function serverURLFromOptions(options) {
|
|
12
12
|
let serverURL = options.serverURL;
|
|
@@ -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.6.1",
|
|
28
28
|
genVersion: "2.941.0",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.6.1 2.941.0 1.0.0 @usestatemachines/sdk",
|
|
30
30
|
};
|
package/esm/models/actor.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
-
import { CredentialKind } from "./credential-kind.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
4
|
export type Actor = {
|
|
6
5
|
id: string;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
name: string;
|
|
7
|
+
summary: string;
|
|
9
8
|
};
|
|
10
9
|
/** @internal */
|
|
11
10
|
export declare const Actor$inboundSchema: z.ZodMiniType<Actor, unknown>;
|
package/esm/models/actor.js
CHANGED
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
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
|
-
import { CredentialKind$inboundSchema, } from "./credential-kind.js";
|
|
8
7
|
/** @internal */
|
|
9
8
|
export const Actor$inboundSchema = z.object({
|
|
10
9
|
id: types.string(),
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
name: types.string(),
|
|
11
|
+
summary: types.string(),
|
|
13
12
|
});
|
|
14
13
|
export function actorFromJSON(jsonString) {
|
|
15
14
|
return safeParse(jsonString, (x) => Actor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Actor' from JSON`);
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
|
4
|
+
export type Api = {
|
|
5
5
|
actorHeader: string;
|
|
6
6
|
actorVariable: string;
|
|
7
|
+
apiVersions: Array<string>;
|
|
7
8
|
id: string;
|
|
8
9
|
interactive: boolean;
|
|
9
10
|
limitations: Array<string>;
|
|
10
11
|
name: string;
|
|
11
12
|
pathTemplate: string;
|
|
12
13
|
requestContentType: string;
|
|
13
|
-
versions: Array<string>;
|
|
14
14
|
};
|
|
15
15
|
/** @internal */
|
|
16
|
-
export declare const
|
|
17
|
-
export declare function
|
|
16
|
+
export declare const Api$inboundSchema: z.ZodMiniType<Api, unknown>;
|
|
17
|
+
export declare function apiFromJSON(jsonString: string): SafeParseResult<Api, SDKValidationError>;
|
|
@@ -5,18 +5,17 @@ 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
|
|
9
|
-
.object({
|
|
8
|
+
export const Api$inboundSchema = z.object({
|
|
10
9
|
actorHeader: types.string(),
|
|
11
10
|
actorVariable: types.string(),
|
|
11
|
+
apiVersions: z.array(types.string()),
|
|
12
12
|
id: types.string(),
|
|
13
13
|
interactive: types.boolean(),
|
|
14
14
|
limitations: z.array(types.string()),
|
|
15
15
|
name: types.string(),
|
|
16
16
|
pathTemplate: types.string(),
|
|
17
17
|
requestContentType: types.string(),
|
|
18
|
-
versions: z.array(types.string()),
|
|
19
18
|
});
|
|
20
|
-
export function
|
|
21
|
-
return safeParse(jsonString, (x) =>
|
|
19
|
+
export function apiFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => Api$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Api' from JSON`);
|
|
22
21
|
}
|
package/esm/models/app.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
export declare const AppType: {
|
|
6
|
+
readonly Replica: "replica";
|
|
7
|
+
};
|
|
8
|
+
export type AppType = ClosedEnum<typeof AppType>;
|
|
4
9
|
export type App = {
|
|
5
|
-
|
|
10
|
+
defaultVersionId: string | null;
|
|
6
11
|
description: string;
|
|
7
12
|
id: string;
|
|
8
13
|
logoPath: string;
|
|
9
14
|
name: string;
|
|
15
|
+
type: AppType;
|
|
10
16
|
vendor: string;
|
|
11
17
|
};
|
|
12
18
|
/** @internal */
|
|
19
|
+
export declare const AppType$inboundSchema: z.ZodMiniEnum<typeof AppType>;
|
|
20
|
+
/** @internal */
|
|
13
21
|
export declare const App$inboundSchema: z.ZodMiniType<App, unknown>;
|
|
14
22
|
export declare function appFromJSON(jsonString: string): SafeParseResult<App, SDKValidationError>;
|
package/esm/models/app.js
CHANGED
|
@@ -4,13 +4,19 @@
|
|
|
4
4
|
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
|
+
export const AppType = {
|
|
8
|
+
Replica: "replica",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const AppType$inboundSchema = z.enum(AppType);
|
|
7
12
|
/** @internal */
|
|
8
13
|
export const App$inboundSchema = z.object({
|
|
9
|
-
|
|
14
|
+
defaultVersionId: types.nullable(types.string()),
|
|
10
15
|
description: types.string(),
|
|
11
16
|
id: types.string(),
|
|
12
17
|
logoPath: types.string(),
|
|
13
18
|
name: types.string(),
|
|
19
|
+
type: AppType$inboundSchema,
|
|
14
20
|
vendor: types.string(),
|
|
15
21
|
});
|
|
16
22
|
export function appFromJSON(jsonString) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
-
import { Actor } from "./actor.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
actor: Actor | null;
|
|
4
|
+
import { Principal } from "./principal.js";
|
|
5
|
+
export type AuditEvent = {
|
|
8
6
|
data: {
|
|
9
7
|
[k: string]: any;
|
|
10
8
|
};
|
|
11
9
|
environmentId: string | null;
|
|
12
10
|
id: string;
|
|
11
|
+
name: string;
|
|
13
12
|
occurredAt: Date;
|
|
13
|
+
principal: Principal;
|
|
14
14
|
requestId: string | null;
|
|
15
15
|
subjectId: string;
|
|
16
16
|
workspaceId: string | null;
|
|
17
17
|
};
|
|
18
18
|
/** @internal */
|
|
19
|
-
export declare const
|
|
20
|
-
export declare function
|
|
19
|
+
export declare const AuditEvent$inboundSchema: z.ZodMiniType<AuditEvent, unknown>;
|
|
20
|
+
export declare function auditEventFromJSON(jsonString: string): SafeParseResult<AuditEvent, SDKValidationError>;
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
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
|
-
import {
|
|
7
|
+
import { Principal$inboundSchema } from "./principal.js";
|
|
8
8
|
/** @internal */
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
actor: types.nullable(Actor$inboundSchema),
|
|
9
|
+
export const AuditEvent$inboundSchema = z
|
|
10
|
+
.object({
|
|
12
11
|
data: z.record(z.string(), z.any()),
|
|
13
12
|
environmentId: types.nullable(types.string()),
|
|
14
13
|
id: types.string(),
|
|
14
|
+
name: types.string(),
|
|
15
15
|
occurredAt: types.date(),
|
|
16
|
+
principal: Principal$inboundSchema,
|
|
16
17
|
requestId: types.nullable(types.string()),
|
|
17
18
|
subjectId: types.string(),
|
|
18
19
|
workspaceId: types.nullable(types.string()),
|
|
19
20
|
});
|
|
20
|
-
export function
|
|
21
|
-
return safeParse(jsonString, (x) =>
|
|
21
|
+
export function auditEventFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => AuditEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditEvent' from JSON`);
|
|
22
23
|
}
|
|
@@ -3,7 +3,7 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
export declare const Coverage: {
|
|
6
|
-
readonly
|
|
6
|
+
readonly Recorded: "recorded";
|
|
7
7
|
readonly Redacted: "redacted";
|
|
8
8
|
readonly Omitted: "omitted";
|
|
9
9
|
};
|
|
@@ -13,7 +13,7 @@ export declare const Encoding: {
|
|
|
13
13
|
readonly Binary: "binary";
|
|
14
14
|
};
|
|
15
15
|
export type Encoding = OpenEnum<typeof Encoding>;
|
|
16
|
-
export type
|
|
16
|
+
export type BodyPreview = {
|
|
17
17
|
bytes: number | null;
|
|
18
18
|
contentType: string | null;
|
|
19
19
|
coverage: Coverage;
|
|
@@ -27,5 +27,5 @@ export declare const Coverage$inboundSchema: z.ZodMiniType<Coverage, unknown>;
|
|
|
27
27
|
/** @internal */
|
|
28
28
|
export declare const Encoding$inboundSchema: z.ZodMiniType<Encoding, unknown>;
|
|
29
29
|
/** @internal */
|
|
30
|
-
export declare const
|
|
31
|
-
export declare function
|
|
30
|
+
export declare const BodyPreview$inboundSchema: z.ZodMiniType<BodyPreview, unknown>;
|
|
31
|
+
export declare function bodyPreviewFromJSON(jsonString: string): SafeParseResult<BodyPreview, SDKValidationError>;
|
|
@@ -6,7 +6,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
6
6
|
import * as openEnums from "../types/enums.js";
|
|
7
7
|
import * as types from "../types/primitives.js";
|
|
8
8
|
export const Coverage = {
|
|
9
|
-
|
|
9
|
+
Recorded: "recorded",
|
|
10
10
|
Redacted: "redacted",
|
|
11
11
|
Omitted: "omitted",
|
|
12
12
|
};
|
|
@@ -19,7 +19,8 @@ export const Coverage$inboundSchema = openEnums.inboundSchema(Coverage);
|
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const Encoding$inboundSchema = openEnums.inboundSchema(Encoding);
|
|
21
21
|
/** @internal */
|
|
22
|
-
export const
|
|
22
|
+
export const BodyPreview$inboundSchema = z
|
|
23
|
+
.object({
|
|
23
24
|
bytes: types.nullable(types.number()),
|
|
24
25
|
contentType: types.nullable(types.string()),
|
|
25
26
|
coverage: Coverage$inboundSchema,
|
|
@@ -28,6 +29,6 @@ export const RequestPayloadPreview$inboundSchema = z.object({
|
|
|
28
29
|
previewTruncated: types.boolean(),
|
|
29
30
|
reason: types.nullable(types.string()),
|
|
30
31
|
});
|
|
31
|
-
export function
|
|
32
|
-
return safeParse(jsonString, (x) =>
|
|
32
|
+
export function bodyPreviewFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => BodyPreview$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BodyPreview' from JSON`);
|
|
33
34
|
}
|