@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.
Files changed (81) hide show
  1. package/README.md +59 -6
  2. package/agents/index.js +2 -2
  3. package/agents/llms.txt +3 -2
  4. package/esm/extensions/client.d.ts +16 -4
  5. package/esm/extensions/client.js +17 -4
  6. package/esm/extensions/index.d.ts +2 -2
  7. package/esm/extensions/running-environment.d.ts +5 -5
  8. package/esm/extensions/running-environment.js +1 -1
  9. package/esm/extensions/wait.js +1 -1
  10. package/esm/funcs/{get-environment-exchange.d.ts → environments-get-request-payload.d.ts} +1 -1
  11. package/esm/funcs/environments-get-request-payload.js +100 -0
  12. package/esm/funcs/environments-get-request-stats.d.ts +11 -0
  13. package/esm/funcs/{get-environment-position.js → environments-get-request-stats.js} +17 -6
  14. package/esm/funcs/{list-environment-history.d.ts → environments-get-request.d.ts} +1 -1
  15. package/esm/funcs/{get-environment-exchange.js → environments-get-request.js} +6 -6
  16. package/esm/funcs/{get-environment-position.d.ts → environments-list-requests.d.ts} +1 -1
  17. package/esm/funcs/{list-environment-history.js → environments-list-requests.js} +13 -5
  18. package/esm/funcs/environments-resume.js +1 -0
  19. package/esm/funcs/environments-stop.js +1 -0
  20. package/esm/funcs/environments-suspend.js +1 -0
  21. package/esm/lib/config.d.ts +2 -2
  22. package/esm/lib/config.js +2 -2
  23. package/esm/models/environment-app.d.ts +0 -8
  24. package/esm/models/environment-app.js +0 -10
  25. package/esm/models/environment-request-detail.d.ts +40 -0
  26. package/esm/models/environment-request-detail.js +39 -0
  27. package/esm/models/environment-request-stats.d.ts +26 -0
  28. package/esm/models/environment-request-stats.js +31 -0
  29. package/esm/models/environment-request.d.ts +31 -0
  30. package/esm/models/environment-request.js +34 -0
  31. package/esm/models/error-response.d.ts +0 -1
  32. package/esm/models/error-response.js +0 -1
  33. package/esm/models/index.d.ts +4 -6
  34. package/esm/models/index.js +4 -6
  35. package/esm/models/operations/create-environment-definition.d.ts +10 -82
  36. package/esm/models/operations/create-environment-definition.js +4 -60
  37. package/esm/models/operations/get-environment-request-payload.d.ts +23 -0
  38. package/esm/models/operations/get-environment-request-payload.js +19 -0
  39. package/esm/models/operations/get-environment-request-stats.d.ts +70 -0
  40. package/esm/models/operations/get-environment-request-stats.js +55 -0
  41. package/esm/models/operations/get-environment-request.d.ts +25 -0
  42. package/esm/models/operations/get-environment-request.js +21 -0
  43. package/esm/models/operations/index.d.ts +4 -3
  44. package/esm/models/operations/index.js +4 -3
  45. package/esm/models/operations/list-environment-requests.d.ts +75 -0
  46. package/esm/models/operations/list-environment-requests.js +59 -0
  47. package/esm/models/operations/resume-environment.d.ts +2 -0
  48. package/esm/models/operations/resume-environment.js +8 -2
  49. package/esm/models/operations/stop-environment.d.ts +2 -0
  50. package/esm/models/operations/stop-environment.js +8 -2
  51. package/esm/models/operations/suspend-environment.d.ts +2 -0
  52. package/esm/models/operations/suspend-environment.js +8 -2
  53. package/esm/models/request-payload-preview.d.ts +31 -0
  54. package/esm/models/request-payload-preview.js +33 -0
  55. package/esm/sdk/environments.d.ts +4 -0
  56. package/esm/sdk/environments.js +16 -0
  57. package/esm/sdk/sdk.d.ts +0 -3
  58. package/esm/sdk/sdk.js +0 -12
  59. package/esm/types/smart-union.js +1 -2
  60. package/openapi.json +584 -524
  61. package/package.json +2 -2
  62. package/esm/models/environment-exchange.d.ts +0 -116
  63. package/esm/models/environment-exchange.js +0 -126
  64. package/esm/models/environment-position.d.ts +0 -25
  65. package/esm/models/environment-position.js +0 -32
  66. package/esm/models/history-body.d.ts +0 -28
  67. package/esm/models/history-body.js +0 -33
  68. package/esm/models/history-cause.d.ts +0 -48
  69. package/esm/models/history-cause.js +0 -63
  70. package/esm/models/history-position.d.ts +0 -11
  71. package/esm/models/history-position.js +0 -15
  72. package/esm/models/history-transaction.d.ts +0 -16
  73. package/esm/models/history-transaction.js +0 -20
  74. package/esm/models/operations/get-environment-exchange.d.ts +0 -25
  75. package/esm/models/operations/get-environment-exchange.js +0 -21
  76. package/esm/models/operations/get-environment-position.d.ts +0 -23
  77. package/esm/models/operations/get-environment-position.js +0 -20
  78. package/esm/models/operations/list-environment-history.d.ts +0 -28
  79. package/esm/models/operations/list-environment-history.js +0 -24
  80. package/esm/types/discriminated-union.d.ts +0 -24
  81. package/esm/types/discriminated-union.js +0 -60
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usestatemachines/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK for State environments",
5
5
  "license": "MIT",
