@usestatemachines/sdk 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +311 -0
  3. package/agents/SKILL.md +90 -0
  4. package/agents/index.d.ts +13 -0
  5. package/agents/index.js +22 -0
  6. package/agents/llms.txt +93 -0
  7. package/agents/prompt.md +49 -0
  8. package/esm/core.d.ts +9 -0
  9. package/esm/core.js +12 -0
  10. package/esm/extensions/client.d.ts +81 -0
  11. package/esm/extensions/client.js +213 -0
  12. package/esm/extensions/connection.d.ts +42 -0
  13. package/esm/extensions/connection.js +133 -0
  14. package/esm/extensions/errors.d.ts +52 -0
  15. package/esm/extensions/errors.js +129 -0
  16. package/esm/extensions/index.d.ts +11 -0
  17. package/esm/extensions/index.js +7 -0
  18. package/esm/extensions/signal.d.ts +14 -0
  19. package/esm/extensions/signal.js +29 -0
  20. package/esm/extensions/wait.d.ts +19 -0
  21. package/esm/extensions/wait.js +102 -0
  22. package/esm/funcs/catalog-get.d.ts +11 -0
  23. package/esm/funcs/catalog-get.js +76 -0
  24. package/esm/funcs/catalog-release.d.ts +11 -0
  25. package/esm/funcs/catalog-release.js +92 -0
  26. package/esm/funcs/credential-get.d.ts +11 -0
  27. package/esm/funcs/credential-get.js +76 -0
  28. package/esm/funcs/environments-create.d.ts +11 -0
  29. package/esm/funcs/environments-create.js +94 -0
  30. package/esm/funcs/environments-events.d.ts +12 -0
  31. package/esm/funcs/environments-events.js +98 -0
  32. package/esm/funcs/environments-get-connection.d.ts +11 -0
  33. package/esm/funcs/environments-get-connection.js +96 -0
  34. package/esm/funcs/environments-get.d.ts +11 -0
  35. package/esm/funcs/environments-get.js +92 -0
  36. package/esm/funcs/environments-list.d.ts +11 -0
  37. package/esm/funcs/environments-list.js +100 -0
  38. package/esm/funcs/environments-reveal.d.ts +11 -0
  39. package/esm/funcs/environments-reveal.js +97 -0
  40. package/esm/funcs/environments-stop.d.ts +11 -0
  41. package/esm/funcs/environments-stop.js +92 -0
  42. package/esm/funcs/workspaces-events.d.ts +12 -0
  43. package/esm/funcs/workspaces-events.js +98 -0
  44. package/esm/funcs/workspaces-get.d.ts +11 -0
  45. package/esm/funcs/workspaces-get.js +92 -0
  46. package/esm/funcs/workspaces-list.d.ts +11 -0
  47. package/esm/funcs/workspaces-list.js +90 -0
  48. package/esm/hooks/hooks.d.ts +24 -0
  49. package/esm/hooks/hooks.js +79 -0
  50. package/esm/hooks/index.d.ts +2 -0
  51. package/esm/hooks/index.js +5 -0
  52. package/esm/hooks/types.d.ts +76 -0
  53. package/esm/hooks/types.js +4 -0
  54. package/esm/index.d.ts +5 -0
  55. package/esm/index.js +7 -0
  56. package/esm/lib/base64.d.ts +9 -0
  57. package/esm/lib/base64.js +30 -0
  58. package/esm/lib/config.d.ts +37 -0
  59. package/esm/lib/config.js +30 -0
  60. package/esm/lib/encodings.d.ts +54 -0
  61. package/esm/lib/encodings.js +406 -0
  62. package/esm/lib/files.d.ts +25 -0
  63. package/esm/lib/files.js +90 -0
  64. package/esm/lib/http.d.ts +66 -0
  65. package/esm/lib/http.js +208 -0
  66. package/esm/lib/logger.d.ts +5 -0
  67. package/esm/lib/logger.js +4 -0
  68. package/esm/lib/matchers.d.ts +58 -0
  69. package/esm/lib/matchers.js +201 -0
  70. package/esm/lib/primitives.d.ts +26 -0
  71. package/esm/lib/primitives.js +119 -0
  72. package/esm/lib/retries.d.ts +37 -0
  73. package/esm/lib/retries.js +156 -0
  74. package/esm/lib/schemas.d.ts +20 -0
  75. package/esm/lib/schemas.js +56 -0
  76. package/esm/lib/sdks.d.ts +62 -0
  77. package/esm/lib/sdks.js +289 -0
  78. package/esm/lib/security.d.ts +83 -0
  79. package/esm/lib/security.js +145 -0
  80. package/esm/lib/url.d.ts +4 -0
  81. package/esm/lib/url.js +23 -0
  82. package/esm/models/actor.d.ts +12 -0
  83. package/esm/models/actor.js +16 -0
  84. package/esm/models/api-profile.d.ts +17 -0
  85. package/esm/models/api-profile.js +22 -0
  86. package/esm/models/app.d.ts +14 -0
  87. package/esm/models/app.js +18 -0
  88. package/esm/models/catalog.d.ts +12 -0
  89. package/esm/models/catalog.js +15 -0
  90. package/esm/models/connection-secret.d.ts +14 -0
  91. package/esm/models/connection-secret.js +18 -0
  92. package/esm/models/connection.d.ts +26 -0
  93. package/esm/models/connection.js +30 -0
  94. package/esm/models/create-environment-input.d.ts +35 -0
  95. package/esm/models/create-environment-input.js +23 -0
  96. package/esm/models/credential-kind.d.ts +9 -0
  97. package/esm/models/credential-kind.js +10 -0
  98. package/esm/models/credential.d.ts +48 -0
  99. package/esm/models/credential.js +44 -0
  100. package/esm/models/environment-app.d.ts +42 -0
  101. package/esm/models/environment-app.js +44 -0
  102. package/esm/models/environment-lifetime.d.ts +10 -0
  103. package/esm/models/environment-lifetime.js +14 -0
  104. package/esm/models/environment.d.ts +47 -0
  105. package/esm/models/environment.js +48 -0
  106. package/esm/models/error-response.d.ts +45 -0
  107. package/esm/models/error-response.js +47 -0
  108. package/esm/models/errors/error-response.d.ts +18 -0
  109. package/esm/models/errors/error-response.js +32 -0
  110. package/esm/models/errors/http-client-errors.d.ts +43 -0
  111. package/esm/models/errors/http-client-errors.js +55 -0
  112. package/esm/models/errors/index.d.ts +6 -0
  113. package/esm/models/errors/index.js +9 -0
  114. package/esm/models/errors/response-validation-error.d.ts +25 -0
  115. package/esm/models/errors/response-validation-error.js +36 -0
  116. package/esm/models/errors/sdk-validation-error.d.ts +20 -0
  117. package/esm/models/errors/sdk-validation-error.js +51 -0
  118. package/esm/models/errors/state-machines-http-error.d.ts +18 -0
  119. package/esm/models/errors/state-machines-http-error.js +25 -0
  120. package/esm/models/errors/unexpected-response-error.d.ts +9 -0
  121. package/esm/models/errors/unexpected-response-error.js +29 -0
  122. package/esm/models/event-page.d.ts +11 -0
  123. package/esm/models/event-page.js +16 -0
  124. package/esm/models/event.d.ts +20 -0
  125. package/esm/models/event.js +22 -0
  126. package/esm/models/index.d.ts +19 -0
  127. package/esm/models/index.js +22 -0
  128. package/esm/models/operations/create-environments.d.ts +27 -0
  129. package/esm/models/operations/create-environments.js +27 -0
  130. package/esm/models/operations/get-catalog.d.ts +13 -0
  131. package/esm/models/operations/get-catalog.js +13 -0
  132. package/esm/models/operations/get-connection.d.ts +25 -0
  133. package/esm/models/operations/get-connection.js +21 -0
  134. package/esm/models/operations/get-credential.d.ts +13 -0
  135. package/esm/models/operations/get-credential.js +13 -0
  136. package/esm/models/operations/get-environment.d.ts +23 -0
  137. package/esm/models/operations/get-environment.js +20 -0
  138. package/esm/models/operations/get-release.d.ts +23 -0
  139. package/esm/models/operations/get-release.js +20 -0
  140. package/esm/models/operations/get-workspace.d.ts +23 -0
  141. package/esm/models/operations/get-workspace.js +20 -0
  142. package/esm/models/operations/index.d.ts +13 -0
  143. package/esm/models/operations/index.js +16 -0
  144. package/esm/models/operations/list-environment-events.d.ts +15 -0
  145. package/esm/models/operations/list-environment-events.js +13 -0
  146. package/esm/models/operations/list-environments.d.ts +49 -0
  147. package/esm/models/operations/list-environments.js +40 -0
  148. package/esm/models/operations/list-workspace-events.d.ts +15 -0
  149. package/esm/models/operations/list-workspace-events.js +13 -0
  150. package/esm/models/operations/list-workspaces.d.ts +32 -0
  151. package/esm/models/operations/list-workspaces.js +27 -0
  152. package/esm/models/operations/reveal-connection.d.ts +37 -0
  153. package/esm/models/operations/reveal-connection.js +29 -0
  154. package/esm/models/operations/stop-environment.d.ts +23 -0
  155. package/esm/models/operations/stop-environment.js +20 -0
  156. package/esm/models/release-actor.d.ts +11 -0
  157. package/esm/models/release-actor.js +15 -0
  158. package/esm/models/release.d.ts +26 -0
  159. package/esm/models/release.js +29 -0
  160. package/esm/models/security.d.ts +11 -0
  161. package/esm/models/security.js +11 -0
  162. package/esm/models/workspace.d.ts +16 -0
  163. package/esm/models/workspace.js +21 -0
  164. package/esm/sdk/catalog.d.ts +6 -0
  165. package/esm/sdk/catalog.js +15 -0
  166. package/esm/sdk/credential.d.ts +5 -0
  167. package/esm/sdk/credential.js +11 -0
  168. package/esm/sdk/environments.d.ts +12 -0
  169. package/esm/sdk/environments.js +35 -0
  170. package/esm/sdk/index.d.ts +1 -0
  171. package/esm/sdk/index.js +4 -0
  172. package/esm/sdk/sdk.d.ts +15 -0
  173. package/esm/sdk/sdk.js +26 -0
  174. package/esm/sdk/workspaces.d.ts +8 -0
  175. package/esm/sdk/workspaces.js +19 -0
  176. package/esm/types/async.d.ts +22 -0
  177. package/esm/types/async.js +27 -0
  178. package/esm/types/blobs.d.ts +3 -0
  179. package/esm/types/blobs.js +24 -0
  180. package/esm/types/const-date-time.d.ts +2 -0
  181. package/esm/types/const-date-time.js +9 -0
  182. package/esm/types/default-to-zero-value.d.ts +11 -0
  183. package/esm/types/default-to-zero-value.js +30 -0
  184. package/esm/types/enums.d.ts +8 -0
  185. package/esm/types/enums.js +26 -0
  186. package/esm/types/fp.d.ts +30 -0
  187. package/esm/types/fp.js +30 -0
  188. package/esm/types/index.d.ts +9 -0
  189. package/esm/types/index.js +9 -0
  190. package/esm/types/operations.d.ts +26 -0
  191. package/esm/types/operations.js +76 -0
  192. package/esm/types/primitives.d.ts +8 -0
  193. package/esm/types/primitives.js +108 -0
  194. package/esm/types/rfcdate.d.ts +20 -0
  195. package/esm/types/rfcdate.js +42 -0
  196. package/esm/types/smart-union.d.ts +6 -0
  197. package/esm/types/smart-union.js +116 -0
  198. package/esm/types/streams.d.ts +1 -0
  199. package/esm/types/streams.js +14 -0
  200. package/esm/types/unrecognized.d.ts +15 -0
  201. package/esm/types/unrecognized.js +30 -0
  202. package/openapi.json +2853 -0
  203. package/package.json +50 -0
