@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,83 @@
1
+ import * as models from "../models/index.js";
2
+ type OAuth2PasswordFlow = {
3
+ username: string;
4
+ password: string;
5
+ clientID?: string | undefined;
6
+ clientSecret?: string | undefined;
7
+ tokenURL: string;
8
+ };
9
+ export declare const SecurityErrorCode: {
10
+ readonly Incomplete: "incomplete";
11
+ readonly UnrecognisedSecurityType: "unrecognized_security_type";
12
+ };
13
+ export type SecurityErrorCode = (typeof SecurityErrorCode)[keyof typeof SecurityErrorCode];
14
+ export declare class SecurityError extends Error {
15
+ code: SecurityErrorCode;
16
+ constructor(code: SecurityErrorCode, message: string);
17
+ static incomplete(): SecurityError;
18
+ static unrecognizedType(type: string): SecurityError;
19
+ }
20
+ export type SecurityState = {
21
+ basic: {
22
+ username?: string | undefined;
23
+ password?: string | undefined;
24
+ };
25
+ headers: Record<string, string>;
26
+ queryParams: Record<string, string>;
27
+ cookies: Record<string, string>;
28
+ oauth2: ({
29
+ type: "password";
30
+ } & OAuth2PasswordFlow) | {
31
+ type: "none";
32
+ };
33
+ };
34
+ type SecurityInputBasic = {
35
+ type: "http:basic";
36
+ value: {
37
+ username?: string | undefined;
38
+ password?: string | undefined;
39
+ } | null | undefined;
40
+ };
41
+ type SecurityInputBearer = {
42
+ type: "http:bearer";
43
+ value: string | null | undefined;
44
+ fieldName: string;
45
+ };
46
+ type SecurityInputAPIKey = {
47
+ type: "apiKey:header" | "apiKey:query" | "apiKey:cookie";
48
+ value: string | null | undefined;
49
+ fieldName: string;
50
+ };
51
+ type SecurityInputOIDC = {
52
+ type: "openIdConnect";
53
+ value: string | null | undefined;
54
+ fieldName: string;
55
+ };
56
+ type SecurityInputOAuth2 = {
57
+ type: "oauth2";
58
+ value: string | null | undefined;
59
+ fieldName: string;
60
+ };
61
+ type SecurityInputOAuth2ClientCredentials = {
62
+ type: "oauth2:client_credentials";
63
+ value: {
64
+ clientID?: string | undefined;
65
+ clientSecret?: string | undefined;
66
+ } | null | string | undefined;
67
+ fieldName?: string;
68
+ };
69
+ type SecurityInputOAuth2PasswordCredentials = {
70
+ type: "oauth2:password";
71
+ value: string | null | undefined;
72
+ fieldName?: string;
73
+ };
74
+ type SecurityInputCustom = {
75
+ type: "http:custom";
76
+ value: any | null | undefined;
77
+ fieldName?: string;
78
+ };
79
+ export type SecurityInput = SecurityInputBasic | SecurityInputBearer | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials | SecurityInputOAuth2PasswordCredentials | SecurityInputOIDC | SecurityInputCustom;
80
+ export declare function resolveSecurity(...options: SecurityInput[][]): SecurityState | null;
81
+ export declare function resolveGlobalSecurity(security: Partial<models.Security> | null | undefined, allowedFields?: number[]): SecurityState | null;
82
+ export declare function extractSecurity<T extends string | Record<string, unknown>>(sec: T | (() => Promise<T>) | undefined): Promise<T | undefined>;
83
+ export {};
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ export const SecurityErrorCode = {
5
+ Incomplete: "incomplete",
6
+ UnrecognisedSecurityType: "unrecognized_security_type",
7
+ };
8
+ export class SecurityError extends Error {
9
+ code;
10
+ constructor(code, message) {
11
+ super(message);
12
+ this.code = code;
13
+ this.name = "SecurityError";
14
+ }
15
+ static incomplete() {
16
+ return new SecurityError(SecurityErrorCode.Incomplete, "Security requirements not met in order to perform the operation");
17
+ }
18
+ static unrecognizedType(type) {
19
+ return new SecurityError(SecurityErrorCode.UnrecognisedSecurityType, `Unrecognised security type: ${type}`);
20
+ }
21
+ }
22
+ export function resolveSecurity(...options) {
23
+ const state = {
24
+ basic: {},
25
+ headers: {},
26
+ queryParams: {},
27
+ cookies: {},
28
+ oauth2: { type: "none" },
29
+ };
30
+ const option = options.find((opts) => {
31
+ return opts.every((o) => {
32
+ if (o.value == null) {
33
+ return false;
34
+ }
35
+ else if (o.type === "http:basic") {
36
+ return o.value.username != null || o.value.password != null;
37
+ }
38
+ else if (o.type === "http:custom") {
39
+ return null;
40
+ }
41
+ else if (o.type === "oauth2:password") {
42
+ return (typeof o.value === "string" && !!o.value);
43
+ }
44
+ else if (o.type === "oauth2:client_credentials") {
45
+ if (typeof o.value == "string") {
46
+ return !!o.value;
47
+ }
48
+ return o.value.clientID != null || o.value.clientSecret != null;
49
+ }
50
+ else if (typeof o.value === "string") {
51
+ return !!o.value;
52
+ }
53
+ else {
54
+ throw new Error(`Unrecognized security type: ${o.type} (value type: ${typeof o
55
+ .value})`);
56
+ }
57
+ });
58
+ });
59
+ if (option == null) {
60
+ return null;
61
+ }
62
+ option.forEach((spec) => {
63
+ if (spec.value == null) {
64
+ return;
65
+ }
66
+ const { type } = spec;
67
+ switch (type) {
68
+ case "apiKey:header":
69
+ state.headers[spec.fieldName] = spec.value;
70
+ break;
71
+ case "apiKey:query":
72
+ state.queryParams[spec.fieldName] = spec.value;
73
+ break;
74
+ case "apiKey:cookie":
75
+ state.cookies[spec.fieldName] = spec.value;
76
+ break;
77
+ case "http:basic":
78
+ applyBasic(state, spec);
79
+ break;
80
+ case "http:custom":
81
+ break;
82
+ case "http:bearer":
83
+ applyBearer(state, spec);
84
+ break;
85
+ case "oauth2":
86
+ applyBearer(state, spec);
87
+ break;
88
+ case "oauth2:password":
89
+ applyBearer(state, spec);
90
+ break;
91
+ case "oauth2:client_credentials":
92
+ break;
93
+ case "openIdConnect":
94
+ applyBearer(state, spec);
95
+ break;
96
+ default:
97
+ throw SecurityError.unrecognizedType((spec, type));
98
+ }
99
+ });
100
+ return state;
101
+ }
102
+ function applyBasic(state, spec) {
103
+ if (spec.value == null) {
104
+ return;
105
+ }
106
+ state.basic = spec.value;
107
+ }
108
+ function applyBearer(state, spec) {
109
+ if (typeof spec.value !== "string" || !spec.value) {
110
+ return;
111
+ }
112
+ let value = spec.value;
113
+ if (value.slice(0, 7).toLowerCase() !== "bearer ") {
114
+ value = `Bearer ${value}`;
115
+ }
116
+ if (spec.fieldName !== undefined) {
117
+ state.headers[spec.fieldName] = value;
118
+ }
119
+ }
120
+ export function resolveGlobalSecurity(security, allowedFields) {
121
+ let inputs = [
122
+ [
123
+ {
124
+ fieldName: "Authorization",
125
+ type: "http:bearer",
126
+ value: security?.apiKey,
127
+ },
128
+ ],
129
+ ];
130
+ if (allowedFields) {
131
+ inputs = allowedFields.map((i) => {
132
+ if (i < 0 || i >= inputs.length) {
133
+ throw new RangeError(`invalid allowedFields index ${i}`);
134
+ }
135
+ return inputs[i];
136
+ });
137
+ }
138
+ return resolveSecurity(...inputs);
139
+ }
140
+ export async function extractSecurity(sec) {
141
+ if (sec == null) {
142
+ return;
143
+ }
144
+ return typeof sec === "function" ? sec() : sec;
145
+ }
@@ -0,0 +1,4 @@
1
+ export type Params = Partial<Record<string, string | number>>;
2
+ export declare function pathToFunc(pathPattern: string, options?: {
3
+ charEncoding?: "percent" | "none";
4
+ }): (params?: Params) => string;
package/esm/lib/url.js ADDED
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ const hasOwn = Object.prototype.hasOwnProperty;
5
+ export function pathToFunc(pathPattern, options) {
6
+ const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
7
+ return function buildURLPath(params = {}) {
8
+ return pathPattern
9
+ .replace(paramRE, function (_, placeholder) {
10
+ if (!hasOwn.call(params, placeholder)) {
11
+ throw new Error(`Parameter '${placeholder}' is required`);
12
+ }
13
+ const value = params[placeholder];
14
+ if (typeof value !== "string" && typeof value !== "number") {
15
+ throw new Error(`Parameter '${placeholder}' must be a string or number`);
16
+ }
17
+ return options?.charEncoding === "percent"
18
+ ? encodeURIComponent(`${value}`)
19
+ : `${value}`;
20
+ })
21
+ .replace(/^\/+/, "");
22
+ };
23
+ }
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { CredentialKind } from "./credential-kind.js";
4
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
+ export type Actor = {
6
+ id: string;
7
+ kind: CredentialKind;
8
+ name: string | null;
9
+ };
10
+ /** @internal */
11
+ export declare const Actor$inboundSchema: z.ZodMiniType<Actor, unknown>;
12
+ export declare function actorFromJSON(jsonString: string): SafeParseResult<Actor, SDKValidationError>;
@@ -0,0 +1,16 @@
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 { CredentialKind$inboundSchema, } from "./credential-kind.js";
8
+ /** @internal */
9
+ export const Actor$inboundSchema = z.object({
10
+ id: types.string(),
11
+ kind: CredentialKind$inboundSchema,
12
+ name: types.nullable(types.string()),
13
+ });
14
+ export function actorFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => Actor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Actor' from JSON`);
16
+ }
@@ -0,0 +1,17 @@
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 ApiProfile = {
5
+ actorHeader: string;
6
+ actorVariable: string;
7
+ id: string;
8
+ interactive: boolean;
9
+ limitations: Array<string>;
10
+ name: string;
11
+ pathTemplate: string;
12
+ requestContentType: string;
13
+ versions: Array<string>;
14
+ };
15
+ /** @internal */
16
+ export declare const ApiProfile$inboundSchema: z.ZodMiniType<ApiProfile, unknown>;
17
+ export declare function apiProfileFromJSON(jsonString: string): SafeParseResult<ApiProfile, SDKValidationError>;
@@ -0,0 +1,22 @@
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 ApiProfile$inboundSchema = z
9
+ .object({
10
+ actorHeader: types.string(),
11
+ actorVariable: types.string(),
12
+ id: types.string(),
13
+ interactive: types.boolean(),
14
+ limitations: z.array(types.string()),
15
+ name: types.string(),
16
+ pathTemplate: types.string(),
17
+ requestContentType: types.string(),
18
+ versions: z.array(types.string()),
19
+ });
20
+ export function apiProfileFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => ApiProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApiProfile' from JSON`);
22
+ }
@@ -0,0 +1,14 @@
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 App = {
5
+ defaultReleaseId: string | null;
6
+ description: string;
7
+ id: string;
8
+ logoPath: string;
9
+ name: string;
10
+ vendor: string;
11
+ };
12
+ /** @internal */
13
+ export declare const App$inboundSchema: z.ZodMiniType<App, unknown>;
14
+ export declare function appFromJSON(jsonString: string): SafeParseResult<App, SDKValidationError>;
@@ -0,0 +1,18 @@
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 App$inboundSchema = z.object({
9
+ defaultReleaseId: types.nullable(types.string()),
10
+ description: types.string(),
11
+ id: types.string(),
12
+ logoPath: types.string(),
13
+ name: types.string(),
14
+ vendor: types.string(),
15
+ });
16
+ export function appFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => App$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'App' from JSON`);
18
+ }
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { App } from "./app.js";
4
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
+ import { Release } from "./release.js";
6
+ export type Catalog = {
7
+ apps: Array<App>;
8
+ releases: Array<Release>;
9
+ };
10
+ /** @internal */
11
+ export declare const Catalog$inboundSchema: z.ZodMiniType<Catalog, unknown>;
12
+ export declare function catalogFromJSON(jsonString: string): SafeParseResult<Catalog, 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 { App$inboundSchema } from "./app.js";
7
+ import { Release$inboundSchema } from "./release.js";
8
+ /** @internal */
9
+ export const Catalog$inboundSchema = z.object({
10
+ apps: z.array(App$inboundSchema),
11
+ releases: z.array(Release$inboundSchema),
12
+ });
13
+ export function catalogFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => Catalog$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Catalog' from JSON`);
15
+ }
@@ -0,0 +1,14 @@
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 ConnectionSecret = {
5
+ actorId: string;
6
+ actorToken: string;
7
+ appKey: string;
8
+ environmentId: string;
9
+ environmentToken: string;
10
+ expiresAt: Date;
11
+ };
12
+ /** @internal */
13
+ export declare const ConnectionSecret$inboundSchema: z.ZodMiniType<ConnectionSecret, unknown>;
14
+ export declare function connectionSecretFromJSON(jsonString: string): SafeParseResult<ConnectionSecret, SDKValidationError>;
@@ -0,0 +1,18 @@
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 ConnectionSecret$inboundSchema = z.object({
9
+ actorId: types.string(),
10
+ actorToken: types.string(),
11
+ appKey: types.string(),
12
+ environmentId: types.string(),
13
+ environmentToken: types.string(),
14
+ expiresAt: types.date(),
15
+ });
16
+ export function connectionSecretFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => ConnectionSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectionSecret' from JSON`);
18
+ }
@@ -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 ConnectionStatus: {
8
+ readonly Starting: "starting";
9
+ readonly Ready: "ready";
10
+ readonly Unavailable: "unavailable";
11
+ };
12
+ export type ConnectionStatus = OpenEnum<typeof ConnectionStatus>;
13
+ export type Connection = {
14
+ actors: Array<ReleaseActor>;
15
+ apis: Array<ApiProfile>;
16
+ appKey: string;
17
+ baseUrl: string | null;
18
+ environmentId: string;
19
+ expiresAt: Date | null;
20
+ status: ConnectionStatus;
21
+ };
22
+ /** @internal */
23
+ export declare const ConnectionStatus$inboundSchema: z.ZodMiniType<ConnectionStatus, unknown>;
24
+ /** @internal */
25
+ export declare const Connection$inboundSchema: z.ZodMiniType<Connection, unknown>;
26
+ export declare function connectionFromJSON(jsonString: string): SafeParseResult<Connection, SDKValidationError>;
@@ -0,0 +1,30 @@
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 ConnectionStatus = {
11
+ Starting: "starting",
12
+ Ready: "ready",
13
+ Unavailable: "unavailable",
14
+ };
15
+ /** @internal */
16
+ export const ConnectionStatus$inboundSchema = openEnums.inboundSchema(ConnectionStatus);
17
+ /** @internal */
18
+ export const Connection$inboundSchema = z
19
+ .object({
20
+ actors: z.array(ReleaseActor$inboundSchema),
21
+ apis: z.array(ApiProfile$inboundSchema),
22
+ appKey: types.string(),
23
+ baseUrl: types.nullable(types.string()),
24
+ environmentId: types.string(),
25
+ expiresAt: types.nullable(types.date()),
26
+ status: ConnectionStatus$inboundSchema,
27
+ });
28
+ export function connectionFromJSON(jsonString) {
29
+ return safeParse(jsonString, (x) => Connection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connection' from JSON`);
30
+ }
@@ -0,0 +1,35 @@
1
+ import * as z from "zod/v4-mini";
2
+ export type CreateEnvironmentInputApp = {
3
+ appId: string;
4
+ appReleaseId?: string | undefined;
5
+ key: string;
6
+ };
7
+ export type CreateEnvironmentInput = {
8
+ apps: Array<CreateEnvironmentInputApp>;
9
+ labels?: {
10
+ [k: string]: string;
11
+ } | undefined;
12
+ lifetimeMinutes?: number | undefined;
13
+ name?: string | undefined;
14
+ };
15
+ /** @internal */
16
+ export type CreateEnvironmentInputApp$Outbound = {
17
+ appId: string;
18
+ appReleaseId?: string | undefined;
19
+ key: string;
20
+ };
21
+ /** @internal */
22
+ export declare const CreateEnvironmentInputApp$outboundSchema: z.ZodMiniType<CreateEnvironmentInputApp$Outbound, CreateEnvironmentInputApp>;
23
+ export declare function createEnvironmentInputAppToJSON(createEnvironmentInputApp: CreateEnvironmentInputApp): string;
24
+ /** @internal */
25
+ export type CreateEnvironmentInput$Outbound = {
26
+ apps: Array<CreateEnvironmentInputApp$Outbound>;
27
+ labels?: {
28
+ [k: string]: string;
29
+ } | undefined;
30
+ lifetimeMinutes?: number | undefined;
31
+ name?: string | undefined;
32
+ };
33
+ /** @internal */
34
+ export declare const CreateEnvironmentInput$outboundSchema: z.ZodMiniType<CreateEnvironmentInput$Outbound, CreateEnvironmentInput>;
35
+ export declare function createEnvironmentInputToJSON(createEnvironmentInput: CreateEnvironmentInput): string;
@@ -0,0 +1,23 @@
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 CreateEnvironmentInputApp$outboundSchema = z.object({
7
+ appId: z.string(),
8
+ appReleaseId: z.optional(z.string()),
9
+ key: z.string(),
10
+ });
11
+ export function createEnvironmentInputAppToJSON(createEnvironmentInputApp) {
12
+ return JSON.stringify(CreateEnvironmentInputApp$outboundSchema.parse(createEnvironmentInputApp));
13
+ }
14
+ /** @internal */
15
+ export const CreateEnvironmentInput$outboundSchema = z.object({
16
+ apps: z.array(z.lazy(() => CreateEnvironmentInputApp$outboundSchema)),
17
+ labels: z.optional(z.record(z.string(), z.string())),
18
+ lifetimeMinutes: z.optional(z.int()),
19
+ name: z.optional(z.string()),
20
+ });
21
+ export function createEnvironmentInputToJSON(createEnvironmentInput) {
22
+ return JSON.stringify(CreateEnvironmentInput$outboundSchema.parse(createEnvironmentInput));
23
+ }
@@ -0,0 +1,9 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const CredentialKind: {
4
+ readonly User: "user";
5
+ readonly ApiKey: "api_key";
6
+ };
7
+ export type CredentialKind = OpenEnum<typeof CredentialKind>;
8
+ /** @internal */
9
+ export declare const CredentialKind$inboundSchema: z.ZodMiniType<CredentialKind, unknown>;
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as openEnums from "../types/enums.js";
5
+ export const CredentialKind = {
6
+ User: "user",
7
+ ApiKey: "api_key",
8
+ };
9
+ /** @internal */
10
+ export const CredentialKind$inboundSchema = openEnums.inboundSchema(CredentialKind);
@@ -0,0 +1,48 @@
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 { CredentialKind } from "./credential-kind.js";
5
+ import { EnvironmentLifetime } from "./environment-lifetime.js";
6
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
7
+ export type Limits = {
8
+ environmentLifetime: EnvironmentLifetime;
9
+ /**
10
+ * How many environments the organization may run at once; null when there is no organization or it is not known yet. Never means unlimited.
11
+ */
12
+ liveEnvironments: number | null;
13
+ };
14
+ export declare const Permission: {
15
+ readonly EnvironmentsRead: "environments:read";
16
+ readonly EnvironmentsCreate: "environments:create";
17
+ readonly EnvironmentsUpdate: "environments:update";
18
+ readonly EnvironmentsStop: "environments:stop";
19
+ readonly ConnectionsReveal: "connections:reveal";
20
+ readonly SnapshotsRead: "snapshots:read";
21
+ readonly SnapshotsCreate: "snapshots:create";
22
+ readonly SnapshotsDelete: "snapshots:delete";
23
+ readonly WorkspacesManage: "workspaces:manage";
24
+ readonly ApiKeysManage: "api_keys:manage";
25
+ readonly MembersManage: "members:manage";
26
+ };
27
+ export type Permission = OpenEnum<typeof Permission>;
28
+ export type Credential = {
29
+ kind: CredentialKind;
30
+ limits: Limits;
31
+ /**
32
+ * The organization the credential acts in; null for a user without an organization.
33
+ */
34
+ organizationId: string | null;
35
+ permissions: Array<Permission>;
36
+ /**
37
+ * The workspace an API key is bound to; null for a user session.
38
+ */
39
+ workspaceId: string | null;
40
+ };
41
+ /** @internal */
42
+ export declare const Limits$inboundSchema: z.ZodMiniType<Limits, unknown>;
43
+ export declare function limitsFromJSON(jsonString: string): SafeParseResult<Limits, SDKValidationError>;
44
+ /** @internal */
45
+ export declare const Permission$inboundSchema: z.ZodMiniType<Permission, unknown>;
46
+ /** @internal */
47
+ export declare const Credential$inboundSchema: z.ZodMiniType<Credential, unknown>;
48
+ export declare function credentialFromJSON(jsonString: string): SafeParseResult<Credential, SDKValidationError>;
@@ -0,0 +1,44 @@
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 { CredentialKind$inboundSchema, } from "./credential-kind.js";
9
+ import { EnvironmentLifetime$inboundSchema, } from "./environment-lifetime.js";
10
+ export const Permission = {
11
+ EnvironmentsRead: "environments:read",
12
+ EnvironmentsCreate: "environments:create",
13
+ EnvironmentsUpdate: "environments:update",
14
+ EnvironmentsStop: "environments:stop",
15
+ ConnectionsReveal: "connections:reveal",
16
+ SnapshotsRead: "snapshots:read",
17
+ SnapshotsCreate: "snapshots:create",
18
+ SnapshotsDelete: "snapshots:delete",
19
+ WorkspacesManage: "workspaces:manage",
20
+ ApiKeysManage: "api_keys:manage",
21
+ MembersManage: "members:manage",
22
+ };
23
+ /** @internal */
24
+ export const Limits$inboundSchema = z.object({
25
+ environmentLifetime: EnvironmentLifetime$inboundSchema,
26
+ liveEnvironments: types.nullable(types.number()),
27
+ });
28
+ export function limitsFromJSON(jsonString) {
29
+ return safeParse(jsonString, (x) => Limits$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Limits' from JSON`);
30
+ }
31
+ /** @internal */
32
+ export const Permission$inboundSchema = openEnums.inboundSchema(Permission);
33
+ /** @internal */
34
+ export const Credential$inboundSchema = z
35
+ .object({
36
+ kind: CredentialKind$inboundSchema,
37
+ limits: z.lazy(() => Limits$inboundSchema),
38
+ organizationId: types.nullable(types.string()),
39
+ permissions: z.array(Permission$inboundSchema),
40
+ workspaceId: types.nullable(types.string()),
41
+ });
42
+ export function credentialFromJSON(jsonString) {
43
+ return safeParse(jsonString, (x) => Credential$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Credential' from JSON`);
44
+ }