@usestatemachines/sdk 0.4.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 +59 -6
- package/agents/index.js +2 -2
- package/agents/llms.txt +3 -2
- package/esm/extensions/client.d.ts +16 -4
- package/esm/extensions/client.js +17 -4
- package/esm/extensions/index.d.ts +2 -2
- package/esm/extensions/running-environment.d.ts +5 -5
- package/esm/extensions/running-environment.js +1 -1
- package/esm/extensions/wait.js +1 -1
- package/esm/funcs/{get-environment-exchange.d.ts → environments-get-request-payload.d.ts} +1 -1
- package/esm/funcs/environments-get-request-payload.js +100 -0
- package/esm/funcs/environments-get-request-stats.d.ts +11 -0
- package/esm/funcs/{get-environment-position.js → environments-get-request-stats.js} +17 -6
- package/esm/funcs/{list-environment-history.d.ts → environments-get-request.d.ts} +1 -1
- package/esm/funcs/{get-environment-exchange.js → environments-get-request.js} +6 -6
- package/esm/funcs/{get-environment-position.d.ts → environments-list-requests.d.ts} +1 -1
- package/esm/funcs/{list-environment-history.js → environments-list-requests.js} +13 -5
- package/esm/funcs/environments-resume.js +1 -0
- package/esm/funcs/environments-stop.js +1 -0
- package/esm/funcs/environments-suspend.js +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/environment-app.d.ts +0 -8
- package/esm/models/environment-app.js +0 -10
- 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/error-response.d.ts +0 -1
- package/esm/models/error-response.js +0 -1
- package/esm/models/index.d.ts +4 -6
- package/esm/models/index.js +4 -6
- package/esm/models/operations/create-environment-definition.d.ts +10 -82
- package/esm/models/operations/create-environment-definition.js +4 -60
- 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 +4 -3
- package/esm/models/operations/index.js +4 -3
- 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 +2 -0
- package/esm/models/operations/resume-environment.js +8 -2
- package/esm/models/operations/stop-environment.d.ts +2 -0
- package/esm/models/operations/stop-environment.js +8 -2
- package/esm/models/operations/suspend-environment.d.ts +2 -0
- package/esm/models/operations/suspend-environment.js +8 -2
- 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 +4 -0
- package/esm/sdk/environments.js +16 -0
- package/esm/sdk/sdk.d.ts +0 -3
- package/esm/sdk/sdk.js +0 -12
- package/esm/types/smart-union.js +1 -2
- package/openapi.json +584 -524
- package/package.json +2 -2
- package/esm/models/environment-exchange.d.ts +0 -116
- package/esm/models/environment-exchange.js +0 -126
- package/esm/models/environment-position.d.ts +0 -25
- package/esm/models/environment-position.js +0 -32
- package/esm/models/history-body.d.ts +0 -28
- package/esm/models/history-body.js +0 -33
- package/esm/models/history-cause.d.ts +0 -48
- package/esm/models/history-cause.js +0 -63
- package/esm/models/history-position.d.ts +0 -11
- package/esm/models/history-position.js +0 -15
- package/esm/models/history-transaction.d.ts +0 -16
- package/esm/models/history-transaction.js +0 -20
- package/esm/models/operations/get-environment-exchange.d.ts +0 -25
- package/esm/models/operations/get-environment-exchange.js +0 -21
- package/esm/models/operations/get-environment-position.d.ts +0 -23
- package/esm/models/operations/get-environment-position.js +0 -20
- package/esm/models/operations/list-environment-history.d.ts +0 -28
- package/esm/models/operations/list-environment-history.js +0 -24
- package/esm/types/discriminated-union.d.ts +0 -24
- package/esm/types/discriminated-union.js +0 -60
|
@@ -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 { encodeSimple } from "../lib/encodings.js";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } 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";
|
|
@@ -12,11 +12,11 @@ import { pathToFunc } from "../lib/url.js";
|
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
13
|
import * as operations from "../models/operations/index.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
|
-
export function
|
|
15
|
+
export function environmentsGetRequestStats(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.
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.GetEnvironmentRequestStatsRequest$outboundSchema, value), "Input validation failed");
|
|
20
20
|
if (!parsed.ok) {
|
|
21
21
|
return [parsed, { status: "invalid" }];
|
|
22
22
|
}
|
|
@@ -28,7 +28,17 @@ async function $do(client, request, options) {
|
|
|
28
28
|
charEncoding: "percent",
|
|
29
29
|
}),
|
|
30
30
|
};
|
|
31
|
-
const path = pathToFunc("/v1/environments/{environmentId}/
|
|
31
|
+
const path = pathToFunc("/v1/environments/{environmentId}/requests/stats")(pathParams);
|
|
32
|
+
const query = encodeFormQuery({
|
|
33
|
+
"appKey": payload.appKey,
|
|
34
|
+
"from": payload.from,
|
|
35
|
+
"method": payload.method,
|
|
36
|
+
"search": payload.search,
|
|
37
|
+
"status": payload.status,
|
|
38
|
+
"statusClass": payload.statusClass,
|
|
39
|
+
"to": payload.to,
|
|
40
|
+
"writesOnly": payload.writesOnly,
|
|
41
|
+
});
|
|
32
42
|
const headers = new Headers(compactMap({
|
|
33
43
|
Accept: "application/json",
|
|
34
44
|
}));
|
|
@@ -38,7 +48,7 @@ async function $do(client, request, options) {
|
|
|
38
48
|
const context = {
|
|
39
49
|
options: client._options,
|
|
40
50
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
41
|
-
operationID: "
|
|
51
|
+
operationID: "getEnvironmentRequestStats",
|
|
42
52
|
oAuth2Scopes: null,
|
|
43
53
|
resolvedSecurity: requestSecurity,
|
|
44
54
|
securitySource: client._options.apiKey,
|
|
@@ -63,6 +73,7 @@ async function $do(client, request, options) {
|
|
|
63
73
|
baseURL: options?.serverURL,
|
|
64
74
|
path: path,
|
|
65
75
|
headers: headers,
|
|
76
|
+
query: query,
|
|
66
77
|
body: body,
|
|
67
78
|
userAgent: client._options.userAgent,
|
|
68
79
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
@@ -84,7 +95,7 @@ async function $do(client, request, options) {
|
|
|
84
95
|
const responseFields = {
|
|
85
96
|
HttpMeta: { Response: response, Request: req },
|
|
86
97
|
};
|
|
87
|
-
const [result] = await M.match(M.json(200, operations.
|
|
98
|
+
const [result] = await M.match(M.json(200, operations.GetEnvironmentRequestStatsResponse$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
99
|
if (!result.ok) {
|
|
89
100
|
return [result, { status: "complete", request: req, response }];
|
|
90
101
|
}
|
|
@@ -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
|
|
11
|
+
export declare function environmentsGetRequest(client: StateMachinesCore, request: operations.GetEnvironmentRequestRequest, options?: RequestOptions): APIPromise<Result<operations.GetEnvironmentRequestResponse, errors.ErrorResponse | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -12,11 +12,11 @@ import { pathToFunc } from "../lib/url.js";
|
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
13
|
import * as operations from "../models/operations/index.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
|
-
export function
|
|
15
|
+
export function environmentsGetRequest(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.
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.GetEnvironmentRequestRequest$outboundSchema, value), "Input validation failed");
|
|
20
20
|
if (!parsed.ok) {
|
|
21
21
|
return [parsed, { status: "invalid" }];
|
|
22
22
|
}
|
|
@@ -27,12 +27,12 @@ async function $do(client, request, options) {
|
|
|
27
27
|
explode: false,
|
|
28
28
|
charEncoding: "percent",
|
|
29
29
|
}),
|
|
30
|
-
|
|
30
|
+
requestId: encodeSimple("requestId", payload.requestId, {
|
|
31
31
|
explode: false,
|
|
32
32
|
charEncoding: "percent",
|
|
33
33
|
}),
|
|
34
34
|
};
|
|
35
|
-
const path = pathToFunc("/v1/environments/{environmentId}/
|
|
35
|
+
const path = pathToFunc("/v1/environments/{environmentId}/requests/{requestId}")(pathParams);
|
|
36
36
|
const headers = new Headers(compactMap({
|
|
37
37
|
Accept: "application/json",
|
|
38
38
|
}));
|
|
@@ -42,7 +42,7 @@ async function $do(client, request, options) {
|
|
|
42
42
|
const context = {
|
|
43
43
|
options: client._options,
|
|
44
44
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
45
|
-
operationID: "
|
|
45
|
+
operationID: "getEnvironmentRequest",
|
|
46
46
|
oAuth2Scopes: null,
|
|
47
47
|
resolvedSecurity: requestSecurity,
|
|
48
48
|
securitySource: client._options.apiKey,
|
|
@@ -88,7 +88,7 @@ async function $do(client, request, options) {
|
|
|
88
88
|
const responseFields = {
|
|
89
89
|
HttpMeta: { Response: response, Request: req },
|
|
90
90
|
};
|
|
91
|
-
const [result] = await M.match(M.json(200, operations.
|
|
91
|
+
const [result] = await M.match(M.json(200, operations.GetEnvironmentRequestResponse$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 });
|
|
92
92
|
if (!result.ok) {
|
|
93
93
|
return [result, { status: "complete", request: req, response }];
|
|
94
94
|
}
|
|
@@ -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
|
|
11
|
+
export declare function environmentsListRequests(client: StateMachinesCore, request: operations.ListEnvironmentRequestsRequest, options?: RequestOptions): APIPromise<Result<operations.ListEnvironmentRequestsResponse, errors.ErrorResponse | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -12,11 +12,11 @@ import { pathToFunc } from "../lib/url.js";
|
|
|
12
12
|
import * as errors from "../models/errors/index.js";
|
|
13
13
|
import * as operations from "../models/operations/index.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
|
-
export function
|
|
15
|
+
export function environmentsListRequests(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.
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(operations.ListEnvironmentRequestsRequest$outboundSchema, value), "Input validation failed");
|
|
20
20
|
if (!parsed.ok) {
|
|
21
21
|
return [parsed, { status: "invalid" }];
|
|
22
22
|
}
|
|
@@ -28,10 +28,18 @@ async function $do(client, request, options) {
|
|
|
28
28
|
charEncoding: "percent",
|
|
29
29
|
}),
|
|
30
30
|
};
|
|
31
|
-
const path = pathToFunc("/v1/environments/{environmentId}/
|
|
31
|
+
const path = pathToFunc("/v1/environments/{environmentId}/requests")(pathParams);
|
|
32
32
|
const query = encodeFormQuery({
|
|
33
|
+
"appKey": payload.appKey,
|
|
33
34
|
"cursor": payload.cursor,
|
|
35
|
+
"from": payload.from,
|
|
34
36
|
"limit": payload.limit,
|
|
37
|
+
"method": payload.method,
|
|
38
|
+
"search": payload.search,
|
|
39
|
+
"status": payload.status,
|
|
40
|
+
"statusClass": payload.statusClass,
|
|
41
|
+
"to": payload.to,
|
|
42
|
+
"writesOnly": payload.writesOnly,
|
|
35
43
|
});
|
|
36
44
|
const headers = new Headers(compactMap({
|
|
37
45
|
Accept: "application/json",
|
|
@@ -42,7 +50,7 @@ async function $do(client, request, options) {
|
|
|
42
50
|
const context = {
|
|
43
51
|
options: client._options,
|
|
44
52
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
45
|
-
operationID: "
|
|
53
|
+
operationID: "listEnvironmentRequests",
|
|
46
54
|
oAuth2Scopes: null,
|
|
47
55
|
resolvedSecurity: requestSecurity,
|
|
48
56
|
securitySource: client._options.apiKey,
|
|
@@ -89,7 +97,7 @@ async function $do(client, request, options) {
|
|
|
89
97
|
const responseFields = {
|
|
90
98
|
HttpMeta: { Response: response, Request: req },
|
|
91
99
|
};
|
|
92
|
-
const [result] = await M.match(M.json(200, operations.
|
|
100
|
+
const [result] = await M.match(M.json(200, operations.ListEnvironmentRequestsResponse$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 });
|
|
93
101
|
if (!result.ok) {
|
|
94
102
|
return [result, { status: "complete", request: req, response }];
|
|
95
103
|
}
|
|
@@ -31,6 +31,7 @@ async function $do(client, request, options) {
|
|
|
31
31
|
const path = pathToFunc("/v1/environments/{environmentId}/resume")(pathParams);
|
|
32
32
|
const headers = new Headers(compactMap({
|
|
33
33
|
Accept: "application/json",
|
|
34
|
+
"idempotency-key": encodeSimple("idempotency-key", payload["idempotency-key"], { explode: false, charEncoding: "none" }),
|
|
34
35
|
}));
|
|
35
36
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
36
37
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -31,6 +31,7 @@ async function $do(client, request, options) {
|
|
|
31
31
|
const path = pathToFunc("/v1/environments/{environmentId}/stop")(pathParams);
|
|
32
32
|
const headers = new Headers(compactMap({
|
|
33
33
|
Accept: "application/json",
|
|
34
|
+
"idempotency-key": encodeSimple("idempotency-key", payload["idempotency-key"], { explode: false, charEncoding: "none" }),
|
|
34
35
|
}));
|
|
35
36
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
36
37
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -31,6 +31,7 @@ async function $do(client, request, options) {
|
|
|
31
31
|
const path = pathToFunc("/v1/environments/{environmentId}/suspend")(pathParams);
|
|
32
32
|
const headers = new Headers(compactMap({
|
|
33
33
|
Accept: "application/json",
|
|
34
|
+
"idempotency-key": encodeSimple("idempotency-key", payload["idempotency-key"], { explode: false, charEncoding: "none" }),
|
|
34
35
|
}));
|
|
35
36
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
36
37
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
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.5.0";
|
|
35
35
|
readonly genVersion: "2.941.0";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.5.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.5.0",
|
|
28
28
|
genVersion: "2.941.0",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.5.0 2.941.0 1.0.0 @usestatemachines/sdk",
|
|
30
30
|
};
|
|
@@ -9,10 +9,6 @@ export declare const Disposal: {
|
|
|
9
9
|
readonly Unknown: "unknown";
|
|
10
10
|
};
|
|
11
11
|
export type Disposal = OpenEnum<typeof Disposal>;
|
|
12
|
-
export type ForkedAt = {
|
|
13
|
-
generation: number;
|
|
14
|
-
lsn: string;
|
|
15
|
-
};
|
|
16
12
|
export declare const EnvironmentAppStatus: {
|
|
17
13
|
readonly Pending: "pending";
|
|
18
14
|
readonly Starting: "starting";
|
|
@@ -31,7 +27,6 @@ export type EnvironmentApp = {
|
|
|
31
27
|
disposal: Disposal;
|
|
32
28
|
errorCode: string | null;
|
|
33
29
|
expiresAt: Date | null;
|
|
34
|
-
forkedAt?: ForkedAt | null | undefined;
|
|
35
30
|
id: string;
|
|
36
31
|
key: string;
|
|
37
32
|
provider: string;
|
|
@@ -44,9 +39,6 @@ export type EnvironmentApp = {
|
|
|
44
39
|
/** @internal */
|
|
45
40
|
export declare const Disposal$inboundSchema: z.ZodMiniType<Disposal, unknown>;
|
|
46
41
|
/** @internal */
|
|
47
|
-
export declare const ForkedAt$inboundSchema: z.ZodMiniType<ForkedAt, unknown>;
|
|
48
|
-
export declare function forkedAtFromJSON(jsonString: string): SafeParseResult<ForkedAt, SDKValidationError>;
|
|
49
|
-
/** @internal */
|
|
50
42
|
export declare const EnvironmentAppStatus$inboundSchema: z.ZodMiniType<EnvironmentAppStatus, unknown>;
|
|
51
43
|
/** @internal */
|
|
52
44
|
export declare const EnvironmentApp$inboundSchema: z.ZodMiniType<EnvironmentApp, unknown>;
|
|
@@ -24,15 +24,6 @@ export const EnvironmentAppStatus = {
|
|
|
24
24
|
/** @internal */
|
|
25
25
|
export const Disposal$inboundSchema = openEnums.inboundSchema(Disposal);
|
|
26
26
|
/** @internal */
|
|
27
|
-
export const ForkedAt$inboundSchema = z
|
|
28
|
-
.object({
|
|
29
|
-
generation: types.number(),
|
|
30
|
-
lsn: types.string(),
|
|
31
|
-
});
|
|
32
|
-
export function forkedAtFromJSON(jsonString) {
|
|
33
|
-
return safeParse(jsonString, (x) => ForkedAt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForkedAt' from JSON`);
|
|
34
|
-
}
|
|
35
|
-
/** @internal */
|
|
36
27
|
export const EnvironmentAppStatus$inboundSchema = openEnums.inboundSchema(EnvironmentAppStatus);
|
|
37
28
|
/** @internal */
|
|
38
29
|
export const EnvironmentApp$inboundSchema = z.object({
|
|
@@ -42,7 +33,6 @@ export const EnvironmentApp$inboundSchema = z.object({
|
|
|
42
33
|
disposal: Disposal$inboundSchema,
|
|
43
34
|
errorCode: types.nullable(types.string()),
|
|
44
35
|
expiresAt: types.nullable(types.date()),
|
|
45
|
-
forkedAt: z.optional(z.nullable(z.lazy(() => ForkedAt$inboundSchema))),
|
|
46
36
|
id: types.string(),
|
|
47
37
|
key: types.string(),
|
|
48
38
|
provider: types.string(),
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
import { RequestPayloadPreview } from "./request-payload-preview.js";
|
|
6
|
+
export declare const EnvironmentRequestDetailOutcome: {
|
|
7
|
+
readonly ReplicaResponse: "replica_response";
|
|
8
|
+
readonly GatewayError: "gateway_error";
|
|
9
|
+
};
|
|
10
|
+
export type EnvironmentRequestDetailOutcome = OpenEnum<typeof EnvironmentRequestDetailOutcome>;
|
|
11
|
+
export type EnvironmentRequestDetail = {
|
|
12
|
+
appInstanceId: string | null;
|
|
13
|
+
appKey: string;
|
|
14
|
+
completedAt: Date;
|
|
15
|
+
durationMs: number;
|
|
16
|
+
environmentId: string;
|
|
17
|
+
errorCode: string | null;
|
|
18
|
+
id: string;
|
|
19
|
+
method: string;
|
|
20
|
+
outcome: EnvironmentRequestDetailOutcome;
|
|
21
|
+
path: string;
|
|
22
|
+
query: string;
|
|
23
|
+
receivedAt: Date;
|
|
24
|
+
requestBytes: number | null;
|
|
25
|
+
responseBytes: number | null;
|
|
26
|
+
status: number;
|
|
27
|
+
requestBody: RequestPayloadPreview;
|
|
28
|
+
requestHeaders: {
|
|
29
|
+
[k: string]: string;
|
|
30
|
+
};
|
|
31
|
+
responseBody: RequestPayloadPreview;
|
|
32
|
+
responseHeaders: {
|
|
33
|
+
[k: string]: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const EnvironmentRequestDetailOutcome$inboundSchema: z.ZodMiniType<EnvironmentRequestDetailOutcome, unknown>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const EnvironmentRequestDetail$inboundSchema: z.ZodMiniType<EnvironmentRequestDetail, unknown>;
|
|
40
|
+
export declare function environmentRequestDetailFromJSON(jsonString: string): SafeParseResult<EnvironmentRequestDetail, SDKValidationError>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { RequestPayloadPreview$inboundSchema, } from "./request-payload-preview.js";
|
|
9
|
+
export const EnvironmentRequestDetailOutcome = {
|
|
10
|
+
ReplicaResponse: "replica_response",
|
|
11
|
+
GatewayError: "gateway_error",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const EnvironmentRequestDetailOutcome$inboundSchema = openEnums.inboundSchema(EnvironmentRequestDetailOutcome);
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const EnvironmentRequestDetail$inboundSchema = z.object({
|
|
17
|
+
appInstanceId: types.nullable(types.string()),
|
|
18
|
+
appKey: types.string(),
|
|
19
|
+
completedAt: types.date(),
|
|
20
|
+
durationMs: types.number(),
|
|
21
|
+
environmentId: types.string(),
|
|
22
|
+
errorCode: types.nullable(types.string()),
|
|
23
|
+
id: types.string(),
|
|
24
|
+
method: types.string(),
|
|
25
|
+
outcome: EnvironmentRequestDetailOutcome$inboundSchema,
|
|
26
|
+
path: types.string(),
|
|
27
|
+
query: types.string(),
|
|
28
|
+
receivedAt: types.date(),
|
|
29
|
+
requestBytes: types.nullable(types.number()),
|
|
30
|
+
responseBytes: types.nullable(types.number()),
|
|
31
|
+
status: types.number(),
|
|
32
|
+
requestBody: RequestPayloadPreview$inboundSchema,
|
|
33
|
+
requestHeaders: z.record(z.string(), types.string()),
|
|
34
|
+
responseBody: RequestPayloadPreview$inboundSchema,
|
|
35
|
+
responseHeaders: z.record(z.string(), types.string()),
|
|
36
|
+
});
|
|
37
|
+
export function environmentRequestDetailFromJSON(jsonString) {
|
|
38
|
+
return safeParse(jsonString, (x) => EnvironmentRequestDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentRequestDetail' from JSON`);
|
|
39
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 Bucket = {
|
|
5
|
+
clientError: number;
|
|
6
|
+
from: Date;
|
|
7
|
+
serverError: number;
|
|
8
|
+
success: number;
|
|
9
|
+
};
|
|
10
|
+
export type EnvironmentRequestStats = {
|
|
11
|
+
buckets: Array<Bucket>;
|
|
12
|
+
clientErrorCount: number;
|
|
13
|
+
count: number;
|
|
14
|
+
from: Date;
|
|
15
|
+
p50Ms: number | null;
|
|
16
|
+
p95Ms: number | null;
|
|
17
|
+
serverErrorCount: number;
|
|
18
|
+
successCount: number;
|
|
19
|
+
to: Date;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const Bucket$inboundSchema: z.ZodMiniType<Bucket, unknown>;
|
|
23
|
+
export declare function bucketFromJSON(jsonString: string): SafeParseResult<Bucket, SDKValidationError>;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const EnvironmentRequestStats$inboundSchema: z.ZodMiniType<EnvironmentRequestStats, unknown>;
|
|
26
|
+
export declare function environmentRequestStatsFromJSON(jsonString: string): SafeParseResult<EnvironmentRequestStats, SDKValidationError>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 Bucket$inboundSchema = z.object({
|
|
9
|
+
clientError: types.number(),
|
|
10
|
+
from: types.date(),
|
|
11
|
+
serverError: types.number(),
|
|
12
|
+
success: types.number(),
|
|
13
|
+
});
|
|
14
|
+
export function bucketFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => Bucket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bucket' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const EnvironmentRequestStats$inboundSchema = z.object({
|
|
19
|
+
buckets: z.array(z.lazy(() => Bucket$inboundSchema)),
|
|
20
|
+
clientErrorCount: types.number(),
|
|
21
|
+
count: types.number(),
|
|
22
|
+
from: types.date(),
|
|
23
|
+
p50Ms: types.nullable(types.number()),
|
|
24
|
+
p95Ms: types.nullable(types.number()),
|
|
25
|
+
serverErrorCount: types.number(),
|
|
26
|
+
successCount: types.number(),
|
|
27
|
+
to: types.date(),
|
|
28
|
+
});
|
|
29
|
+
export function environmentRequestStatsFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => EnvironmentRequestStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentRequestStats' from JSON`);
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
export declare const EnvironmentRequestOutcome: {
|
|
6
|
+
readonly ReplicaResponse: "replica_response";
|
|
7
|
+
readonly GatewayError: "gateway_error";
|
|
8
|
+
};
|
|
9
|
+
export type EnvironmentRequestOutcome = OpenEnum<typeof EnvironmentRequestOutcome>;
|
|
10
|
+
export type EnvironmentRequest = {
|
|
11
|
+
appInstanceId: string | null;
|
|
12
|
+
appKey: string;
|
|
13
|
+
completedAt: Date;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
environmentId: string;
|
|
16
|
+
errorCode: string | null;
|
|
17
|
+
id: string;
|
|
18
|
+
method: string;
|
|
19
|
+
outcome: EnvironmentRequestOutcome;
|
|
20
|
+
path: string;
|
|
21
|
+
query: string;
|
|
22
|
+
receivedAt: Date;
|
|
23
|
+
requestBytes: number | null;
|
|
24
|
+
responseBytes: number | null;
|
|
25
|
+
status: number;
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const EnvironmentRequestOutcome$inboundSchema: z.ZodMiniType<EnvironmentRequestOutcome, unknown>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export declare const EnvironmentRequest$inboundSchema: z.ZodMiniType<EnvironmentRequest, unknown>;
|
|
31
|
+
export declare function environmentRequestFromJSON(jsonString: string): SafeParseResult<EnvironmentRequest, SDKValidationError>;
|
|
@@ -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
|
+
}
|
|
@@ -27,7 +27,6 @@ export declare const Code: {
|
|
|
27
27
|
readonly NotSnapshottable: "not-snapshottable";
|
|
28
28
|
readonly NotSuspended: "not-suspended";
|
|
29
29
|
readonly OrganizationRequired: "organization-required";
|
|
30
|
-
readonly PositionUnavailable: "position-unavailable";
|
|
31
30
|
readonly ReleaseGone: "release-gone";
|
|
32
31
|
readonly ReleaseLifecycle: "release-lifecycle";
|
|
33
32
|
readonly ReleaseUnavailable: "release-unavailable";
|
|
@@ -30,7 +30,6 @@ export const Code = {
|
|
|
30
30
|
NotSnapshottable: "not-snapshottable",
|
|
31
31
|
NotSuspended: "not-suspended",
|
|
32
32
|
OrganizationRequired: "organization-required",
|
|
33
|
-
PositionUnavailable: "position-unavailable",
|
|
34
33
|
ReleaseGone: "release-gone",
|
|
35
34
|
ReleaseLifecycle: "release-lifecycle",
|
|
36
35
|
ReleaseUnavailable: "release-unavailable",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -9,19 +9,17 @@ export * from "./create-environment-input.js";
|
|
|
9
9
|
export * from "./credential-kind.js";
|
|
10
10
|
export * from "./credential.js";
|
|
11
11
|
export * from "./environment-app.js";
|
|
12
|
-
export * from "./environment-exchange.js";
|
|
13
12
|
export * from "./environment-lifetime.js";
|
|
14
|
-
export * from "./environment-
|
|
13
|
+
export * from "./environment-request-detail.js";
|
|
14
|
+
export * from "./environment-request-stats.js";
|
|
15
|
+
export * from "./environment-request.js";
|
|
15
16
|
export * from "./environment-snapshot.js";
|
|
16
17
|
export * from "./environment.js";
|
|
17
18
|
export * from "./error-response.js";
|
|
18
19
|
export * from "./event-page.js";
|
|
19
20
|
export * from "./event.js";
|
|
20
|
-
export * from "./history-body.js";
|
|
21
|
-
export * from "./history-cause.js";
|
|
22
|
-
export * from "./history-position.js";
|
|
23
|
-
export * from "./history-transaction.js";
|
|
24
21
|
export * from "./release-actor.js";
|
|
25
22
|
export * from "./release.js";
|
|
23
|
+
export * from "./request-payload-preview.js";
|
|
26
24
|
export * from "./security.js";
|
|
27
25
|
export * from "./workspace.js";
|
package/esm/models/index.js
CHANGED
|
@@ -12,19 +12,17 @@ export * from "./create-environment-input.js";
|
|
|
12
12
|
export * from "./credential-kind.js";
|
|
13
13
|
export * from "./credential.js";
|
|
14
14
|
export * from "./environment-app.js";
|
|
15
|
-
export * from "./environment-exchange.js";
|
|
16
15
|
export * from "./environment-lifetime.js";
|
|
17
|
-
export * from "./environment-
|
|
16
|
+
export * from "./environment-request-detail.js";
|
|
17
|
+
export * from "./environment-request-stats.js";
|
|
18
|
+
export * from "./environment-request.js";
|
|
18
19
|
export * from "./environment-snapshot.js";
|
|
19
20
|
export * from "./environment.js";
|
|
20
21
|
export * from "./error-response.js";
|
|
21
22
|
export * from "./event-page.js";
|
|
22
23
|
export * from "./event.js";
|
|
23
|
-
export * from "./history-body.js";
|
|
24
|
-
export * from "./history-cause.js";
|
|
25
|
-
export * from "./history-position.js";
|
|
26
|
-
export * from "./history-transaction.js";
|
|
27
24
|
export * from "./release-actor.js";
|
|
28
25
|
export * from "./release.js";
|
|
26
|
+
export * from "./request-payload-preview.js";
|
|
29
27
|
export * from "./security.js";
|
|
30
28
|
export * from "./workspace.js";
|