@@ -0,0 +1,32 @@
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 Archived: {
7
+ readonly Exclude: "exclude";
8
+ readonly Include: "include";
9
+ readonly Only: "only";
10
+ };
11
+ export type Archived = ClosedEnum<typeof Archived>;
12
+ export type ListWorkspacesRequest = {
13
+ archived?: Archived | undefined;
14
+ };
15
+ /**
16
+ * The current organization's workspaces
17
+ */
18
+ export type ListWorkspacesResponse = {
19
+ data: Array<models.Workspace>;
20
+ };
21
+ /** @internal */
22
+ export declare const Archived$outboundSchema: z.ZodMiniEnum<typeof Archived>;
23
+ /** @internal */
24
+ export type ListWorkspacesRequest$Outbound = {
25
+ archived: string;
26
+ };
27
+ /** @internal */
28
+ export declare const ListWorkspacesRequest$outboundSchema: z.ZodMiniType<ListWorkspacesRequest$Outbound, ListWorkspacesRequest>;
29
+ export declare function listWorkspacesRequestToJSON(listWorkspacesRequest: ListWorkspacesRequest): string;
30
+ /** @internal */
31
+ export declare const ListWorkspacesResponse$inboundSchema: z.ZodMiniType<ListWorkspacesResponse, unknown>;
32
+ export declare function listWorkspacesResponseFromJSON(jsonString: string): SafeParseResult<ListWorkspacesResponse, SDKValidationError>;
@@ -0,0 +1,27 @@
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 Archived = {
8
+ Exclude: "exclude",
9
+ Include: "include",
10
+ Only: "only",
11
+ };
12
+ /** @internal */
13
+ export const Archived$outboundSchema = z.enum(Archived);
14
+ /** @internal */
15
+ export const ListWorkspacesRequest$outboundSchema = z.object({
16
+ archived: z._default(Archived$outboundSchema, "exclude"),
17
+ });
18
+ export function listWorkspacesRequestToJSON(listWorkspacesRequest) {
19
+ return JSON.stringify(ListWorkspacesRequest$outboundSchema.parse(listWorkspacesRequest));
20
+ }
21
+ /** @internal */
22
+ export const ListWorkspacesResponse$inboundSchema = z.object({
23
+ data: z.array(models.Workspace$inboundSchema),
24
+ });
25
+ export function listWorkspacesResponseFromJSON(jsonString) {
26
+ return safeParse(jsonString, (x) => ListWorkspacesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListWorkspacesResponse' from JSON`);
27
+ }
@@ -0,0 +1,37 @@
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 RevealConnectionRequestBody = {
6
+ actorId: string;
7
+ };
8
+ export type RevealConnectionRequest = {
9
+ environmentId: string;
10
+ appKey: string;
11
+ body: RevealConnectionRequestBody;
12
+ };
13
+ /**
14
+ * Live credentials for one actor; recorded as an event
15
+ */
16
+ export type RevealConnectionResponse = {
17
+ data: models.ConnectionSecret;
18
+ };
19
+ /** @internal */
20
+ export type RevealConnectionRequestBody$Outbound = {
21
+ actorId: string;
22
+ };
23
+ /** @internal */
24
+ export declare const RevealConnectionRequestBody$outboundSchema: z.ZodMiniType<RevealConnectionRequestBody$Outbound, RevealConnectionRequestBody>;
25
+ export declare function revealConnectionRequestBodyToJSON(revealConnectionRequestBody: RevealConnectionRequestBody): string;
26
+ /** @internal */
27
+ export type RevealConnectionRequest$Outbound = {
28
+ environmentId: string;
29
+ appKey: string;
30
+ body: RevealConnectionRequestBody$Outbound;
31
+ };
32
+ /** @internal */
33
+ export declare const RevealConnectionRequest$outboundSchema: z.ZodMiniType<RevealConnectionRequest$Outbound, RevealConnectionRequest>;
34
+ export declare function revealConnectionRequestToJSON(revealConnectionRequest: RevealConnectionRequest): string;
35
+ /** @internal */
36
+ export declare const RevealConnectionResponse$inboundSchema: z.ZodMiniType<RevealConnectionResponse, unknown>;
37
+ export declare function revealConnectionResponseFromJSON(jsonString: string): SafeParseResult<RevealConnectionResponse, SDKValidationError>;
@@ -0,0 +1,29 @@
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 RevealConnectionRequestBody$outboundSchema = z.object({
9
+ actorId: z.string(),
10
+ });
11
+ export function revealConnectionRequestBodyToJSON(revealConnectionRequestBody) {
12
+ return JSON.stringify(RevealConnectionRequestBody$outboundSchema.parse(revealConnectionRequestBody));
13
+ }
14
+ /** @internal */
15
+ export const RevealConnectionRequest$outboundSchema = z.object({
16
+ environmentId: z.string(),
17
+ appKey: z.string(),
18
+ body: z.lazy(() => RevealConnectionRequestBody$outboundSchema),
19
+ });
20
+ export function revealConnectionRequestToJSON(revealConnectionRequest) {
21
+ return JSON.stringify(RevealConnectionRequest$outboundSchema.parse(revealConnectionRequest));
22
+ }
23
+ /** @internal */
24
+ export const RevealConnectionResponse$inboundSchema = z.object({
25
+ data: models.ConnectionSecret$inboundSchema,
26
+ });
27
+ export function revealConnectionResponseFromJSON(jsonString) {
28
+ return safeParse(jsonString, (x) => RevealConnectionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RevealConnectionResponse' from JSON`);
29
+ }
@@ -0,0 +1,23 @@
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 StopEnvironmentRequest = {
6
+ environmentId: string;
7
+ };
8
+ /**
9
+ * Environment stopped or stopping
10
+ */
11
+ export type StopEnvironmentResponse = {
12
+ data: models.Environment;
13
+ };
14
+ /** @internal */
15
+ export type StopEnvironmentRequest$Outbound = {
16
+ environmentId: string;
17
+ };
18
+ /** @internal */
19
+ export declare const StopEnvironmentRequest$outboundSchema: z.ZodMiniType<StopEnvironmentRequest$Outbound, StopEnvironmentRequest>;
20
+ export declare function stopEnvironmentRequestToJSON(stopEnvironmentRequest: StopEnvironmentRequest): string;
21
+ /** @internal */
22
+ export declare const StopEnvironmentResponse$inboundSchema: z.ZodMiniType<StopEnvironmentResponse, unknown>;
23
+ export declare function stopEnvironmentResponseFromJSON(jsonString: string): SafeParseResult<StopEnvironmentResponse, SDKValidationError>;
@@ -0,0 +1,20 @@
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 StopEnvironmentRequest$outboundSchema = z.object({
9
+ environmentId: z.string(),
10
+ });
11
+ export function stopEnvironmentRequestToJSON(stopEnvironmentRequest) {
12
+ return JSON.stringify(StopEnvironmentRequest$outboundSchema.parse(stopEnvironmentRequest));
13
+ }
14
+ /** @internal */
15
+ export const StopEnvironmentResponse$inboundSchema = z.object({
16
+ data: models.Environment$inboundSchema,
17
+ });
18
+ export function stopEnvironmentResponseFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => StopEnvironmentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopEnvironmentResponse' from JSON`);
20
+ }
@@ -0,0 +1,11 @@
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 ReleaseActor = {
5
+ id: string;
6
+ name: string;
7
+ summary: string;
8
+ };
9
+ /** @internal */
10
+ export declare const ReleaseActor$inboundSchema: z.ZodMiniType<ReleaseActor, unknown>;
11
+ export declare function releaseActorFromJSON(jsonString: string): SafeParseResult<ReleaseActor, SDKValidationError>;
@@ -0,0 +1,15 @@
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 ReleaseActor$inboundSchema = z.object({
9
+ id: types.string(),
10
+ name: types.string(),
11
+ summary: types.string(),
12
+ });
13
+ export function releaseActorFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => ReleaseActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReleaseActor' from JSON`);
15
+ }
@@ -0,0 +1,26 @@
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 { ApiProfile } from "./api-profile.js";
5
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
6
+ import { ReleaseActor } from "./release-actor.js";
7
+ export declare const Qualification: {
8
+ readonly Development: "development";
9
+ readonly Qualified: "qualified";
10
+ };
11
+ export type Qualification = OpenEnum<typeof Qualification>;
12
+ export type Release = {
13
+ actors: Array<ReleaseActor>;
14
+ apis: Array<ApiProfile>;
15
+ appId: string;
16
+ createdAt: Date;
17
+ id: string;
18
+ qualification: Qualification;
19
+ retiredAt: Date | null;
20
+ version: string;
21
+ };
22
+ /** @internal */
23
+ export declare const Qualification$inboundSchema: z.ZodMiniType<Qualification, unknown>;
24
+ /** @internal */
25
+ export declare const Release$inboundSchema: z.ZodMiniType<Release, unknown>;
26
+ export declare function releaseFromJSON(jsonString: string): SafeParseResult<Release, SDKValidationError>;
@@ -0,0 +1,29 @@
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 { ApiProfile$inboundSchema } from "./api-profile.js";
9
+ import { ReleaseActor$inboundSchema } from "./release-actor.js";
10
+ export const Qualification = {
11
+ Development: "development",
12
+ Qualified: "qualified",
13
+ };
14
+ /** @internal */
15
+ export const Qualification$inboundSchema = openEnums.inboundSchema(Qualification);
16
+ /** @internal */
17
+ export const Release$inboundSchema = z.object({
18
+ actors: z.array(ReleaseActor$inboundSchema),
19
+ apis: z.array(ApiProfile$inboundSchema),
20
+ appId: types.string(),
21
+ createdAt: types.date(),
22
+ id: types.string(),
23
+ qualification: Qualification$inboundSchema,
24
+ retiredAt: types.nullable(types.date()),
25
+ version: types.string(),
26
+ });
27
+ export function releaseFromJSON(jsonString) {
28
+ return safeParse(jsonString, (x) => Release$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Release' from JSON`);
29
+ }
@@ -0,0 +1,11 @@
1
+ import * as z from "zod/v4-mini";
2
+ export type Security = {
3
+ apiKey: string;
4
+ };
5
+ /** @internal */
6
+ export type Security$Outbound = {
7
+ apiKey: string;
8
+ };
9
+ /** @internal */
10
+ export declare const Security$outboundSchema: z.ZodMiniType<Security$Outbound, Security>;
11
+ export declare function securityToJSON(security: Security): string;
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ /** @internal */
6
+ export const Security$outboundSchema = z.object({
7
+ apiKey: z.string(),
8
+ });
9
+ export function securityToJSON(security) {
10
+ return JSON.stringify(Security$outboundSchema.parse(security));
11
+ }
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { Actor } from "./actor.js";
4
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
+ export type Workspace = {
6
+ archivedAt: Date | null;
7
+ createdAt: Date;
8
+ createdBy: Actor | null;
9
+ id: string;
10
+ name: string;
11
+ updatedAt: Date;
12
+ version: number;
13
+ };
14
+ /** @internal */
15
+ export declare const Workspace$inboundSchema: z.ZodMiniType<Workspace, unknown>;
16
+ export declare function workspaceFromJSON(jsonString: string): SafeParseResult<Workspace, 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 types from "../types/primitives.js";
7
+ import { Actor$inboundSchema } from "./actor.js";
8
+ /** @internal */
9
+ export const Workspace$inboundSchema = z
10
+ .object({
11
+ archivedAt: types.nullable(types.date()),
12
+ createdAt: types.date(),
13
+ createdBy: types.nullable(Actor$inboundSchema),
14
+ id: types.string(),
15
+ name: types.string(),
16
+ updatedAt: types.date(),
17
+ version: types.number(),
18
+ });
19
+ export function workspaceFromJSON(jsonString) {
20
+ return safeParse(jsonString, (x) => Workspace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Workspace' from JSON`);
21
+ }
@@ -0,0 +1,6 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as operations from "../models/operations/index.js";
3
+ export declare class Catalog extends ClientSDK {
4
+ get(options?: RequestOptions): Promise<operations.GetCatalogResponse>;
5
+ release(request: operations.GetReleaseRequest, options?: RequestOptions): Promise<operations.GetReleaseResponse>;
6
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { catalogGet } from "../funcs/catalog-get.js";
5
+ import { catalogRelease } from "../funcs/catalog-release.js";
6
+ import { ClientSDK } from "../lib/sdks.js";
7
+ import { unwrapAsync } from "../types/fp.js";
8
+ export class Catalog extends ClientSDK {
9
+ async get(options) {
10
+ return unwrapAsync(catalogGet(this, options));
11
+ }
12
+ async release(request, options) {
13
+ return unwrapAsync(catalogRelease(this, request, options));
14
+ }
15
+ }
@@ -0,0 +1,5 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as operations from "../models/operations/index.js";
3
+ export declare class Credential extends ClientSDK {
4
+ get(options?: RequestOptions): Promise<operations.GetCredentialResponse>;
5
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { credentialGet } from "../funcs/credential-get.js";
5
+ import { ClientSDK } from "../lib/sdks.js";
6
+ import { unwrapAsync } from "../types/fp.js";
7
+ export class Credential extends ClientSDK {
8
+ async get(options) {
9
+ return unwrapAsync(credentialGet(this, options));
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "../models/index.js";
3
+ import * as operations from "../models/operations/index.js";
4
+ export declare class Environments extends ClientSDK {
5
+ get(request: operations.GetEnvironmentRequest, options?: RequestOptions): Promise<operations.GetEnvironmentResponse>;
6
+ getConnection(request: operations.GetConnectionRequest, options?: RequestOptions): Promise<operations.GetConnectionResponse>;
7
+ reveal(request: operations.RevealConnectionRequest, options?: RequestOptions): Promise<operations.RevealConnectionResponse>;
8
+ events(request: operations.ListEnvironmentEventsRequest, options?: RequestOptions): Promise<models.EventPage>;
9
+ stop(request: operations.StopEnvironmentRequest, options?: RequestOptions): Promise<operations.StopEnvironmentResponse>;
10
+ list(request: operations.ListEnvironmentsRequest, options?: RequestOptions): Promise<operations.ListEnvironmentsResponse>;
11
+ create(request: operations.CreateEnvironmentsRequest, options?: RequestOptions): Promise<operations.CreateEnvironmentsResponse>;
12
+ }
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { environmentsCreate } from "../funcs/environments-create.js";
5
+ import { environmentsEvents } from "../funcs/environments-events.js";
6
+ import { environmentsGetConnection } from "../funcs/environments-get-connection.js";
7
+ import { environmentsGet } from "../funcs/environments-get.js";
8
+ import { environmentsList } from "../funcs/environments-list.js";
9
+ import { environmentsReveal } from "../funcs/environments-reveal.js";
10
+ import { environmentsStop } from "../funcs/environments-stop.js";
11
+ import { ClientSDK } from "../lib/sdks.js";
12
+ import { unwrapAsync } from "../types/fp.js";
13
+ export class Environments extends ClientSDK {
14
+ async get(request, options) {
15
+ return unwrapAsync(environmentsGet(this, request, options));
16
+ }
17
+ async getConnection(request, options) {
18
+ return unwrapAsync(environmentsGetConnection(this, request, options));
19
+ }
20
+ async reveal(request, options) {
21
+ return unwrapAsync(environmentsReveal(this, request, options));
22
+ }
23
+ async events(request, options) {
24
+ return unwrapAsync(environmentsEvents(this, request, options));
25
+ }
26
+ async stop(request, options) {
27
+ return unwrapAsync(environmentsStop(this, request, options));
28
+ }
29
+ async list(request, options) {
30
+ return unwrapAsync(environmentsList(this, request, options));
31
+ }
32
+ async create(request, options) {
33
+ return unwrapAsync(environmentsCreate(this, request, options));
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ export * from "./sdk.js";
@@ -0,0 +1,4 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ export * from "./sdk.js";
@@ -0,0 +1,15 @@
1
+ import { ClientSDK } from "../lib/sdks.js";
2
+ import { Catalog } from "./catalog.js";
3
+ import { Credential } from "./credential.js";
4
+ import { Environments } from "./environments.js";
5
+ import { Workspaces } from "./workspaces.js";
6
+ export declare class StateMachines extends ClientSDK {
7
+ private _catalog?;
8
+ get catalog(): Catalog;
9
+ private _credential?;
10
+ get credential(): Credential;
11
+ private _environments?;
12
+ get environments(): Environments;
13
+ private _workspaces?;
14
+ get workspaces(): Workspaces;
15
+ }
package/esm/sdk/sdk.js ADDED
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { ClientSDK } from "../lib/sdks.js";
5
+ import { Catalog } from "./catalog.js";
6
+ import { Credential } from "./credential.js";
7
+ import { Environments } from "./environments.js";
8
+ import { Workspaces } from "./workspaces.js";
9
+ export class StateMachines extends ClientSDK {
10
+ _catalog;
11
+ get catalog() {
12
+ return (this._catalog ?? (this._catalog = new Catalog(this._options)));
13
+ }
14
+ _credential;
15
+ get credential() {
16
+ return (this._credential ?? (this._credential = new Credential(this._options)));
17
+ }
18
+ _environments;
19
+ get environments() {
20
+ return (this._environments ?? (this._environments = new Environments(this._options)));
21
+ }
22
+ _workspaces;
23
+ get workspaces() {
24
+ return (this._workspaces ?? (this._workspaces = new Workspaces(this._options)));
25
+ }
26
+ }
@@ -0,0 +1,8 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "../models/index.js";
3
+ import * as operations from "../models/operations/index.js";
4
+ export declare class Workspaces extends ClientSDK {
5
+ list(request?: operations.ListWorkspacesRequest | undefined, options?: RequestOptions): Promise<operations.ListWorkspacesResponse>;
6
+ get(request: operations.GetWorkspaceRequest, options?: RequestOptions): Promise<operations.GetWorkspaceResponse>;
7
+ events(request: operations.ListWorkspaceEventsRequest, options?: RequestOptions): Promise<models.EventPage>;
8
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { workspacesEvents } from "../funcs/workspaces-events.js";
5
+ import { workspacesGet } from "../funcs/workspaces-get.js";
6
+ import { workspacesList } from "../funcs/workspaces-list.js";
7
+ import { ClientSDK } from "../lib/sdks.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+ export class Workspaces extends ClientSDK {
10
+ async list(request, options) {
11
+ return unwrapAsync(workspacesList(this, request, options));
12
+ }
13
+ async get(request, options) {
14
+ return unwrapAsync(workspacesGet(this, request, options));
15
+ }
16
+ async events(request, options) {
17
+ return unwrapAsync(workspacesEvents(this, request, options));
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ export type APICall = {
2
+ status: "complete";
3
+ request: Request;
4
+ response: Response;
5
+ } | {
6
+ status: "request-error";
7
+ request: Request;
8
+ response?: undefined;
9
+ } | {
10
+ status: "invalid";
11
+ request?: undefined;
12
+ response?: undefined;
13
+ };
14
+ export declare class APIPromise<T> implements Promise<T> {
15
+ #private;
16
+ readonly [Symbol.toStringTag] = "APIPromise";
17
+ constructor(p: [T, APICall] | Promise<[T, APICall]>);
18
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
19
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult>;
20
+ finally(onfinally?: (() => void) | null | undefined): Promise<T>;
21
+ $inspect(): Promise<[T, APICall]>;
22
+ }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ export class APIPromise {
5
+ #promise;
6
+ #unwrapped;
7
+ [Symbol.toStringTag] = "APIPromise";
8
+ constructor(p) {
9
+ this.#promise = p instanceof Promise ? p : Promise.resolve(p);
10
+ this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
11
+ }
12
+ #getUnwrapped() {
13
+ return (this.#unwrapped ?? (this.#unwrapped = this.#promise.then(([value]) => value)));
14
+ }
15
+ then(onfulfilled, onrejected) {
16
+ return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
17
+ }
18
+ catch(onrejected) {
19
+ return this.#getUnwrapped().catch(onrejected);
20
+ }
21
+ finally(onfinally) {
22
+ return this.#getUnwrapped().finally(onfinally);
23
+ }
24
+ $inspect() {
25
+ return this.#promise;
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ import * as z from "zod/v4-mini";
2
+ export declare const blobLikeSchema: z.ZodMiniType<Blob, Blob>;
3
+ export declare function isBlobLike(val: unknown): val is Blob;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ export const blobLikeSchema = z.custom(isBlobLike, {
6
+ message: "expected a Blob, File or Blob-like object",
7
+ abort: true,
8
+ });
9
+ export function isBlobLike(val) {
10
+ if (val instanceof Blob) {
11
+ return true;
12
+ }
13
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
14
+ return false;
15
+ }
16
+ const name = val[Symbol.toStringTag];
17
+ if (typeof name !== "string") {
18
+ return false;
19
+ }
20
+ if (name !== "Blob" && name !== "File") {
21
+ return false;
22
+ }
23
+ return "stream" in val && typeof val.stream === "function";
24
+ }
@@ -0,0 +1,2 @@
1
+ import * as z from "zod/v4-mini";
2
+ export declare function constDateTime(val: string): z.ZodMiniType<string, unknown>;
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ export function constDateTime(val) {
6
+ return z.custom((v) => {
7
+ return (typeof v === "string" && new Date(v).getTime() === new Date(val).getTime());
8
+ }, `Value must be equivalent to ${val}`);
9
+ }
@@ -0,0 +1,11 @@
1
+ import { type Unrecognized } from "./unrecognized.js";
2
+ export declare function defaultToZeroValue<T>(value: T): Unrecognized<T>;
3
+ export declare function startCountingDefaultToZeroValue(): {
4
+ /**
5
+ * Ends counting and returns the delta.
6
+ * @param delta - If provided, only this amount is added to the parent counter
7
+ * (used for nested unions where we only want to record the winning option's count).
8
+ * If not provided, records all counts since start().
9
+ */
10
+ end: (delta?: number | undefined) => number;
11
+ };
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { unrecognized } from "./unrecognized.js";
5
+ let globalCount = 0;
6
+ let refCount = 0;
7
+ export function defaultToZeroValue(value) {
8
+ globalCount++;
9
+ return unrecognized(value);
10
+ }
11
+ export function startCountingDefaultToZeroValue() {
12
+ refCount++;
13
+ const start = globalCount;
14
+ return {
15
+ /**
16
+ * Ends counting and returns the delta.
17
+ * @param delta - If provided, only this amount is added to the parent counter
18
+ * (used for nested unions where we only want to record the winning option's count).
19
+ * If not provided, records all counts since start().
20
+ */
21
+ end: (delta) => {
22
+ const count = globalCount - start;
23
+ // Reset globalCount back to start, then add only the specified delta
24
+ globalCount = start + (delta ?? count);
25
+ if (--refCount === 0)
26
+ globalCount = 0;
27
+ return count;
28
+ },
29
+ };
30
+ }