@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
|
@@ -1,28 +0,0 @@
|
|
|
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 ListEnvironmentHistoryRequest = {
|
|
6
|
-
environmentId: string;
|
|
7
|
-
limit?: number | undefined;
|
|
8
|
-
cursor?: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The environment's exchanges in gateway order, each with its transactions and events
|
|
12
|
-
*/
|
|
13
|
-
export type ListEnvironmentHistoryResponse = {
|
|
14
|
-
data: Array<models.EnvironmentExchange>;
|
|
15
|
-
nextCursor: string | null;
|
|
16
|
-
};
|
|
17
|
-
/** @internal */
|
|
18
|
-
export type ListEnvironmentHistoryRequest$Outbound = {
|
|
19
|
-
environmentId: string;
|
|
20
|
-
limit: number;
|
|
21
|
-
cursor?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare const ListEnvironmentHistoryRequest$outboundSchema: z.ZodMiniType<ListEnvironmentHistoryRequest$Outbound, ListEnvironmentHistoryRequest>;
|
|
25
|
-
export declare function listEnvironmentHistoryRequestToJSON(listEnvironmentHistoryRequest: ListEnvironmentHistoryRequest): string;
|
|
26
|
-
/** @internal */
|
|
27
|
-
export declare const ListEnvironmentHistoryResponse$inboundSchema: z.ZodMiniType<ListEnvironmentHistoryResponse, unknown>;
|
|
28
|
-
export declare function listEnvironmentHistoryResponseFromJSON(jsonString: string): SafeParseResult<ListEnvironmentHistoryResponse, SDKValidationError>;
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
/** @internal */
|
|
9
|
-
export const ListEnvironmentHistoryRequest$outboundSchema = z.object({
|
|
10
|
-
environmentId: z.string(),
|
|
11
|
-
limit: z._default(z.int(), 50),
|
|
12
|
-
cursor: z.optional(z.string()),
|
|
13
|
-
});
|
|
14
|
-
export function listEnvironmentHistoryRequestToJSON(listEnvironmentHistoryRequest) {
|
|
15
|
-
return JSON.stringify(ListEnvironmentHistoryRequest$outboundSchema.parse(listEnvironmentHistoryRequest));
|
|
16
|
-
}
|
|
17
|
-
/** @internal */
|
|
18
|
-
export const ListEnvironmentHistoryResponse$inboundSchema = z.object({
|
|
19
|
-
data: z.array(models.EnvironmentExchange$inboundSchema),
|
|
20
|
-
nextCursor: types.nullable(types.string()),
|
|
21
|
-
});
|
|
22
|
-
export function listEnvironmentHistoryResponseFromJSON(jsonString) {
|
|
23
|
-
return safeParse(jsonString, (x) => ListEnvironmentHistoryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListEnvironmentHistoryResponse' from JSON`);
|
|
24
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4-mini";
|
|
2
|
-
export type Unknown<Discriminator extends string, UnknownValue = "UNKNOWN"> = {
|
|
3
|
-
[K in Discriminator]: UnknownValue;
|
|
4
|
-
} & {
|
|
5
|
-
raw: unknown;
|
|
6
|
-
isUnknown: true;
|
|
7
|
-
};
|
|
8
|
-
export declare function isUnknown<Discriminator extends string>(value: unknown): value is Unknown<Discriminator>;
|
|
9
|
-
/**
|
|
10
|
-
* Forward-compatible discriminated union parser.
|
|
11
|
-
*
|
|
12
|
-
* If the input does not match one of the predefined options, it will be
|
|
13
|
-
* captured and available as `{ raw: <original input>, [discriminator]: "UNKNOWN", isUnknown: true }`.
|
|
14
|
-
*
|
|
15
|
-
* @param inputPropertyName - The discriminator property name in the input payload
|
|
16
|
-
* @param options - Map of discriminator values to their corresponding schemas
|
|
17
|
-
* @param opts - Optional configuration object
|
|
18
|
-
* @param opts.unknownValue - The value to use for the discriminator when the input is unknown (default: "UNKNOWN")
|
|
19
|
-
* @param opts.outputPropertyName - Output property name if the sanitized (camelCase) property name differs from inputPropertyName
|
|
20
|
-
*/
|
|
21
|
-
export declare function discriminatedUnion<InputDiscriminator extends string, TOptions extends Readonly<Record<string, z.ZodMiniType>>, UnknownValue extends string = "UNKNOWN", OutputDiscriminator extends string = InputDiscriminator>(inputPropertyName: InputDiscriminator, options: TOptions, opts?: {
|
|
22
|
-
unknownValue?: UnknownValue;
|
|
23
|
-
outputPropertyName?: OutputDiscriminator;
|
|
24
|
-
}): z.ZodMiniType<z.output<TOptions[keyof TOptions]> | Unknown<OutputDiscriminator, UnknownValue>, unknown>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v4-mini";
|
|
5
|
-
import { startCountingDefaultToZeroValue } from "./default-to-zero-value.js";
|
|
6
|
-
import { startCountingUnrecognized } from "./unrecognized.js";
|
|
7
|
-
const UNKNOWN = Symbol("UNKNOWN");
|
|
8
|
-
export function isUnknown(value) {
|
|
9
|
-
return typeof value === "object" && value !== null && UNKNOWN in value;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Forward-compatible discriminated union parser.
|
|
13
|
-
*
|
|
14
|
-
* If the input does not match one of the predefined options, it will be
|
|
15
|
-
* captured and available as `{ raw: <original input>, [discriminator]: "UNKNOWN", isUnknown: true }`.
|
|
16
|
-
*
|
|
17
|
-
* @param inputPropertyName - The discriminator property name in the input payload
|
|
18
|
-
* @param options - Map of discriminator values to their corresponding schemas
|
|
19
|
-
* @param opts - Optional configuration object
|
|
20
|
-
* @param opts.unknownValue - The value to use for the discriminator when the input is unknown (default: "UNKNOWN")
|
|
21
|
-
* @param opts.outputPropertyName - Output property name if the sanitized (camelCase) property name differs from inputPropertyName
|
|
22
|
-
*/
|
|
23
|
-
export function discriminatedUnion(inputPropertyName, options, opts = {}) {
|
|
24
|
-
const { unknownValue = "UNKNOWN", outputPropertyName } = opts;
|
|
25
|
-
return z.pipe(z.unknown(), z.transform((input) => {
|
|
26
|
-
const fallback = Object.defineProperties({
|
|
27
|
-
raw: input,
|
|
28
|
-
[outputPropertyName ?? inputPropertyName]: unknownValue,
|
|
29
|
-
isUnknown: true,
|
|
30
|
-
}, { [UNKNOWN]: { value: true, enumerable: false, configurable: false } });
|
|
31
|
-
const isObject = typeof input === "object" && input !== null;
|
|
32
|
-
if (!isObject)
|
|
33
|
-
return fallback;
|
|
34
|
-
const discriminator = input[inputPropertyName];
|
|
35
|
-
if (typeof discriminator !== "string")
|
|
36
|
-
return fallback;
|
|
37
|
-
if (!(discriminator in options))
|
|
38
|
-
return fallback;
|
|
39
|
-
const schema = options[discriminator];
|
|
40
|
-
if (!schema)
|
|
41
|
-
return fallback;
|
|
42
|
-
// Start counters before parsing to track nested unrecognized/zeroDefault values
|
|
43
|
-
const unrecognizedCtr = startCountingUnrecognized();
|
|
44
|
-
const zeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
45
|
-
const result = z.safeParse(schema, input);
|
|
46
|
-
if (!result.success) {
|
|
47
|
-
// Parse failed - don't propagate any counts from the failed attempt
|
|
48
|
-
unrecognizedCtr.end(0);
|
|
49
|
-
zeroDefaultCtr.end(0);
|
|
50
|
-
return fallback;
|
|
51
|
-
}
|
|
52
|
-
// Parse succeeded - propagate the actual counts
|
|
53
|
-
unrecognizedCtr.end();
|
|
54
|
-
zeroDefaultCtr.end();
|
|
55
|
-
if (outputPropertyName) {
|
|
56
|
-
result.data[outputPropertyName] = discriminator;
|
|
57
|
-
}
|
|
58
|
-
return result.data;
|
|
59
|
-
}));
|
|
60
|
-
}
|