6
6
  "homepage": "https://usestatemachines.com",
@@ -39,7 +39,7 @@
39
39
  "vitest": "5.0.1"
40
40
  },
41
41
  "scripts": {
42
- "build": "tsgo",
42
+ "build": "node scripts/clean.mjs && tsgo",
43
43
  "typecheck": "tsgo -p tsconfig.check.json",
44
44
  "lint": "biome ci . && pnpm agents:check && node scripts/source-stamp.mjs --check",
45
45
  "generate": "speakeasy run -y --skip-versioning --skip-upload-spec --skip-compile && node scripts/source-stamp.mjs --write",
@@ -1,116 +0,0 @@
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 { HistoryBody } from "./history-body.js";
6
- import { HistoryPosition } from "./history-position.js";
7
- import { HistoryTransaction } from "./history-transaction.js";
8
- export type EnvironmentExchangeActor = {
9
- credentialId: string | null;
10
- vendorUserId: string | null;
11
- };
12
- export type Bodies = {
13
- request: HistoryBody;
14
- response: HistoryBody;
15
- };
16
- export declare const Channel: {
17
- readonly Api: "api";
18
- readonly Ui: "ui";
19
- readonly Reactor: "reactor";
20
- readonly Timer: "timer";
21
- readonly InboundWebhook: "inbound-webhook";
22
- readonly Bootstrap: "bootstrap";
23
- readonly Restore: "restore";
24
- };
25
- export type Channel = OpenEnum<typeof Channel>;
26
- export type Operation = {
27
- id: string | null;
28
- method: string;
29
- profile: string;
30
- route: string;
31
- target: string;
32
- };
33
- export declare const Refusal: {
34
- readonly Auth: "auth";
35
- readonly NotServed: "not-served";
36
- readonly Unsupported: "unsupported";
37
- readonly Limit: "limit";
38
- readonly Validation: "validation";
39
- readonly Conflict: "conflict";
40
- };
41
- export type Refusal = OpenEnum<typeof Refusal>;
42
- export type Outcome = {
43
- refusal: Refusal | null;
44
- status: number;
45
- vendorErrorCode: string | null;
46
- };
47
- export declare const State: {
48
- readonly Recorded: "recorded";
49
- readonly Unknown: "unknown";
50
- };
51
- export type State = OpenEnum<typeof State>;
52
- export declare const ClockSource: {
53
- readonly Gateway: "gateway";
54
- readonly Runner: "runner";
55
- };
56
- export type ClockSource = OpenEnum<typeof ClockSource>;
57
- export type Timing = {
58
- clockSource: ClockSource;
59
- databaseMs: number;
60
- environmentTime: string;
61
- handlerMs: number;
62
- leaseWaitMs: number;
63
- responseReadyAt: string;
64
- };
65
- export type Trace = {
66
- parentSpanId: string | null;
67
- spanId: string;
68
- traceId: string;
69
- };
70
- export type EnvironmentExchange = {
71
- actor: EnvironmentExchangeActor | null;
72
- appKey: string;
73
- bodies: Bodies | null;
74
- channel: Channel | null;
75
- eventIds: Array<string>;
76
- exchangeId: string;
77
- objectCount: number;
78
- objects: Array<string>;
79
- observedAt: Date;
80
- operation: Operation | null;
81
- outcome: Outcome | null;
82
- position: HistoryPosition;
83
- state: State;
84
- timing: Timing | null;
85
- trace: Trace | null;
86
- transactions: Array<HistoryTransaction>;
87
- };
88
- /** @internal */
89
- export declare const EnvironmentExchangeActor$inboundSchema: z.ZodMiniType<EnvironmentExchangeActor, unknown>;
90
- export declare function environmentExchangeActorFromJSON(jsonString: string): SafeParseResult<EnvironmentExchangeActor, SDKValidationError>;
91
- /** @internal */
92
- export declare const Bodies$inboundSchema: z.ZodMiniType<Bodies, unknown>;
93
- export declare function bodiesFromJSON(jsonString: string): SafeParseResult<Bodies, SDKValidationError>;
94
- /** @internal */
95
- export declare const Channel$inboundSchema: z.ZodMiniType<Channel, unknown>;
96
- /** @internal */
97
- export declare const Operation$inboundSchema: z.ZodMiniType<Operation, unknown>;
98
- export declare function operationFromJSON(jsonString: string): SafeParseResult<Operation, SDKValidationError>;
99
- /** @internal */
100
- export declare const Refusal$inboundSchema: z.ZodMiniType<Refusal, unknown>;
101
- /** @internal */
102
- export declare const Outcome$inboundSchema: z.ZodMiniType<Outcome, unknown>;
103
- export declare function outcomeFromJSON(jsonString: string): SafeParseResult<Outcome, SDKValidationError>;
104
- /** @internal */
105
- export declare const State$inboundSchema: z.ZodMiniType<State, unknown>;
106
- /** @internal */
107
- export declare const ClockSource$inboundSchema: z.ZodMiniType<ClockSource, unknown>;
108
- /** @internal */
109
- export declare const Timing$inboundSchema: z.ZodMiniType<Timing, unknown>;
110
- export declare function timingFromJSON(jsonString: string): SafeParseResult<Timing, SDKValidationError>;
111
- /** @internal */
112
- export declare const Trace$inboundSchema: z.ZodMiniType<Trace, unknown>;
113
- export declare function traceFromJSON(jsonString: string): SafeParseResult<Trace, SDKValidationError>;
114
- /** @internal */
115
- export declare const EnvironmentExchange$inboundSchema: z.ZodMiniType<EnvironmentExchange, unknown>;
116
- export declare function environmentExchangeFromJSON(jsonString: string): SafeParseResult<EnvironmentExchange, SDKValidationError>;
@@ -1,126 +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 openEnums from "../types/enums.js";
7
- import * as types from "../types/primitives.js";
8
- import { HistoryBody$inboundSchema } from "./history-body.js";
9
- import { HistoryPosition$inboundSchema, } from "./history-position.js";
10
- import { HistoryTransaction$inboundSchema, } from "./history-transaction.js";
11
- export const Channel = {
12
- Api: "api",
13
- Ui: "ui",
14
- Reactor: "reactor",
15
- Timer: "timer",
16
- InboundWebhook: "inbound-webhook",
17
- Bootstrap: "bootstrap",
18
- Restore: "restore",
19
- };
20
- export const Refusal = {
21
- Auth: "auth",
22
- NotServed: "not-served",
23
- Unsupported: "unsupported",
24
- Limit: "limit",
25
- Validation: "validation",
26
- Conflict: "conflict",
27
- };
28
- export const State = {
29
- Recorded: "recorded",
30
- Unknown: "unknown",
31
- };
32
- export const ClockSource = {
33
- Gateway: "gateway",
34
- Runner: "runner",
35
- };
36
- /** @internal */
37
- export const EnvironmentExchangeActor$inboundSchema = z.object({
38
- credentialId: types.nullable(types.string()),
39
- vendorUserId: types.nullable(types.string()),
40
- });
41
- export function environmentExchangeActorFromJSON(jsonString) {
42
- return safeParse(jsonString, (x) => EnvironmentExchangeActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentExchangeActor' from JSON`);
43
- }
44
- /** @internal */
45
- export const Bodies$inboundSchema = z.object({
46
- request: HistoryBody$inboundSchema,
47
- response: HistoryBody$inboundSchema,
48
- });
49
- export function bodiesFromJSON(jsonString) {
50
- return safeParse(jsonString, (x) => Bodies$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bodies' from JSON`);
51
- }
52
- /** @internal */
53
- export const Channel$inboundSchema = openEnums
54
- .inboundSchema(Channel);
55
- /** @internal */
56
- export const Operation$inboundSchema = z
57
- .object({
58
- id: types.nullable(types.string()),
59
- method: types.string(),
60
- profile: types.string(),
61
- route: types.string(),
62
- target: types.string(),
63
- });
64
- export function operationFromJSON(jsonString) {
65
- return safeParse(jsonString, (x) => Operation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Operation' from JSON`);
66
- }
67
- /** @internal */
68
- export const Refusal$inboundSchema = openEnums
69
- .inboundSchema(Refusal);
70
- /** @internal */
71
- export const Outcome$inboundSchema = z.object({
72
- refusal: types.nullable(Refusal$inboundSchema),
73
- status: types.number(),
74
- vendorErrorCode: types.nullable(types.string()),
75
- });
76
- export function outcomeFromJSON(jsonString) {
77
- return safeParse(jsonString, (x) => Outcome$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Outcome' from JSON`);
78
- }
79
- /** @internal */
80
- export const State$inboundSchema = openEnums
81
- .inboundSchema(State);
82
- /** @internal */
83
- export const ClockSource$inboundSchema = openEnums.inboundSchema(ClockSource);
84
- /** @internal */
85
- export const Timing$inboundSchema = z.object({
86
- clockSource: ClockSource$inboundSchema,
87
- databaseMs: types.number(),
88
- environmentTime: types.string(),
89
- handlerMs: types.number(),
90
- leaseWaitMs: types.number(),
91
- responseReadyAt: types.string(),
92
- });
93
- export function timingFromJSON(jsonString) {
94
- return safeParse(jsonString, (x) => Timing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Timing' from JSON`);
95
- }
96
- /** @internal */
97
- export const Trace$inboundSchema = z.object({
98
- parentSpanId: types.nullable(types.string()),
99
- spanId: types.string(),
100
- traceId: types.string(),
101
- });
102
- export function traceFromJSON(jsonString) {
103
- return safeParse(jsonString, (x) => Trace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Trace' from JSON`);
104
- }
105
- /** @internal */
106
- export const EnvironmentExchange$inboundSchema = z.object({
107
- actor: types.nullable(z.lazy(() => EnvironmentExchangeActor$inboundSchema)),
108
- appKey: types.string(),
109
- bodies: types.nullable(z.lazy(() => Bodies$inboundSchema)),
110
- channel: types.nullable(Channel$inboundSchema),
111
- eventIds: z.array(types.string()),
112
- exchangeId: types.string(),
113
- objectCount: types.number(),
114
- objects: z.array(types.string()),
115
- observedAt: types.date(),
116
- operation: types.nullable(z.lazy(() => Operation$inboundSchema)),
117
- outcome: types.nullable(z.lazy(() => Outcome$inboundSchema)),
118
- position: HistoryPosition$inboundSchema,
119
- state: State$inboundSchema,
120
- timing: types.nullable(z.lazy(() => Timing$inboundSchema)),
121
- trace: types.nullable(z.lazy(() => Trace$inboundSchema)),
122
- transactions: z.array(HistoryTransaction$inboundSchema),
123
- });
124
- export function environmentExchangeFromJSON(jsonString) {
125
- return safeParse(jsonString, (x) => EnvironmentExchange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentExchange' from JSON`);
126
- }
@@ -1,25 +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
- export type Position = {
5
- generation: number;
6
- lsn: string;
7
- };
8
- export type EnvironmentPositionApp = {
9
- appInstanceId: string;
10
- key: string;
11
- position: Position | null;
12
- };
13
- export type EnvironmentPosition = {
14
- apps: Array<EnvironmentPositionApp>;
15
- environmentId: string;
16
- };
17
- /** @internal */
18
- export declare const Position$inboundSchema: z.ZodMiniType<Position, unknown>;
19
- export declare function positionFromJSON(jsonString: string): SafeParseResult<Position, SDKValidationError>;
20
- /** @internal */
21
- export declare const EnvironmentPositionApp$inboundSchema: z.ZodMiniType<EnvironmentPositionApp, unknown>;
22
- export declare function environmentPositionAppFromJSON(jsonString: string): SafeParseResult<EnvironmentPositionApp, SDKValidationError>;
23
- /** @internal */
24
- export declare const EnvironmentPosition$inboundSchema: z.ZodMiniType<EnvironmentPosition, unknown>;
25
- export declare function environmentPositionFromJSON(jsonString: string): SafeParseResult<EnvironmentPosition, SDKValidationError>;
@@ -1,32 +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
- /** @internal */
8
- export const Position$inboundSchema = z
9
- .object({
10
- generation: types.number(),
11
- lsn: types.string(),
12
- });
13
- export function positionFromJSON(jsonString) {
14
- return safeParse(jsonString, (x) => Position$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Position' from JSON`);
15
- }
16
- /** @internal */
17
- export const EnvironmentPositionApp$inboundSchema = z.object({
18
- appInstanceId: types.string(),
19
- key: types.string(),
20
- position: types.nullable(z.lazy(() => Position$inboundSchema)),
21
- });
22
- export function environmentPositionAppFromJSON(jsonString) {
23
- return safeParse(jsonString, (x) => EnvironmentPositionApp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentPositionApp' from JSON`);
24
- }
25
- /** @internal */
26
- export const EnvironmentPosition$inboundSchema = z.object({
27
- apps: z.array(z.lazy(() => EnvironmentPositionApp$inboundSchema)),
28
- environmentId: types.string(),
29
- });
30
- export function environmentPositionFromJSON(jsonString) {
31
- return safeParse(jsonString, (x) => EnvironmentPosition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentPosition' from JSON`);
32
- }
@@ -1,28 +0,0 @@
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 type BlobT = {
6
- bytes: number;
7
- sha256: string;
8
- };
9
- export declare const Coverage: {
10
- readonly Complete: "complete";
11
- readonly Redacted: "redacted";
12
- readonly Truncated: "truncated";
13
- readonly Omitted: "omitted";
14
- };
15
- export type Coverage = OpenEnum<typeof Coverage>;
16
- export type HistoryBody = {
17
- blob: BlobT | null;
18
- coverage: Coverage;
19
- inline: string | null;
20
- };
21
- /** @internal */
22
- export declare const BlobT$inboundSchema: z.ZodMiniType<BlobT, unknown>;
23
- export declare function blobFromJSON(jsonString: string): SafeParseResult<BlobT, SDKValidationError>;
24
- /** @internal */
25
- export declare const Coverage$inboundSchema: z.ZodMiniType<Coverage, unknown>;
26
- /** @internal */
27
- export declare const HistoryBody$inboundSchema: z.ZodMiniType<HistoryBody, unknown>;
28
- export declare function historyBodyFromJSON(jsonString: string): SafeParseResult<HistoryBody, SDKValidationError>;
@@ -1,33 +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 openEnums from "../types/enums.js";
7
- import * as types from "../types/primitives.js";
8
- export const Coverage = {
9
- Complete: "complete",
10
- Redacted: "redacted",
11
- Truncated: "truncated",
12
- Omitted: "omitted",
13
- };
14
- /** @internal */
15
- export const BlobT$inboundSchema = z.object({
16
- bytes: types.number(),
17
- sha256: types.string(),
18
- });
19
- export function blobFromJSON(jsonString) {
20
- return safeParse(jsonString, (x) => BlobT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BlobT' from JSON`);
21
- }
22
- /** @internal */
23
- export const Coverage$inboundSchema = openEnums.inboundSchema(Coverage);
24
- /** @internal */
25
- export const HistoryBody$inboundSchema = z
26
- .object({
27
- blob: types.nullable(z.lazy(() => BlobT$inboundSchema)),
28
- coverage: Coverage$inboundSchema,
29
- inline: types.nullable(types.string()),
30
- });
31
- export function historyBodyFromJSON(jsonString) {
32
- return safeParse(jsonString, (x) => HistoryBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryBody' from JSON`);
33
- }
@@ -1,48 +0,0 @@
1
- import * as z from "zod/v4-mini";
2
- import * as discriminatedUnionTypes from "../types/discriminated-union.js";
3
- import { Result as SafeParseResult } from "../types/fp.js";
4
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
- export type HistoryCauseBootstrap = {
6
- kind: "bootstrap";
7
- };
8
- export type HistoryCauseRestore = {
9
- fromGeneration: number;
10
- kind: "restore";
11
- lsn: string;
12
- };
13
- export type HistoryCauseTimer = {
14
- depth: number;
15
- kind: "timer";
16
- rootExchangeId: string | null;
17
- timerId: string;
18
- };
19
- export type HistoryCauseReactor = {
20
- depth: number;
21
- eventId: string;
22
- kind: "reactor";
23
- reactor: string;
24
- rootExchangeId: string | null;
25
- };
26
- export type HistoryCauseExchange = {
27
- exchangeId: string;
28
- kind: "exchange";
29
- };
30
- export type HistoryCause = HistoryCauseExchange | HistoryCauseReactor | HistoryCauseTimer | HistoryCauseRestore | HistoryCauseBootstrap | discriminatedUnionTypes.Unknown<"kind">;
31
- /** @internal */
32
- export declare const HistoryCauseBootstrap$inboundSchema: z.ZodMiniType<HistoryCauseBootstrap, unknown>;
33
- export declare function historyCauseBootstrapFromJSON(jsonString: string): SafeParseResult<HistoryCauseBootstrap, SDKValidationError>;
34
- /** @internal */
35
- export declare const HistoryCauseRestore$inboundSchema: z.ZodMiniType<HistoryCauseRestore, unknown>;
36
- export declare function historyCauseRestoreFromJSON(jsonString: string): SafeParseResult<HistoryCauseRestore, SDKValidationError>;
37
- /** @internal */
38
- export declare const HistoryCauseTimer$inboundSchema: z.ZodMiniType<HistoryCauseTimer, unknown>;
39
- export declare function historyCauseTimerFromJSON(jsonString: string): SafeParseResult<HistoryCauseTimer, SDKValidationError>;
40
- /** @internal */
41
- export declare const HistoryCauseReactor$inboundSchema: z.ZodMiniType<HistoryCauseReactor, unknown>;
42
- export declare function historyCauseReactorFromJSON(jsonString: string): SafeParseResult<HistoryCauseReactor, SDKValidationError>;
43
- /** @internal */
44
- export declare const HistoryCauseExchange$inboundSchema: z.ZodMiniType<HistoryCauseExchange, unknown>;
45
- export declare function historyCauseExchangeFromJSON(jsonString: string): SafeParseResult<HistoryCauseExchange, SDKValidationError>;
46
- /** @internal */
47
- export declare const HistoryCause$inboundSchema: z.ZodMiniType<HistoryCause, unknown>;
48
- export declare function historyCauseFromJSON(jsonString: string): SafeParseResult<HistoryCause, SDKValidationError>;
@@ -1,63 +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 { discriminatedUnion } from "../types/discriminated-union.js";
7
- import * as types from "../types/primitives.js";
8
- /** @internal */
9
- export const HistoryCauseBootstrap$inboundSchema = z.object({
10
- kind: types.literal("bootstrap"),
11
- });
12
- export function historyCauseBootstrapFromJSON(jsonString) {
13
- return safeParse(jsonString, (x) => HistoryCauseBootstrap$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCauseBootstrap' from JSON`);
14
- }
15
- /** @internal */
16
- export const HistoryCauseRestore$inboundSchema = z.object({
17
- fromGeneration: types.number(),
18
- kind: types.literal("restore"),
19
- lsn: types.string(),
20
- });
21
- export function historyCauseRestoreFromJSON(jsonString) {
22
- return safeParse(jsonString, (x) => HistoryCauseRestore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCauseRestore' from JSON`);
23
- }
24
- /** @internal */
25
- export const HistoryCauseTimer$inboundSchema = z.object({
26
- depth: types.number(),
27
- kind: types.literal("timer"),
28
- rootExchangeId: types.nullable(types.string()),
29
- timerId: types.string(),
30
- });
31
- export function historyCauseTimerFromJSON(jsonString) {
32
- return safeParse(jsonString, (x) => HistoryCauseTimer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCauseTimer' from JSON`);
33
- }
34
- /** @internal */
35
- export const HistoryCauseReactor$inboundSchema = z.object({
36
- depth: types.number(),
37
- eventId: types.string(),
38
- kind: types.literal("reactor"),
39
- reactor: types.string(),
40
- rootExchangeId: types.nullable(types.string()),
41
- });
42
- export function historyCauseReactorFromJSON(jsonString) {
43
- return safeParse(jsonString, (x) => HistoryCauseReactor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCauseReactor' from JSON`);
44
- }
45
- /** @internal */
46
- export const HistoryCauseExchange$inboundSchema = z.object({
47
- exchangeId: types.string(),
48
- kind: types.literal("exchange"),
49
- });
50
- export function historyCauseExchangeFromJSON(jsonString) {
51
- return safeParse(jsonString, (x) => HistoryCauseExchange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCauseExchange' from JSON`);
52
- }
53
- /** @internal */
54
- export const HistoryCause$inboundSchema = discriminatedUnion("kind", {
55
- exchange: z.lazy(() => HistoryCauseExchange$inboundSchema),
56
- reactor: z.lazy(() => HistoryCauseReactor$inboundSchema),
57
- timer: z.lazy(() => HistoryCauseTimer$inboundSchema),
58
- restore: z.lazy(() => HistoryCauseRestore$inboundSchema),
59
- bootstrap: z.lazy(() => HistoryCauseBootstrap$inboundSchema),
60
- });
61
- export function historyCauseFromJSON(jsonString) {
62
- return safeParse(jsonString, (x) => HistoryCause$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryCause' from JSON`);
63
- }
@@ -1,11 +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
- export type HistoryPosition = {
5
- generation: number;
6
- lsn: string;
7
- until: string | null;
8
- };
9
- /** @internal */
10
- export declare const HistoryPosition$inboundSchema: z.ZodMiniType<HistoryPosition, unknown>;
11
- export declare function historyPositionFromJSON(jsonString: string): SafeParseResult<HistoryPosition, SDKValidationError>;
@@ -1,15 +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
- /** @internal */
8
- export const HistoryPosition$inboundSchema = z.object({
9
- generation: types.number(),
10
- lsn: types.string(),
11
- until: types.nullable(types.string()),
12
- });
13
- export function historyPositionFromJSON(jsonString) {
14
- return safeParse(jsonString, (x) => HistoryPosition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryPosition' from JSON`);
15
- }
@@ -1,16 +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 { HistoryCause } from "./history-cause.js";
5
- export type HistoryTransaction = {
6
- cause: HistoryCause | null;
7
- changes: number;
8
- committedAt: Date;
9
- generation: number;
10
- lsn: string;
11
- tables: Array<string>;
12
- xid: number;
13
- };
14
- /** @internal */
15
- export declare const HistoryTransaction$inboundSchema: z.ZodMiniType<HistoryTransaction, unknown>;
16
- export declare function historyTransactionFromJSON(jsonString: string): SafeParseResult<HistoryTransaction, SDKValidationError>;
@@ -1,20 +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 { HistoryCause$inboundSchema } from "./history-cause.js";
8
- /** @internal */
9
- export const HistoryTransaction$inboundSchema = z.object({
10
- cause: types.nullable(HistoryCause$inboundSchema),
11
- changes: types.number(),
12
- committedAt: types.date(),
13
- generation: types.number(),
14
- lsn: types.string(),
15
- tables: z.array(types.string()),
16
- xid: types.number(),
17
- });
18
- export function historyTransactionFromJSON(jsonString) {
19
- return safeParse(jsonString, (x) => HistoryTransaction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryTransaction' from JSON`);
20
- }
@@ -1,25 +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 GetEnvironmentExchangeRequest = {
6
- environmentId: string;
7
- exchangeId: string;
8
- };
9
- /**
10
- * One exchange of the environment, with the position a fork after it starts from
11
- */
12
- export type GetEnvironmentExchangeResponse = {
13
- data: models.EnvironmentExchange;
14
- };
15
- /** @internal */
16
- export type GetEnvironmentExchangeRequest$Outbound = {
17
- environmentId: string;
18
- exchangeId: string;
19
- };
20
- /** @internal */
21
- export declare const GetEnvironmentExchangeRequest$outboundSchema: z.ZodMiniType<GetEnvironmentExchangeRequest$Outbound, GetEnvironmentExchangeRequest>;
22
- export declare function getEnvironmentExchangeRequestToJSON(getEnvironmentExchangeRequest: GetEnvironmentExchangeRequest): string;
23
- /** @internal */
24
- export declare const GetEnvironmentExchangeResponse$inboundSchema: z.ZodMiniType<GetEnvironmentExchangeResponse, unknown>;
25
- export declare function getEnvironmentExchangeResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentExchangeResponse, SDKValidationError>;
@@ -1,21 +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 models from "../index.js";
7
- /** @internal */
8
- export const GetEnvironmentExchangeRequest$outboundSchema = z.object({
9
- environmentId: z.string(),
10
- exchangeId: z.string(),
11
- });
12
- export function getEnvironmentExchangeRequestToJSON(getEnvironmentExchangeRequest) {
13
- return JSON.stringify(GetEnvironmentExchangeRequest$outboundSchema.parse(getEnvironmentExchangeRequest));
14
- }
15
- /** @internal */
16
- export const GetEnvironmentExchangeResponse$inboundSchema = z.object({
17
- data: models.EnvironmentExchange$inboundSchema,
18
- });
19
- export function getEnvironmentExchangeResponseFromJSON(jsonString) {
20
- return safeParse(jsonString, (x) => GetEnvironmentExchangeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentExchangeResponse' from JSON`);
21
- }
@@ -1,23 +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 GetEnvironmentPositionRequest = {
6
- environmentId: string;
7
- };
8
- /**
9
- * Each app's current head position, as a fork from it would start
10
- */
11
- export type GetEnvironmentPositionResponse = {
12
- data: models.EnvironmentPosition;
13
- };
14
- /** @internal */
15
- export type GetEnvironmentPositionRequest$Outbound = {
16
- environmentId: string;
17
- };
18
- /** @internal */
19
- export declare const GetEnvironmentPositionRequest$outboundSchema: z.ZodMiniType<GetEnvironmentPositionRequest$Outbound, GetEnvironmentPositionRequest>;
20
- export declare function getEnvironmentPositionRequestToJSON(getEnvironmentPositionRequest: GetEnvironmentPositionRequest): string;
21
- /** @internal */
22
- export declare const GetEnvironmentPositionResponse$inboundSchema: z.ZodMiniType<GetEnvironmentPositionResponse, unknown>;
23
- export declare function getEnvironmentPositionResponseFromJSON(jsonString: string): SafeParseResult<GetEnvironmentPositionResponse, SDKValidationError>;
@@ -1,20 +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 models from "../index.js";
7
- /** @internal */
8
- export const GetEnvironmentPositionRequest$outboundSchema = z.object({
9
- environmentId: z.string(),
10
- });
11
- export function getEnvironmentPositionRequestToJSON(getEnvironmentPositionRequest) {
12
- return JSON.stringify(GetEnvironmentPositionRequest$outboundSchema.parse(getEnvironmentPositionRequest));
13
- }
14
- /** @internal */
15
- export const GetEnvironmentPositionResponse$inboundSchema = z.object({
16
- data: models.EnvironmentPosition$inboundSchema,
17
- });
18
- export function getEnvironmentPositionResponseFromJSON(jsonString) {
19
- return safeParse(jsonString, (x) => GetEnvironmentPositionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEnvironmentPositionResponse' from JSON`);
20
- }