@usestatemachines/sdk 0.9.0 → 0.10.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 (70) hide show
  1. package/README.md +17 -3
  2. package/agents/SKILL.md +46 -30
  3. package/agents/index.js +6 -6
  4. package/agents/llms.txt +15 -8
  5. package/agents/prompt.md +1 -1
  6. package/esm/extensions/client.d.ts +31 -1
  7. package/esm/extensions/client.js +74 -2
  8. package/esm/extensions/errors.d.ts +7 -0
  9. package/esm/extensions/errors.js +46 -2
  10. package/esm/extensions/index.d.ts +2 -2
  11. package/esm/funcs/imports-complete.d.ts +12 -0
  12. package/esm/funcs/imports-complete.js +93 -0
  13. package/esm/funcs/imports-create.d.ts +12 -0
  14. package/esm/funcs/imports-create.js +89 -0
  15. package/esm/funcs/imports-delete.d.ts +12 -0
  16. package/esm/funcs/imports-delete.js +93 -0
  17. package/esm/funcs/imports-get.d.ts +12 -0
  18. package/esm/funcs/imports-get.js +93 -0
  19. package/esm/funcs/imports-list.d.ts +11 -0
  20. package/esm/funcs/imports-list.js +93 -0
  21. package/esm/lib/config.d.ts +2 -2
  22. package/esm/lib/config.js +2 -2
  23. package/esm/models/absent-reason.d.ts +36 -0
  24. package/esm/models/absent-reason.js +44 -0
  25. package/esm/models/absent-record-source.d.ts +13 -0
  26. package/esm/models/absent-record-source.js +14 -0
  27. package/esm/models/absent-record.d.ts +23 -0
  28. package/esm/models/absent-record.js +18 -0
  29. package/esm/models/create-snapshot-from-environment.d.ts +13 -0
  30. package/esm/models/create-snapshot-from-environment.js +12 -0
  31. package/esm/models/create-snapshot-from-import.d.ts +16 -0
  32. package/esm/models/create-snapshot-from-import.js +12 -0
  33. package/esm/models/create-snapshot.d.ts +9 -0
  34. package/esm/models/create-snapshot.js +14 -0
  35. package/esm/models/created-import.d.ts +38 -0
  36. package/esm/models/created-import.js +30 -0
  37. package/esm/models/import-problem.d.ts +40 -0
  38. package/esm/models/import-problem.js +28 -0
  39. package/esm/models/import-status.d.ts +13 -0
  40. package/esm/models/import-status.js +14 -0
  41. package/esm/models/import.d.ts +45 -0
  42. package/esm/models/import.js +36 -0
  43. package/esm/models/index.d.ts +12 -0
  44. package/esm/models/index.js +12 -0
  45. package/esm/models/operations/complete-import.d.ts +11 -0
  46. package/esm/models/operations/complete-import.js +11 -0
  47. package/esm/models/operations/create-import.d.ts +36 -0
  48. package/esm/models/operations/create-import.js +26 -0
  49. package/esm/models/operations/create-snapshot.d.ts +3 -14
  50. package/esm/models/operations/create-snapshot.js +2 -9
  51. package/esm/models/operations/delete-import.d.ts +11 -0
  52. package/esm/models/operations/delete-import.js +11 -0
  53. package/esm/models/operations/get-import.d.ts +11 -0
  54. package/esm/models/operations/get-import.js +11 -0
  55. package/esm/models/operations/index.d.ts +5 -0
  56. package/esm/models/operations/index.js +5 -0
  57. package/esm/models/operations/list-imports.d.ts +30 -0
  58. package/esm/models/operations/list-imports.js +25 -0
  59. package/esm/models/snapshot-app-load.d.ts +20 -0
  60. package/esm/models/snapshot-app-load.js +15 -0
  61. package/esm/models/snapshot-failure-union.d.ts +40 -0
  62. package/esm/models/snapshot-failure-union.js +42 -0
  63. package/esm/models/snapshot.d.ts +15 -17
  64. package/esm/models/snapshot.js +6 -17
  65. package/esm/sdk/imports.d.ts +10 -0
  66. package/esm/sdk/imports.js +27 -0
  67. package/esm/sdk/sdk.d.ts +3 -0
  68. package/esm/sdk/sdk.js +5 -0
  69. package/openapi.json +1258 -184
  70. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { encodeSimple } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as errors from "../models/errors/index.js";
