@usestatemachines/sdk 0.3.0 → 0.5.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 +122 -19
- package/agents/SKILL.md +10 -7
- package/agents/index.js +6 -6
- package/agents/llms.txt +19 -11
- package/agents/prompt.md +1 -1
- package/esm/extensions/client.d.ts +24 -2
- package/esm/extensions/client.js +26 -3
- package/esm/extensions/index.d.ts +2 -2
- package/esm/extensions/running-environment.d.ts +18 -4
- package/esm/extensions/running-environment.js +24 -2
- package/esm/extensions/wait.d.ts +3 -1
- package/esm/extensions/wait.js +17 -2
- package/esm/funcs/environments-get-request-payload.d.ts +11 -0
- package/esm/funcs/environments-get-request-payload.js +100 -0
- package/esm/funcs/environments-get-request-stats.d.ts +11 -0
- package/esm/funcs/environments-get-request-stats.js +103 -0
- package/esm/funcs/environments-get-request.d.ts +11 -0
- package/esm/funcs/environments-get-request.js +96 -0
- package/esm/funcs/environments-list-requests.d.ts +11 -0
- package/esm/funcs/environments-list-requests.js +105 -0
- package/esm/funcs/environments-resume.d.ts +11 -0
- package/esm/funcs/environments-resume.js +93 -0
- package/esm/funcs/environments-stop.js +1 -0
- package/esm/funcs/environments-suspend.d.ts +11 -0
- package/esm/funcs/environments-suspend.js +93 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/environment-app.d.ts +2 -0
- package/esm/models/environment-app.js +2 -0
- package/esm/models/environment-request-detail.d.ts +40 -0
- package/esm/models/environment-request-detail.js +39 -0
- package/esm/models/environment-request-stats.d.ts +26 -0
- package/esm/models/environment-request-stats.js +31 -0
- package/esm/models/environment-request.d.ts +31 -0
- package/esm/models/environment-request.js +34 -0
- package/esm/models/environment-snapshot.d.ts +3 -2
- package/esm/models/environment-snapshot.js +3 -2
- package/esm/models/environment.d.ts +4 -0
- package/esm/models/environment.js +4 -0
- package/esm/models/error-response.d.ts +7 -0
- package/esm/models/error-response.js +7 -0
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/operations/create-environment-definition.d.ts +10 -0
- package/esm/models/operations/create-environment-definition.js +3 -0
- package/esm/models/operations/get-environment-request-payload.d.ts +23 -0
- package/esm/models/operations/get-environment-request-payload.js +19 -0
- package/esm/models/operations/get-environment-request-stats.d.ts +70 -0
- package/esm/models/operations/get-environment-request-stats.js +55 -0
- package/esm/models/operations/get-environment-request.d.ts +25 -0
- package/esm/models/operations/get-environment-request.js +21 -0
- package/esm/models/operations/index.d.ts +6 -0
- package/esm/models/operations/index.js +6 -0
- package/esm/models/operations/list-environment-requests.d.ts +75 -0
- package/esm/models/operations/list-environment-requests.js +59 -0
- package/esm/models/operations/resume-environment.d.ts +25 -0
- package/esm/models/operations/resume-environment.js +26 -0
- package/esm/models/operations/stop-environment.d.ts +3 -1
- package/esm/models/operations/stop-environment.js +8 -2
- package/esm/models/operations/suspend-environment.d.ts +25 -0
- package/esm/models/operations/suspend-environment.js +26 -0
- package/esm/models/release.d.ts +11 -0
- package/esm/models/release.js +10 -0
- package/esm/models/request-payload-preview.d.ts +31 -0
- package/esm/models/request-payload-preview.js +33 -0
- package/esm/sdk/environments.d.ts +6 -0
- package/esm/sdk/environments.js +24 -0
- package/openapi.json +1380 -29
- package/package.json +4 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import * as types from "../types/primitives.js";
|
|
8
|
+
export const EnvironmentRequestOutcome = {
|
|
9
|
+
ReplicaResponse: "replica_response",
|
|
10
|
+
GatewayError: "gateway_error",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const EnvironmentRequestOutcome$inboundSchema = openEnums.inboundSchema(EnvironmentRequestOutcome);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const EnvironmentRequest$inboundSchema = z.object({
|
|
16
|
+
appInstanceId: types.nullable(types.string()),
|
|
17
|
+
appKey: types.string(),
|
|
18
|
+
completedAt: types.date(),
|
|
19
|
+
durationMs: types.number(),
|
|
20
|
+
environmentId: types.string(),
|
|
21
|
+
errorCode: types.nullable(types.string()),
|
|
22
|
+
id: types.string(),
|
|
23
|
+
method: types.string(),
|
|
24
|
+
outcome: EnvironmentRequestOutcome$inboundSchema,
|
|
25
|
+
path: types.string(),
|
|
26
|
+
query: types.string(),
|
|
27
|
+
receivedAt: types.date(),
|
|
28
|
+
requestBytes: types.nullable(types.number()),
|
|
29
|
+
responseBytes: types.nullable(types.number()),
|
|
30
|
+
status: types.number(),
|
|
31
|
+
});
|
|
32
|
+
export function environmentRequestFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => EnvironmentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentRequest' from JSON`);
|
|
34
|
+
}
|
|
@@ -5,7 +5,8 @@ import { Actor } from "./actor.js";
|
|
|
5
5
|
import { AppInstanceSnapshot } from "./app-instance-snapshot.js";
|
|
6
6
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
7
7
|
export declare const Consistency: {
|
|
8
|
-
readonly
|
|
8
|
+
readonly Environment: "environment";
|
|
9
|
+
readonly AppInstance: "app_instance";
|
|
9
10
|
};
|
|
10
11
|
export type Consistency = OpenEnum<typeof Consistency>;
|
|
11
12
|
export declare const EnvironmentSnapshotStatus: {
|
|
@@ -16,7 +17,7 @@ export declare const EnvironmentSnapshotStatus: {
|
|
|
16
17
|
export type EnvironmentSnapshotStatus = OpenEnum<typeof EnvironmentSnapshotStatus>;
|
|
17
18
|
export type EnvironmentSnapshot = {
|
|
18
19
|
appInstanceSnapshots: Array<AppInstanceSnapshot>;
|
|
19
|
-
consistency: Consistency;
|
|
20
|
+
consistency: Consistency | null;
|
|
20
21
|
createdAt: Date;
|
|
21
22
|
createdBy: Actor | null;
|
|
22
23
|
deletedAt: Date | null;
|
|
@@ -8,7 +8,8 @@ import * as types from "../types/primitives.js";
|
|
|
8
8
|
import { Actor$inboundSchema } from "./actor.js";
|
|
9
9
|
import { AppInstanceSnapshot$inboundSchema, } from "./app-instance-snapshot.js";
|
|
10
10
|
export const Consistency = {
|
|
11
|
-
|
|
11
|
+
Environment: "environment",
|
|
12
|
+
AppInstance: "app_instance",
|
|
12
13
|
};
|
|
13
14
|
export const EnvironmentSnapshotStatus = {
|
|
14
15
|
Capturing: "capturing",
|
|
@@ -22,7 +23,7 @@ export const EnvironmentSnapshotStatus$inboundSchema = openEnums.inboundSchema(E
|
|
|
22
23
|
/** @internal */
|
|
23
24
|
export const EnvironmentSnapshot$inboundSchema = z.object({
|
|
24
25
|
appInstanceSnapshots: z.array(AppInstanceSnapshot$inboundSchema),
|
|
25
|
-
consistency: Consistency$inboundSchema,
|
|
26
|
+
consistency: types.nullable(Consistency$inboundSchema),
|
|
26
27
|
createdAt: types.date(),
|
|
27
28
|
createdBy: types.nullable(Actor$inboundSchema),
|
|
28
29
|
deletedAt: types.nullable(types.date()),
|
|
@@ -8,6 +8,8 @@ export declare const EnvironmentStatus: {
|
|
|
8
8
|
readonly Queued: "queued";
|
|
9
9
|
readonly Starting: "starting";
|
|
10
10
|
readonly Running: "running";
|
|
11
|
+
readonly Suspending: "suspending";
|
|
12
|
+
readonly Suspended: "suspended";
|
|
11
13
|
readonly Stopping: "stopping";
|
|
12
14
|
readonly Stopped: "stopped";
|
|
13
15
|
readonly Failed: "failed";
|
|
@@ -31,11 +33,13 @@ export type Environment = {
|
|
|
31
33
|
};
|
|
32
34
|
lifetimeMinutes: number;
|
|
33
35
|
name: string | null;
|
|
36
|
+
sourceEnvironmentId: string | null;
|
|
34
37
|
sourceEnvironmentSnapshotId: string | null;
|
|
35
38
|
startedAt: Date | null;
|
|
36
39
|
status: EnvironmentStatus;
|
|
37
40
|
stopReason: StopReason | null;
|
|
38
41
|
stoppedAt: Date | null;
|
|
42
|
+
suspendedAt: Date | null;
|
|
39
43
|
version: number;
|
|
40
44
|
workspaceId: string;
|
|
41
45
|
};
|
|
@@ -11,6 +11,8 @@ export const EnvironmentStatus = {
|
|
|
11
11
|
Queued: "queued",
|
|
12
12
|
Starting: "starting",
|
|
13
13
|
Running: "running",
|
|
14
|
+
Suspending: "suspending",
|
|
15
|
+
Suspended: "suspended",
|
|
14
16
|
Stopping: "stopping",
|
|
15
17
|
Stopped: "stopped",
|
|
16
18
|
Failed: "failed",
|
|
@@ -36,11 +38,13 @@ export const Environment$inboundSchema = z
|
|
|
36
38
|
labels: z.record(z.string(), types.string()),
|
|
37
39
|
lifetimeMinutes: types.number(),
|
|
38
40
|
name: types.nullable(types.string()),
|
|
41
|
+
sourceEnvironmentId: z._default(z.nullable(types.string()), null),
|
|
39
42
|
sourceEnvironmentSnapshotId: z._default(z.nullable(types.string()), null),
|
|
40
43
|
startedAt: types.nullable(types.date()),
|
|
41
44
|
status: EnvironmentStatus$inboundSchema,
|
|
42
45
|
stopReason: types.nullable(StopReason$inboundSchema),
|
|
43
46
|
stoppedAt: types.nullable(types.date()),
|
|
47
|
+
suspendedAt: types.nullable(types.date()),
|
|
44
48
|
version: types.number(),
|
|
45
49
|
workspaceId: types.string(),
|
|
46
50
|
});
|
|
@@ -4,6 +4,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
export declare const Code: {
|
|
6
6
|
readonly BodyTooLarge: "body-too-large";
|
|
7
|
+
readonly CaptureInProgress: "capture-in-progress";
|
|
7
8
|
readonly ConnectionNotAuthorized: "connection-not-authorized";
|
|
8
9
|
readonly ConnectionUnavailable: "connection-unavailable";
|
|
9
10
|
readonly EnvironmentLimit: "environment-limit";
|
|
@@ -23,12 +24,18 @@ export declare const Code: {
|
|
|
23
24
|
readonly LifetimeTooLong: "lifetime-too-long";
|
|
24
25
|
readonly NotFound: "not-found";
|
|
25
26
|
readonly NotReady: "not-ready";
|
|
27
|
+
readonly NotSnapshottable: "not-snapshottable";
|
|
28
|
+
readonly NotSuspended: "not-suspended";
|
|
26
29
|
readonly OrganizationRequired: "organization-required";
|
|
30
|
+
readonly ReleaseGone: "release-gone";
|
|
31
|
+
readonly ReleaseLifecycle: "release-lifecycle";
|
|
27
32
|
readonly ReleaseUnavailable: "release-unavailable";
|
|
28
33
|
readonly RequestCapacityReached: "request-capacity-reached";
|
|
29
34
|
readonly RequestTimeout: "request-timeout";
|
|
30
35
|
readonly ServiceUnavailable: "service-unavailable";
|
|
31
36
|
readonly SnapshotLimit: "snapshot-limit";
|
|
37
|
+
readonly SnapshotsUnavailable: "snapshots-unavailable";
|
|
38
|
+
readonly SuspendInProgress: "suspend-in-progress";
|
|
32
39
|
readonly Unauthorized: "unauthorized";
|
|
33
40
|
readonly VersionConflict: "version-conflict";
|
|
34
41
|
readonly WorkspaceArchived: "workspace-archived";
|
|
@@ -7,6 +7,7 @@ import * as openEnums from "../types/enums.js";
|
|
|
7
7
|
import * as types from "../types/primitives.js";
|
|
8
8
|
export const Code = {
|
|
9
9
|
BodyTooLarge: "body-too-large",
|
|
10
|
+
CaptureInProgress: "capture-in-progress",
|
|
10
11
|
ConnectionNotAuthorized: "connection-not-authorized",
|
|
11
12
|
ConnectionUnavailable: "connection-unavailable",
|
|
12
13
|
EnvironmentLimit: "environment-limit",
|
|
@@ -26,12 +27,18 @@ export const Code = {
|
|
|
26
27
|
LifetimeTooLong: "lifetime-too-long",
|
|
27
28
|
NotFound: "not-found",
|
|
28
29
|
NotReady: "not-ready",
|
|
30
|
+
NotSnapshottable: "not-snapshottable",
|
|
31
|
+
NotSuspended: "not-suspended",
|
|
29
32
|
OrganizationRequired: "organization-required",
|
|
33
|
+
ReleaseGone: "release-gone",
|
|
34
|
+
ReleaseLifecycle: "release-lifecycle",
|
|
30
35
|
ReleaseUnavailable: "release-unavailable",
|
|
31
36
|
RequestCapacityReached: "request-capacity-reached",
|
|
32
37
|
RequestTimeout: "request-timeout",
|
|
33
38
|
ServiceUnavailable: "service-unavailable",
|
|
34
39
|
SnapshotLimit: "snapshot-limit",
|
|
40
|
+
SnapshotsUnavailable: "snapshots-unavailable",
|
|
41
|
+
SuspendInProgress: "suspend-in-progress",
|
|
35
42
|
Unauthorized: "unauthorized",
|
|
36
43
|
VersionConflict: "version-conflict",
|
|
37
44
|
WorkspaceArchived: "workspace-archived",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export * from "./credential-kind.js";
|
|
|
10
10
|
export * from "./credential.js";
|
|
11
11
|
export * from "./environment-app.js";
|
|
12
12
|
export * from "./environment-lifetime.js";
|
|
13
|
+
export * from "./environment-request-detail.js";
|
|
14
|
+
export * from "./environment-request-stats.js";
|
|
15
|
+
export * from "./environment-request.js";
|
|
13
16
|
export * from "./environment-snapshot.js";
|
|
14
17
|
export * from "./environment.js";
|
|
15
18
|
export * from "./error-response.js";
|
|
@@ -17,5 +20,6 @@ export * from "./event-page.js";
|
|
|
17
20
|
export * from "./event.js";
|
|
18
21
|
export * from "./release-actor.js";
|
|
19
22
|
export * from "./release.js";
|
|
23
|
+
export * from "./request-payload-preview.js";
|
|
20
24
|
export * from "./security.js";
|
|
21
25
|
export * from "./workspace.js";
|
package/esm/models/index.js
CHANGED
|
@@ -13,6 +13,9 @@ export * from "./credential-kind.js";
|
|
|
13
13
|
export * from "./credential.js";
|
|
14
14
|
export * from "./environment-app.js";
|
|
15
15
|
export * from "./environment-lifetime.js";
|
|
16
|
+
export * from "./environment-request-detail.js";
|
|
17
|
+
export * from "./environment-request-stats.js";
|
|
18
|
+
export * from "./environment-request.js";
|
|
16
19
|
export * from "./environment-snapshot.js";
|
|
17
20
|
export * from "./environment.js";
|
|
18
21
|
export * from "./error-response.js";
|
|
@@ -20,5 +23,6 @@ export * from "./event-page.js";
|
|
|
20
23
|
export * from "./event.js";
|
|
21
24
|
export * from "./release-actor.js";
|
|
22
25
|
export * from "./release.js";
|
|
26
|
+
export * from "./request-payload-preview.js";
|
|
23
27
|
export * from "./security.js";
|
|
24
28
|
export * from "./workspace.js";
|
|
@@ -7,6 +7,11 @@ export type From = {
|
|
|
7
7
|
};
|
|
8
8
|
export type CreateEnvironmentDefinitionRequestBody2 = {
|
|
9
9
|
from: From;
|
|
10
|
+
labels?: {
|
|
11
|
+
[k: string]: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
lifetimeMinutes?: number | undefined;
|
|
14
|
+
name?: string | undefined;
|
|
10
15
|
version?: number | undefined;
|
|
11
16
|
};
|
|
12
17
|
export type Apps = {
|
|
@@ -75,6 +80,11 @@ export declare function fromToJSON(from: From): string;
|
|
|
75
80
|
/** @internal */
|
|
76
81
|
export type CreateEnvironmentDefinitionRequestBody2$Outbound = {
|
|
77
82
|
from: From$Outbound;
|
|
83
|
+
labels?: {
|
|
84
|
+
[k: string]: string;
|
|
85
|
+
} | undefined;
|
|
86
|
+
lifetimeMinutes?: number | undefined;
|
|
87
|
+
name?: string | undefined;
|
|
78
88
|
version: number;
|
|
79
89
|
};
|
|
80
90
|
/** @internal */
|
|
@@ -16,6 +16,9 @@ export function fromToJSON(from) {
|
|
|
16
16
|
/** @internal */
|
|
17
17
|
export const CreateEnvironmentDefinitionRequestBody2$outboundSchema = z.object({
|
|
18
18
|
from: z.lazy(() => From$outboundSchema),
|
|
19
|
+
labels: z.optional(z.record(z.string(), z.string())),
|
|
20
|
+
lifetimeMinutes: z.optional(z.int()),
|
|
21
|
+
name: z.optional(z.string()),
|
|
19
22
|
version: z._default(z.number(), 1),
|
|
20
23
|
});
|
|
21
24
|
export function createEnvironmentDefinitionRequestBody2ToJSON(createEnvironmentDefinitionRequestBody2) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
3
|
+
export declare const Direction: {
|
|
4
|
+
readonly Request: "request";
|
|
5
|
+
readonly Response: "response";
|
|
6
|
+
};
|
|
7
|
+
export type Direction = ClosedEnum<typeof Direction>;
|
|
8
|
+
export type GetEnvironmentRequestPayloadRequest = {
|
|
9
|
+
environmentId: string;
|
|
10
|
+
requestId: string;
|
|
11
|
+
direction: Direction;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const Direction$outboundSchema: z.ZodMiniEnum<typeof Direction>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type GetEnvironmentRequestPayloadRequest$Outbound = {
|
|
17
|
+
environmentId: string;
|
|
18
|
+
requestId: string;
|
|
19
|
+
direction: string;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const GetEnvironmentRequestPayloadRequest$outboundSchema: z.ZodMiniType<GetEnvironmentRequestPayloadRequest$Outbound, GetEnvironmentRequestPayloadRequest>;
|
|
23
|
+
export declare function getEnvironmentRequestPayloadRequestToJSON(getEnvironmentRequestPayloadRequest: GetEnvironmentRequestPayloadRequest): string;
|
|
@@ -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
|
+
export const Direction = {
|
|
6
|
+
Request: "request",
|
|
7
|
+
Response: "response",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const Direction$outboundSchema = z.enum(Direction);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const GetEnvironmentRequestPayloadRequest$outboundSchema = z.object({
|
|
13
|
+
environmentId: z.string(),
|
|
14
|
+
requestId: z.string(),
|
|
15
|
+
direction: Direction$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function getEnvironmentRequestPayloadRequestToJSON(getEnvironmentRequestPayloadRequest) {
|
|
18
|
+
return JSON.stringify(GetEnvironmentRequestPayloadRequest$outboundSchema.parse(getEnvironmentRequestPayloadRequest));
|
|
19
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
5
|
+
import * as models from "../index.js";
|
|
6
|
+
export declare const GetEnvironmentRequestStatsStatusClass: {
|
|
7
|
+
readonly Twoxx: "2xx";
|
|
8
|
+
readonly Threexx: "3xx";
|
|
9
|
+
readonly Fourxx: "4xx";
|
|
10
|
+
readonly Fivexx: "5xx";
|
|
11
|
+
};
|
|
12
|
+
export type GetEnvironmentRequestStatsStatusClass = ClosedEnum<typeof GetEnvironmentRequestStatsStatusClass>;
|
|
13
|
+
export declare const GetEnvironmentRequestStatsMethod: {
|
|
14
|
+
readonly Get: "GET";
|
|
15
|
+
readonly Head: "HEAD";
|
|
16
|
+
readonly Post: "POST";
|
|
17
|
+
readonly Put: "PUT";
|
|
18
|
+
readonly Patch: "PATCH";
|
|
19
|
+
readonly Delete: "DELETE";
|
|
20
|
+
readonly Options: "OPTIONS";
|
|
21
|
+
readonly Connect: "CONNECT";
|
|
22
|
+
readonly Trace: "TRACE";
|
|
23
|
+
};
|
|
24
|
+
export type GetEnvironmentRequestStatsMethod = ClosedEnum<typeof GetEnvironmentRequestStatsMethod>;
|
|
25
|
+
export declare const GetEnvironmentRequestStatsWritesOnly: {
|
|
26
|
+
readonly True: "true";
|
|
27
|
+
readonly False: "false";
|
|
28
|
+
};
|
|
29
|
+
export type GetEnvironmentRequestStatsWritesOnly = ClosedEnum<typeof GetEnvironmentRequestStatsWritesOnly>;
|
|
30
|
+
export type GetEnvironmentRequestStatsRequest = {
|
|
31
|
+
environmentId: string;
|
|
32
|
+
appKey?: string | undefined;
|
|
33
|
+
status?: number | undefined;
|
|
34
|
+
statusClass?: GetEnvironmentRequestStatsStatusClass | undefined;
|
|
35
|
+
method?: GetEnvironmentRequestStatsMethod | undefined;
|
|
36
|
+
search?: string | undefined;
|
|
37
|
+
writesOnly?: GetEnvironmentRequestStatsWritesOnly | undefined;
|
|
38
|
+
from: Date;
|
|
39
|
+
to: Date;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Recorded request statistics across the selected time window
|
|
43
|
+
*/
|
|
44
|
+
export type GetEnvironmentRequestStatsResponse = {
|
|
45
|
+
data: models.EnvironmentRequestStats;
|
|
46
|
+
};
|
|
47
|
+
/** @internal */
|
|
48
|
+
export declare const GetEnvironmentRequestStatsStatusClass$outboundSchema: z.ZodMiniEnum<typeof GetEnvironmentRequestStatsStatusClass>;
|
|
49
|
+
/** @internal */
|
|
50
|
+
export declare const GetEnvironmentRequestStatsMethod$outboundSchema: z.ZodMiniEnum<typeof GetEnvironmentRequestStatsMethod>;
|
|
51
|
+
/** @internal */
|
|
52
|
+
export declare const GetEnvironmentRequestStatsWritesOnly$outboundSchema: z.ZodMiniEnum<typeof GetEnvironmentRequestStatsWritesOnly>;
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type GetEnvironmentRequestStatsRequest$Outbound = {
|
|
55
|
+
environmentId: string;
|
|
56
|
+
appKey?: string | undefined;
|
|
57
|
+
status?: number | undefined;
|
|
58
|
+
statusClass?: string | undefined;
|
|
59
|
+
method?: string | undefined;
|
|
60
|
+
search?: string | undefined;
|
|
61
|
+
writesOnly?: string | undefined;
|
|
62
|
+
from: string;
|
|
63
|
+
to: string;
|
|
64
|
+
};
|
|
65
|
+
/** @internal */
|
|
66
|
+
export declare const GetEnvironmentRequestStatsRequest$outboundSchema: z.ZodMiniType<GetEnvironmentRequestStatsRequest$Outbound, GetEnvironmentRequestStatsRequest>;
|
|
67
|
+
export declare function getEnvironmentRequestStatsRequestToJSON(getEnvironmentRequestStatsRequest: GetEnvironmentRequestStatsRequest): string;
|
|
68
|
+
/** @internal */
|
|
69
|
+
export declare const GetEnvironmentRequestStatsResponse$inboundSchema: z.ZodMiniType<GetEnvironmentRequestStatsResponse, unknown>;
|
|
70
|
+
export declare function getEnvironmentRequestStatsResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentRequestStatsResponse, SDKValidationError>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
export const GetEnvironmentRequestStatsStatusClass = {
|
|
8
|
+
Twoxx: "2xx",
|
|
9
|
+
Threexx: "3xx",
|
|
10
|
+
Fourxx: "4xx",
|
|
11
|
+
Fivexx: "5xx",
|
|
12
|
+
};
|
|
13
|
+
export const GetEnvironmentRequestStatsMethod = {
|
|
14
|
+
Get: "GET",
|
|
15
|
+
Head: "HEAD",
|
|
16
|
+
Post: "POST",
|
|
17
|
+
Put: "PUT",
|
|
18
|
+
Patch: "PATCH",
|
|
19
|
+
Delete: "DELETE",
|
|
20
|
+
Options: "OPTIONS",
|
|
21
|
+
Connect: "CONNECT",
|
|
22
|
+
Trace: "TRACE",
|
|
23
|
+
};
|
|
24
|
+
export const GetEnvironmentRequestStatsWritesOnly = {
|
|
25
|
+
True: "true",
|
|
26
|
+
False: "false",
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const GetEnvironmentRequestStatsStatusClass$outboundSchema = z.enum(GetEnvironmentRequestStatsStatusClass);
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const GetEnvironmentRequestStatsMethod$outboundSchema = z.enum(GetEnvironmentRequestStatsMethod);
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const GetEnvironmentRequestStatsWritesOnly$outboundSchema = z.enum(GetEnvironmentRequestStatsWritesOnly);
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const GetEnvironmentRequestStatsRequest$outboundSchema = z.object({
|
|
36
|
+
environmentId: z.string(),
|
|
37
|
+
appKey: z.optional(z.string()),
|
|
38
|
+
status: z.optional(z.int()),
|
|
39
|
+
statusClass: z.optional(GetEnvironmentRequestStatsStatusClass$outboundSchema),
|
|
40
|
+
method: z.optional(GetEnvironmentRequestStatsMethod$outboundSchema),
|
|
41
|
+
search: z.optional(z.string()),
|
|
42
|
+
writesOnly: z.optional(GetEnvironmentRequestStatsWritesOnly$outboundSchema),
|
|
43
|
+
from: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
44
|
+
to: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
45
|
+
});
|
|
46
|
+
export function getEnvironmentRequestStatsRequestToJSON(getEnvironmentRequestStatsRequest) {
|
|
47
|
+
return JSON.stringify(GetEnvironmentRequestStatsRequest$outboundSchema.parse(getEnvironmentRequestStatsRequest));
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const GetEnvironmentRequestStatsResponse$inboundSchema = z.object({
|
|
51
|
+
data: models.EnvironmentRequestStats$inboundSchema,
|
|
52
|
+
});
|
|
53
|
+
export function getEnvironmentRequestStatsResponseFromJSON(jsonString) {
|
|
54
|
+
return safeParse(jsonString, (x) => GetEnvironmentRequestStatsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentRequestStatsResponse' from JSON`);
|
|
55
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
4
|
+
import * as models from "../index.js";
|
|
5
|
+
export type GetEnvironmentRequestRequest = {
|
|
6
|
+
environmentId: string;
|
|
7
|
+
requestId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Recorded request with bounded payload previews
|
|
11
|
+
*/
|
|
12
|
+
export type GetEnvironmentRequestResponse = {
|
|
13
|
+
data: models.EnvironmentRequestDetail;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type GetEnvironmentRequestRequest$Outbound = {
|
|
17
|
+
environmentId: string;
|
|
18
|
+
requestId: string;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const GetEnvironmentRequestRequest$outboundSchema: z.ZodMiniType<GetEnvironmentRequestRequest$Outbound, GetEnvironmentRequestRequest>;
|
|
22
|
+
export declare function getEnvironmentRequestRequestToJSON(getEnvironmentRequestRequest: GetEnvironmentRequestRequest): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const GetEnvironmentRequestResponse$inboundSchema: z.ZodMiniType<GetEnvironmentRequestResponse, unknown>;
|
|
25
|
+
export declare function getEnvironmentRequestResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentRequestResponse, SDKValidationError>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const GetEnvironmentRequestRequest$outboundSchema = z.object({
|
|
9
|
+
environmentId: z.string(),
|
|
10
|
+
requestId: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export function getEnvironmentRequestRequestToJSON(getEnvironmentRequestRequest) {
|
|
13
|
+
return JSON.stringify(GetEnvironmentRequestRequest$outboundSchema.parse(getEnvironmentRequestRequest));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const GetEnvironmentRequestResponse$inboundSchema = z.object({
|
|
17
|
+
data: models.EnvironmentRequestDetail$inboundSchema,
|
|
18
|
+
});
|
|
19
|
+
export function getEnvironmentRequestResponseFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => GetEnvironmentRequestResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentRequestResponse' from JSON`);
|
|
21
|
+
}
|
|
@@ -5,15 +5,21 @@ export * from "./delete-snapshot.js";
|
|
|
5
5
|
export * from "./get-catalog.js";
|
|
6
6
|
export * from "./get-connection.js";
|
|
7
7
|
export * from "./get-credential.js";
|
|
8
|
+
export * from "./get-environment-request-payload.js";
|
|
9
|
+
export * from "./get-environment-request-stats.js";
|
|
10
|
+
export * from "./get-environment-request.js";
|
|
8
11
|
export * from "./get-environment.js";
|
|
9
12
|
export * from "./get-release.js";
|
|
10
13
|
export * from "./get-snapshot.js";
|
|
11
14
|
export * from "./get-workspace.js";
|
|
12
15
|
export * from "./list-environment-events.js";
|
|
16
|
+
export * from "./list-environment-requests.js";
|
|
13
17
|
export * from "./list-environments.js";
|
|
14
18
|
export * from "./list-snapshots.js";
|
|
15
19
|
export * from "./list-workspace-events.js";
|
|
16
20
|
export * from "./list-workspaces.js";
|
|
21
|
+
export * from "./resume-environment.js";
|
|
17
22
|
export * from "./reveal-connection.js";
|
|
18
23
|
export * from "./stop-environment.js";
|
|
24
|
+
export * from "./suspend-environment.js";
|
|
19
25
|
export * from "./update-snapshot.js";
|
|
@@ -8,15 +8,21 @@ export * from "./delete-snapshot.js";
|
|
|
8
8
|
export * from "./get-catalog.js";
|
|
9
9
|
export * from "./get-connection.js";
|
|
10
10
|
export * from "./get-credential.js";
|
|
11
|
+
export * from "./get-environment-request-payload.js";
|
|
12
|
+
export * from "./get-environment-request-stats.js";
|
|
13
|
+
export * from "./get-environment-request.js";
|
|
11
14
|
export * from "./get-environment.js";
|
|
12
15
|
export * from "./get-release.js";
|
|
13
16
|
export * from "./get-snapshot.js";
|
|
14
17
|
export * from "./get-workspace.js";
|
|
15
18
|
export * from "./list-environment-events.js";
|
|
19
|
+
export * from "./list-environment-requests.js";
|
|
16
20
|
export * from "./list-environments.js";
|
|
17
21
|
export * from "./list-snapshots.js";
|
|
18
22
|
export * from "./list-workspace-events.js";
|
|
19
23
|
export * from "./list-workspaces.js";
|
|
24
|
+
export * from "./resume-environment.js";
|
|
20
25
|
export * from "./reveal-connection.js";
|
|
21
26
|
export * from "./stop-environment.js";
|
|
27
|
+
export * from "./suspend-environment.js";
|
|
22
28
|
export * from "./update-snapshot.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
5
|
+
import * as models from "../index.js";
|
|
6
|
+
export declare const ListEnvironmentRequestsStatusClass: {
|
|
7
|
+
readonly Twoxx: "2xx";
|
|
8
|
+
readonly Threexx: "3xx";
|
|
9
|
+
readonly Fourxx: "4xx";
|
|
10
|
+
readonly Fivexx: "5xx";
|
|
11
|
+
};
|
|
12
|
+
export type ListEnvironmentRequestsStatusClass = ClosedEnum<typeof ListEnvironmentRequestsStatusClass>;
|
|
13
|
+
export declare const ListEnvironmentRequestsMethod: {
|
|
14
|
+
readonly Get: "GET";
|
|
15
|
+
readonly Head: "HEAD";
|
|
16
|
+
readonly Post: "POST";
|
|
17
|
+
readonly Put: "PUT";
|
|
18
|
+
readonly Patch: "PATCH";
|
|
19
|
+
readonly Delete: "DELETE";
|
|
20
|
+
readonly Options: "OPTIONS";
|
|
21
|
+
readonly Connect: "CONNECT";
|
|
22
|
+
readonly Trace: "TRACE";
|
|
23
|
+
};
|
|
24
|
+
export type ListEnvironmentRequestsMethod = ClosedEnum<typeof ListEnvironmentRequestsMethod>;
|
|
25
|
+
export declare const ListEnvironmentRequestsWritesOnly: {
|
|
26
|
+
readonly True: "true";
|
|
27
|
+
readonly False: "false";
|
|
28
|
+
};
|
|
29
|
+
export type ListEnvironmentRequestsWritesOnly = ClosedEnum<typeof ListEnvironmentRequestsWritesOnly>;
|
|
30
|
+
export type ListEnvironmentRequestsRequest = {
|
|
31
|
+
environmentId: string;
|
|
32
|
+
limit?: number | undefined;
|
|
33
|
+
cursor?: string | undefined;
|
|
34
|
+
appKey?: string | undefined;
|
|
35
|
+
status?: number | undefined;
|
|
36
|
+
statusClass?: ListEnvironmentRequestsStatusClass | undefined;
|
|
37
|
+
method?: ListEnvironmentRequestsMethod | undefined;
|
|
38
|
+
search?: string | undefined;
|
|
39
|
+
writesOnly?: ListEnvironmentRequestsWritesOnly | undefined;
|
|
40
|
+
from?: Date | undefined;
|
|
41
|
+
to?: Date | undefined;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Best-effort recorded replica requests, newest first
|
|
45
|
+
*/
|
|
46
|
+
export type ListEnvironmentRequestsResponse = {
|
|
47
|
+
data: Array<models.EnvironmentRequest>;
|
|
48
|
+
nextCursor: string | null;
|
|
49
|
+
};
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare const ListEnvironmentRequestsStatusClass$outboundSchema: z.ZodMiniEnum<typeof ListEnvironmentRequestsStatusClass>;
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const ListEnvironmentRequestsMethod$outboundSchema: z.ZodMiniEnum<typeof ListEnvironmentRequestsMethod>;
|
|
54
|
+
/** @internal */
|
|
55
|
+
export declare const ListEnvironmentRequestsWritesOnly$outboundSchema: z.ZodMiniEnum<typeof ListEnvironmentRequestsWritesOnly>;
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type ListEnvironmentRequestsRequest$Outbound = {
|
|
58
|
+
environmentId: string;
|
|
59
|
+
limit: number;
|
|
60
|
+
cursor?: string | undefined;
|
|
61
|
+
appKey?: string | undefined;
|
|
62
|
+
status?: number | undefined;
|
|
63
|
+
statusClass?: string | undefined;
|
|
64
|
+
method?: string | undefined;
|
|
65
|
+
search?: string | undefined;
|
|
66
|
+
writesOnly?: string | undefined;
|
|
67
|
+
from?: string | undefined;
|
|
68
|
+
to?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare const ListEnvironmentRequestsRequest$outboundSchema: z.ZodMiniType<ListEnvironmentRequestsRequest$Outbound, ListEnvironmentRequestsRequest>;
|
|
72
|
+
export declare function listEnvironmentRequestsRequestToJSON(listEnvironmentRequestsRequest: ListEnvironmentRequestsRequest): string;
|
|
73
|
+
/** @internal */
|
|
74
|
+
export declare const ListEnvironmentRequestsResponse$inboundSchema: z.ZodMiniType<ListEnvironmentRequestsResponse, unknown>;
|
|
75
|
+
export declare function listEnvironmentRequestsResponseFromJSON(jsonString: string): SafeParseResult<ListEnvironmentRequestsResponse, SDKValidationError>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import * as types from "../../types/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
export const ListEnvironmentRequestsStatusClass = {
|
|
9
|
+
Twoxx: "2xx",
|
|
10
|
+
Threexx: "3xx",
|
|
11
|
+
Fourxx: "4xx",
|
|
12
|
+
Fivexx: "5xx",
|
|
13
|
+
};
|
|
14
|
+
export const ListEnvironmentRequestsMethod = {
|
|
15
|
+
Get: "GET",
|
|
16
|
+
Head: "HEAD",
|
|
17
|
+
Post: "POST",
|
|
18
|
+
Put: "PUT",
|
|
19
|
+
Patch: "PATCH",
|
|
20
|
+
Delete: "DELETE",
|
|
21
|
+
Options: "OPTIONS",
|
|
22
|
+
Connect: "CONNECT",
|
|
23
|
+
Trace: "TRACE",
|
|
24
|
+
};
|
|
25
|
+
export const ListEnvironmentRequestsWritesOnly = {
|
|
26
|
+
True: "true",
|
|
27
|
+
False: "false",
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ListEnvironmentRequestsStatusClass$outboundSchema = z.enum(ListEnvironmentRequestsStatusClass);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const ListEnvironmentRequestsMethod$outboundSchema = z.enum(ListEnvironmentRequestsMethod);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const ListEnvironmentRequestsWritesOnly$outboundSchema = z.enum(ListEnvironmentRequestsWritesOnly);
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ListEnvironmentRequestsRequest$outboundSchema = z.object({
|
|
37
|
+
environmentId: z.string(),
|
|
38
|
+
limit: z._default(z.int(), 50),
|
|
39
|
+
cursor: z.optional(z.string()),
|
|
40
|
+
appKey: z.optional(z.string()),
|
|
41
|
+
status: z.optional(z.int()),
|
|
42
|
+
statusClass: z.optional(ListEnvironmentRequestsStatusClass$outboundSchema),
|
|
43
|
+
method: z.optional(ListEnvironmentRequestsMethod$outboundSchema),
|
|
44
|
+
search: z.optional(z.string()),
|
|
45
|
+
writesOnly: z.optional(ListEnvironmentRequestsWritesOnly$outboundSchema),
|
|
46
|
+
from: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
47
|
+
to: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
48
|
+
});
|
|
49
|
+
export function listEnvironmentRequestsRequestToJSON(listEnvironmentRequestsRequest) {
|
|
50
|
+
return JSON.stringify(ListEnvironmentRequestsRequest$outboundSchema.parse(listEnvironmentRequestsRequest));
|
|
51
|
+
}
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const ListEnvironmentRequestsResponse$inboundSchema = z.object({
|
|
54
|
+
data: z.array(models.EnvironmentRequest$inboundSchema),
|
|
55
|
+
nextCursor: types.nullable(types.string()),
|
|
56
|
+
});
|
|
57
|
+
export function listEnvironmentRequestsResponseFromJSON(jsonString) {
|
|
58
|
+
return safeParse(jsonString, (x) => ListEnvironmentRequestsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListEnvironmentRequestsResponse' from JSON`);
|
|
59
|
+
}
|