13
+ import * as models from "../models/index.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { APIPromise } from "../types/async.js";
16
+ export function importsGet(client, request, options) {
17
+ return new APIPromise($do(client, request, options));
18
+ }
19
+ async function $do(client, request, options) {
20
+ const parsed = safeParse(request, (value) => z.parse(operations.GetImportRequest$outboundSchema, value), "Input validation failed");
21
+ if (!parsed.ok) {
22
+ return [parsed, { status: "invalid" }];
23
+ }
24
+ const payload = parsed.value;
25
+ const body = null;
26
+ const pathParams = {
27
+ importId: encodeSimple("importId", payload.importId, {
28
+ explode: false,
29
+ charEncoding: "percent",
30
+ }),
31
+ };
32
+ const path = pathToFunc("/v1/imports/{importId}")(pathParams);
33
+ const headers = new Headers(compactMap({
34
+ Accept: "application/json",
35
+ }));
36
+ const secConfig = await extractSecurity(client._options.apiKey);
37
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
38
+ const requestSecurity = resolveGlobalSecurity(securityInput);
39
+ const context = {
40
+ options: client._options,
41
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
42
+ operationID: "getImport",
43
+ oAuth2Scopes: null,
44
+ resolvedSecurity: requestSecurity,
45
+ securitySource: client._options.apiKey,
46
+ retryConfig: options?.retries
47
+ || client._options.retryConfig
48
+ || {
49
+ strategy: "backoff",
50
+ backoff: {
51
+ initialInterval: 1000,
52
+ maxInterval: 5000,
53
+ exponent: 1.5,
54
+ maxElapsedTime: 600000,
55
+ },
56
+ retryConnectionErrors: true,
57
+ }
58
+ || { strategy: "none" },
59
+ retryCodes: options?.retryCodes || ["502", "503", "504"],
60
+ };
61
+ const requestRes = client._createRequest(context, {
62
+ security: requestSecurity,
63
+ method: "GET",
64
+ baseURL: options?.serverURL,
65
+ path: path,
66
+ headers: headers,
67
+ body: body,
68
+ userAgent: client._options.userAgent,
69
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
70
+ }, options);
71
+ if (!requestRes.ok) {
72
+ return [requestRes, { status: "invalid" }];
73
+ }
74
+ const req = requestRes.value;
75
+ const doResult = await client._do(req, {
76
+ context,
77
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
78
+ retryConfig: context.retryConfig,
79
+ retryCodes: context.retryCodes,
80
+ });
81
+ if (!doResult.ok) {
82
+ return [doResult, { status: "request-error", request: req }];
83
+ }
84
+ const response = doResult.value;
85
+ const responseFields = {
86
+ HttpMeta: { Response: response, Request: req },
87
+ };
88
+ const [result] = await M.match(M.json(200, models.Import$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
89
+ if (!result.ok) {
90
+ return [result, { status: "complete", request: req, response }];
91
+ }
92
+ return [result, { status: "complete", request: req, response }];
93
+ }
@@ -0,0 +1,11 @@
1
+ import { StateMachinesCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
6
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
7
+ import { StateMachinesHTTPError } from "../models/errors/state-machines-http-error.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ export declare function importsList(client: StateMachinesCore, request?: operations.ListImportsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListImportsResponse, errors.ErrorT | StateMachinesHTTPError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { encodeFormQuery } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as errors from "../models/errors/index.js";
13
+ import * as operations from "../models/operations/index.js";
14
+ import { APIPromise } from "../types/async.js";
15
+ export function importsList(client, request, options) {
16
+ return new APIPromise($do(client, request, options));
17
+ }
18
+ async function $do(client, request, options) {
19
+ const parsed = safeParse(request, (value) => z.parse(z.optional(operations.ListImportsRequest$outboundSchema), value), "Input validation failed");
20
+ if (!parsed.ok) {
21
+ return [parsed, { status: "invalid" }];
22
+ }
23
+ const payload = parsed.value;
24
+ const body = null;
25
+ const path = pathToFunc("/v1/imports")();
26
+ const query = encodeFormQuery({
27
+ "cursor": payload?.cursor,
28
+ "limit": payload?.limit,
29
+ "status": payload?.status,
30
+ "workspaceId": payload?.workspaceId,
31
+ });
32
+ const headers = new Headers(compactMap({
33
+ Accept: "application/json",
34
+ }));
35
+ const secConfig = await extractSecurity(client._options.apiKey);
36
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
37
+ const requestSecurity = resolveGlobalSecurity(securityInput);
38
+ const context = {
39
+ options: client._options,
40
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
41
+ operationID: "listImports",
42
+ oAuth2Scopes: null,
43
+ resolvedSecurity: requestSecurity,
44
+ securitySource: client._options.apiKey,
45
+ retryConfig: options?.retries
46
+ || client._options.retryConfig
47
+ || {
48
+ strategy: "backoff",
49
+ backoff: {
50
+ initialInterval: 1000,
51
+ maxInterval: 5000,
52
+ exponent: 1.5,
53
+ maxElapsedTime: 600000,
54
+ },
55
+ retryConnectionErrors: true,
56
+ }
57
+ || { strategy: "none" },
58
+ retryCodes: options?.retryCodes || ["502", "503", "504"],
59
+ };
60
+ const requestRes = client._createRequest(context, {
61
+ security: requestSecurity,
62
+ method: "GET",
63
+ baseURL: options?.serverURL,
64
+ path: path,
65
+ headers: headers,
66
+ query: query,
67
+ body: body,
68
+ userAgent: client._options.userAgent,
69
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
70
+ }, options);
71
+ if (!requestRes.ok) {
72
+ return [requestRes, { status: "invalid" }];
73
+ }
74
+ const req = requestRes.value;
75
+ const doResult = await client._do(req, {
76
+ context,
77
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
78
+ retryConfig: context.retryConfig,
79
+ retryCodes: context.retryCodes,
80
+ });
81
+ if (!doResult.ok) {
82
+ return [doResult, { status: "request-error", request: req }];
83
+ }
84
+ const response = doResult.value;
85
+ const responseFields = {
86
+ HttpMeta: { Response: response, Request: req },
87
+ };
88
+ const [result] = await M.match(M.json(200, operations.ListImportsResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
89
+ if (!result.ok) {
90
+ return [result, { status: "complete", request: req, response }];
91
+ }
92
+ return [result, { status: "complete", request: req, response }];
93
+ }
@@ -31,7 +31,7 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
31
31
  export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "1.0.0";
34
- readonly sdkVersion: "0.9.0";
34
+ readonly sdkVersion: "0.10.0";
35
35
  readonly genVersion: "2.941.0";
36
- readonly userAgent: "speakeasy-sdk/typescript 0.9.0 2.941.0 1.0.0 @usestatemachines/sdk";
36
+ readonly userAgent: "speakeasy-sdk/typescript 0.10.0 2.941.0 1.0.0 @usestatemachines/sdk";
37
37
  };
package/esm/lib/config.js CHANGED
@@ -24,7 +24,7 @@ export function serverURLFromOptions(options) {
24
24
  export const SDK_METADATA = {
25
25
  language: "typescript",
26
26
  openapiDocVersion: "1.0.0",
27
- sdkVersion: "0.9.0",
27
+ sdkVersion: "0.10.0",
28
28
  genVersion: "2.941.0",
29
- userAgent: "speakeasy-sdk/typescript 0.9.0 2.941.0 1.0.0 @usestatemachines/sdk",
29
+ userAgent: "speakeasy-sdk/typescript 0.10.0 2.941.0 1.0.0 @usestatemachines/sdk",
30
30
  };
@@ -0,0 +1,36 @@
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 AbsentReasonReference = {
6
+ nativeId: string;
7
+ object: string;
8
+ pointer: string;
9
+ type: "reference";
10
+ };
11
+ export type AbsentReasonProblem = {
12
+ code: string;
13
+ message: string;
14
+ pointer: string | null;
15
+ type: "problem";
16
+ };
17
+ export type AbsentReasonIdentity = {
18
+ message: string;
19
+ type: "identity";
20
+ };
21
+ /**
22
+ * Why the record did not load.
23
+ */
24
+ export type AbsentReason = AbsentReasonIdentity | AbsentReasonProblem | AbsentReasonReference | discriminatedUnionTypes.Unknown<"type">;
25
+ /** @internal */
26
+ export declare const AbsentReasonReference$inboundSchema: z.ZodMiniType<AbsentReasonReference, unknown>;
27
+ export declare function absentReasonReferenceFromJSON(jsonString: string): SafeParseResult<AbsentReasonReference, SDKValidationError>;
28
+ /** @internal */
29
+ export declare const AbsentReasonProblem$inboundSchema: z.ZodMiniType<AbsentReasonProblem, unknown>;
30
+ export declare function absentReasonProblemFromJSON(jsonString: string): SafeParseResult<AbsentReasonProblem, SDKValidationError>;
31
+ /** @internal */
32
+ export declare const AbsentReasonIdentity$inboundSchema: z.ZodMiniType<AbsentReasonIdentity, unknown>;
33
+ export declare function absentReasonIdentityFromJSON(jsonString: string): SafeParseResult<AbsentReasonIdentity, SDKValidationError>;
34
+ /** @internal */
35
+ export declare const AbsentReason$inboundSchema: z.ZodMiniType<AbsentReason, unknown>;
36
+ export declare function absentReasonFromJSON(jsonString: string): SafeParseResult<AbsentReason, 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 { discriminatedUnion } from "../types/discriminated-union.js";
7
+ import * as types from "../types/primitives.js";
8
+ /** @internal */
9
+ export const AbsentReasonReference$inboundSchema = z.object({
10
+ nativeId: types.string(),
11
+ object: types.string(),
12
+ pointer: types.string(),
13
+ type: types.literal("reference"),
14
+ });
15
+ export function absentReasonReferenceFromJSON(jsonString) {
16
+ return safeParse(jsonString, (x) => AbsentReasonReference$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentReasonReference' from JSON`);
17
+ }
18
+ /** @internal */
19
+ export const AbsentReasonProblem$inboundSchema = z.object({
20
+ code: types.string(),
21
+ message: types.string(),
22
+ pointer: types.nullable(types.string()),
23
+ type: types.literal("problem"),
24
+ });
25
+ export function absentReasonProblemFromJSON(jsonString) {
26
+ return safeParse(jsonString, (x) => AbsentReasonProblem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentReasonProblem' from JSON`);
27
+ }
28
+ /** @internal */
29
+ export const AbsentReasonIdentity$inboundSchema = z.object({
30
+ message: types.string(),
31
+ type: types.literal("identity"),
32
+ });
33
+ export function absentReasonIdentityFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => AbsentReasonIdentity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentReasonIdentity' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const AbsentReason$inboundSchema = discriminatedUnion("type", {
38
+ identity: z.lazy(() => AbsentReasonIdentity$inboundSchema),
39
+ problem: z.lazy(() => AbsentReasonProblem$inboundSchema),
40
+ reference: z.lazy(() => AbsentReasonReference$inboundSchema),
41
+ });
42
+ export function absentReasonFromJSON(jsonString) {
43
+ return safeParse(jsonString, (x) => AbsentReason$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentReason' from JSON`);
44
+ }
@@ -0,0 +1,13 @@
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
+ /**
5
+ * The file of the record in the import, such as `salesforce/records/Opportunity.jsonl`, and its line, counted from 1.
6
+ */
7
+ export type AbsentRecordSource = {
8
+ file: string;
9
+ line: number | null;
10
+ };
11
+ /** @internal */
12
+ export declare const AbsentRecordSource$inboundSchema: z.ZodMiniType<AbsentRecordSource, unknown>;
13
+ export declare function absentRecordSourceFromJSON(jsonString: string): SafeParseResult<AbsentRecordSource, SDKValidationError>;
@@ -0,0 +1,14 @@
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 AbsentRecordSource$inboundSchema = z.object({
9
+ file: types.string(),
10
+ line: types.nullable(types.number()),
11
+ });
12
+ export function absentRecordSourceFromJSON(jsonString) {
13
+ return safeParse(jsonString, (x) => AbsentRecordSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentRecordSource' from JSON`);
14
+ }
@@ -0,0 +1,23 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { AbsentReason } from "./absent-reason.js";
4
+ import { AbsentRecordSource } from "./absent-record-source.js";
5
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
6
+ export type AbsentRecord = {
7
+ /**
8
+ * The vendor's ID of the record, or null for a record that holds none.
9
+ */
10
+ nativeId: string | null;
11
+ object: string;
12
+ /**
13
+ * Why the record did not load.
14
+ */
15
+ reason: AbsentReason;
16
+ /**
17
+ * The file of the record in the import, such as `salesforce/records/Opportunity.jsonl`, and its line, counted from 1.
18
+ */
19
+ source: AbsentRecordSource;
20
+ };
21
+ /** @internal */
22
+ export declare const AbsentRecord$inboundSchema: z.ZodMiniType<AbsentRecord, unknown>;
23
+ export declare function absentRecordFromJSON(jsonString: string): SafeParseResult<AbsentRecord, 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
+ import { AbsentReason$inboundSchema } from "./absent-reason.js";
8
+ import { AbsentRecordSource$inboundSchema, } from "./absent-record-source.js";
9
+ /** @internal */
10
+ export const AbsentRecord$inboundSchema = z.object({
11
+ nativeId: types.nullable(types.string()),
12
+ object: types.string(),
13
+ reason: AbsentReason$inboundSchema,
14
+ source: AbsentRecordSource$inboundSchema,
15
+ });
16
+ export function absentRecordFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => AbsentRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AbsentRecord' from JSON`);
18
+ }
@@ -0,0 +1,13 @@
1
+ import * as z from "zod/v4-mini";
2
+ export type CreateSnapshotFromEnvironment = {
3
+ environmentId: string;
4
+ name?: string | null | undefined;
5
+ };
6
+ /** @internal */
7
+ export type CreateSnapshotFromEnvironment$Outbound = {
8
+ environmentId: string;
9
+ name?: string | null | undefined;
10
+ };
11
+ /** @internal */
12
+ export declare const CreateSnapshotFromEnvironment$outboundSchema: z.ZodMiniType<CreateSnapshotFromEnvironment$Outbound, CreateSnapshotFromEnvironment>;
13
+ export declare function createSnapshotFromEnvironmentToJSON(createSnapshotFromEnvironment: CreateSnapshotFromEnvironment): string;
@@ -0,0 +1,12 @@
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 CreateSnapshotFromEnvironment$outboundSchema = z.object({
7
+ environmentId: z.string(),
8
+ name: z.optional(z.nullable(z.string())),
9
+ });
10
+ export function createSnapshotFromEnvironmentToJSON(createSnapshotFromEnvironment) {
11
+ return JSON.stringify(CreateSnapshotFromEnvironment$outboundSchema.parse(createSnapshotFromEnvironment));
12
+ }
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4-mini";
2
+ export type CreateSnapshotFromImport = {
3
+ /**
4
+ * A `ready` import that the caller reaches. The snapshot gets every app of the import, each on the app's default version, with empty setup and services.
5
+ */
6
+ importId: string;
7
+ name?: string | null | undefined;
8
+ };
9
+ /** @internal */
10
+ export type CreateSnapshotFromImport$Outbound = {
11
+ importId: string;
12
+ name?: string | null | undefined;
13
+ };
14
+ /** @internal */
15
+ export declare const CreateSnapshotFromImport$outboundSchema: z.ZodMiniType<CreateSnapshotFromImport$Outbound, CreateSnapshotFromImport>;
16
+ export declare function createSnapshotFromImportToJSON(createSnapshotFromImport: CreateSnapshotFromImport): string;
@@ -0,0 +1,12 @@
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 CreateSnapshotFromImport$outboundSchema = z.object({
7
+ importId: z.string(),
8
+ name: z.optional(z.nullable(z.string())),
9
+ });
10
+ export function createSnapshotFromImportToJSON(createSnapshotFromImport) {
11
+ return JSON.stringify(CreateSnapshotFromImport$outboundSchema.parse(createSnapshotFromImport));
12
+ }
@@ -0,0 +1,9 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { CreateSnapshotFromEnvironment, CreateSnapshotFromEnvironment$Outbound } from "./create-snapshot-from-environment.js";
3
+ import { CreateSnapshotFromImport, CreateSnapshotFromImport$Outbound } from "./create-snapshot-from-import.js";
4
+ export type CreateSnapshot = CreateSnapshotFromEnvironment | CreateSnapshotFromImport;
5
+ /** @internal */
6
+ export type CreateSnapshot$Outbound = CreateSnapshotFromEnvironment$Outbound | CreateSnapshotFromImport$Outbound;
7
+ /** @internal */
8
+ export declare const CreateSnapshot$outboundSchema: z.ZodMiniType<CreateSnapshot$Outbound, CreateSnapshot>;
9
+ export declare function createSnapshotToJSON(createSnapshot: CreateSnapshot): string;
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { smartUnion } from "../types/smart-union.js";
5
+ import { CreateSnapshotFromEnvironment$outboundSchema, } from "./create-snapshot-from-environment.js";
6
+ import { CreateSnapshotFromImport$outboundSchema, } from "./create-snapshot-from-import.js";
7
+ /** @internal */
8
+ export const CreateSnapshot$outboundSchema = smartUnion([
9
+ CreateSnapshotFromEnvironment$outboundSchema,
10
+ CreateSnapshotFromImport$outboundSchema,
11
+ ]);
12
+ export function createSnapshotToJSON(createSnapshot) {
13
+ return JSON.stringify(CreateSnapshot$outboundSchema.parse(createSnapshot));
14
+ }
@@ -0,0 +1,38 @@
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 { Import } from "./import.js";
6
+ export declare const Method: {
7
+ readonly Put: "PUT";
8
+ };
9
+ export type Method = ClosedEnum<typeof Method>;
10
+ /**
11
+ * Where to send the zip file while the import is `uploading`, and null after. Complete the import once the upload succeeds.
12
+ */
13
+ export type ImportUpload = {
14
+ expiresAt: Date;
15
+ /**
16
+ * Send the zip file as the body of a PUT to `url`, with each of these headers as given. The URL refuses another value of each.
17
+ */
18
+ headers: {
19
+ [k: string]: string;
20
+ };
21
+ method: Method;
22
+ url: string;
23
+ };
24
+ export type CreatedImport = {
25
+ import: Import;
26
+ /**
27
+ * Where to send the zip file while the import is `uploading`, and null after. Complete the import once the upload succeeds.
28
+ */
29
+ upload: ImportUpload | null;
30
+ };
31
+ /** @internal */
32
+ export declare const Method$inboundSchema: z.ZodMiniEnum<typeof Method>;
33
+ /** @internal */
34
+ export declare const ImportUpload$inboundSchema: z.ZodMiniType<ImportUpload, unknown>;
35
+ export declare function importUploadFromJSON(jsonString: string): SafeParseResult<ImportUpload, SDKValidationError>;
36
+ /** @internal */
37
+ export declare const CreatedImport$inboundSchema: z.ZodMiniType<CreatedImport, unknown>;
38
+ export declare function createdImportFromJSON(jsonString: string): SafeParseResult<CreatedImport, 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 types from "../types/primitives.js";
7
+ import { Import$inboundSchema } from "./import.js";
8
+ export const Method = {
9
+ Put: "PUT",
10
+ };
11
+ /** @internal */
12
+ export const Method$inboundSchema = z.enum(Method);
13
+ /** @internal */
14
+ export const ImportUpload$inboundSchema = z.object({
15
+ expiresAt: types.date(),
16
+ headers: z.record(z.string(), types.string()),
17
+ method: Method$inboundSchema,
18
+ url: types.string(),
19
+ });
20
+ export function importUploadFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => ImportUpload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportUpload' from JSON`);
22
+ }
23
+ /** @internal */
24
+ export const CreatedImport$inboundSchema = z.object({
25
+ import: Import$inboundSchema,
26
+ upload: types.nullable(z.lazy(() => ImportUpload$inboundSchema)),
27
+ });
28
+ export function createdImportFromJSON(jsonString) {
29
+ return safeParse(jsonString, (x) => CreatedImport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatedImport' from JSON`);
30
+ }
@@ -0,0 +1,40 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
+ /**
6
+ * An error refuses the import: the check of the zip file makes the import `invalid`, and the load of a snapshot from the import fails the snapshot. A warning refuses nothing.
7
+ */
8
+ export declare const Severity: {
9
+ readonly Error: "error";
10
+ readonly Warning: "warning";
11
+ };
12
+ /**
13
+ * An error refuses the import: the check of the zip file makes the import `invalid`, and the load of a snapshot from the import fails the snapshot. A warning refuses nothing.
14
+ */
15
+ export type Severity = OpenEnum<typeof Severity>;
16
+ export type ImportProblem = {
17
+ code: string;
18
+ /**
19
+ * The path in the import, such as `salesforce/records/Account.jsonl`. An empty path names the zip file as a whole.
20
+ */
21
+ file: string;
22
+ /**
23
+ * The line in the file, counted from 1, or null when the problem is about the whole file.
24
+ */
25
+ line: number | null;
26
+ message: string;
27
+ /**
28
+ * The JSON pointer of the value, such as `/apps/0/name`. In a records file, it points into the record on `line`. Null when the problem names no value.
29
+ */
30
+ pointer: string | null;
31
+ /**
32
+ * An error refuses the import: the check of the zip file makes the import `invalid`, and the load of a snapshot from the import fails the snapshot. A warning refuses nothing.
33
+ */
34
+ severity: Severity;
35
+ };
36
+ /** @internal */
37
+ export declare const Severity$inboundSchema: z.ZodMiniType<Severity, unknown>;
38
+ /** @internal */
39
+ export declare const ImportProblem$inboundSchema: z.ZodMiniType<ImportProblem, unknown>;
40
+ export declare function importProblemFromJSON(jsonString: string): SafeParseResult<ImportProblem, SDKValidationError>;
@@ -0,0 +1,28 @@
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
+ /**
9
+ * An error refuses the import: the check of the zip file makes the import `invalid`, and the load of a snapshot from the import fails the snapshot. A warning refuses nothing.
10
+ */
11
+ export const Severity = {
12
+ Error: "error",
13
+ Warning: "warning",
14
+ };
15
+ /** @internal */
16
+ export const Severity$inboundSchema = openEnums.inboundSchema(Severity);
17
+ /** @internal */
18
+ export const ImportProblem$inboundSchema = z.object({
19
+ code: types.string(),
20
+ file: types.string(),
21
+ line: types.nullable(types.number()),
22
+ message: types.string(),
23
+ pointer: types.nullable(types.string()),
24
+ severity: Severity$inboundSchema,
25
+ });
26
+ export function importProblemFromJSON(jsonString) {
27
+ return safeParse(jsonString, (x) => ImportProblem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportProblem' from JSON`);
28
+ }
@@ -0,0 +1,13 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const ImportStatus: {
4
+ readonly Uploading: "uploading";
5
+ readonly Ready: "ready";
6
+ readonly Invalid: "invalid";
7
+ readonly Deleted: "deleted";
8
+ };
9
+ export type ImportStatus = OpenEnum<typeof ImportStatus>;
10
+ /** @internal */
11
+ export declare const ImportStatus$inboundSchema: z.ZodMiniType<ImportStatus, unknown>;
12
+ /** @internal */
13
+ export declare const ImportStatus$outboundSchema: z.ZodMiniType<string, ImportStatus>;
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as openEnums from "../types/enums.js";
5
+ export const ImportStatus = {
6
+ Uploading: "uploading",
7
+ Ready: "ready",
8
+ Invalid: "invalid",
9
+ Deleted: "deleted",
10
+ };
11
+ /** @internal */
12
+ export const ImportStatus$inboundSchema = openEnums.inboundSchema(ImportStatus);
13
+ /** @internal */
14
+ export const ImportStatus$outboundSchema = openEnums.outboundSchema(ImportStatus);