@usestatemachines/sdk 0.11.0 → 0.12.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 (104) hide show
  1. package/README.md +80 -15
  2. package/agents/SKILL.md +9 -4
  3. package/agents/index.js +4 -4
  4. package/agents/llms.txt +7 -5
  5. package/esm/extensions/client.d.ts +56 -8
  6. package/esm/extensions/client.js +67 -5
  7. package/esm/extensions/credentials.js +4 -0
  8. package/esm/extensions/environment.d.ts +11 -2
  9. package/esm/extensions/errors.d.ts +33 -0
  10. package/esm/extensions/errors.js +53 -0
  11. package/esm/extensions/import-data.d.ts +43 -0
  12. package/esm/extensions/import-data.js +88 -0
  13. package/esm/extensions/index.d.ts +4 -3
  14. package/esm/extensions/index.js +1 -1
  15. package/esm/extensions/packaging.d.ts +1 -0
  16. package/esm/extensions/packaging.js +1 -0
  17. package/esm/extensions/zip.d.ts +8 -0
  18. package/esm/extensions/zip.js +121 -0
  19. package/esm/funcs/environments-actors.d.ts +11 -0
  20. package/esm/funcs/environments-actors.js +102 -0
  21. package/esm/funcs/get-import-file.d.ts +12 -0
  22. package/esm/funcs/get-import-file.js +97 -0
  23. package/esm/funcs/list-import-files.d.ts +12 -0
  24. package/esm/funcs/list-import-files.js +98 -0
  25. package/esm/funcs/upload-import.d.ts +12 -0
  26. package/esm/funcs/upload-import.js +96 -0
  27. package/esm/lib/config.d.ts +2 -2
  28. package/esm/lib/config.js +2 -2
  29. package/esm/models/absent-record.d.ts +7 -3
  30. package/esm/models/absent-record.js +3 -2
  31. package/esm/models/actor.d.ts +3 -0
  32. package/esm/models/app-user.d.ts +17 -0
  33. package/esm/models/app-user.js +18 -0
  34. package/esm/models/credentials.d.ts +6 -1
  35. package/esm/models/credentials.js +2 -0
  36. package/esm/models/environment.d.ts +4 -4
  37. package/esm/models/environment.js +3 -4
  38. package/esm/models/error.d.ts +7 -0
  39. package/esm/models/error.js +4 -0
  40. package/esm/models/filled-field.d.ts +14 -0
  41. package/esm/models/filled-field.js +16 -0
  42. package/esm/models/import-actor.d.ts +16 -0
  43. package/esm/models/import-actor.js +15 -0
  44. package/esm/models/import-file.d.ts +56 -0
  45. package/esm/models/import-file.js +67 -0
  46. package/esm/models/import-folder.d.ts +56 -0
  47. package/esm/models/import-folder.js +75 -0
  48. package/esm/models/import-problem.d.ts +4 -4
  49. package/esm/models/import-problem.js +1 -1
  50. package/esm/models/index.d.ts +18 -1
  51. package/esm/models/index.js +18 -1
  52. package/esm/models/known-difference.d.ts +21 -0
  53. package/esm/models/known-difference.js +16 -0
  54. package/esm/models/launch-ui-session.d.ts +12 -2
  55. package/esm/models/launch-ui-session.js +2 -1
  56. package/esm/models/made-id.d.ts +22 -0
  57. package/esm/models/made-id.js +17 -0
  58. package/esm/models/matched-record.d.ts +22 -0
  59. package/esm/models/matched-record.js +17 -0
  60. package/esm/models/object-load.d.ts +21 -0
  61. package/esm/models/object-load.js +17 -0
  62. package/esm/models/operations/create-credentials.d.ts +10 -0
  63. package/esm/models/operations/create-credentials.js +1 -0
  64. package/esm/models/operations/get-import-file.d.ts +13 -0
  65. package/esm/models/operations/get-import-file.js +12 -0
  66. package/esm/models/operations/index.d.ts +4 -0
  67. package/esm/models/operations/index.js +4 -0
  68. package/esm/models/operations/list-actors.d.ts +32 -0
  69. package/esm/models/operations/list-actors.js +26 -0
  70. package/esm/models/operations/list-import-files.d.ts +15 -0
  71. package/esm/models/operations/list-import-files.js +13 -0
  72. package/esm/models/operations/list-snapshots.d.ts +2 -2
  73. package/esm/models/operations/list-snapshots.js +1 -1
  74. package/esm/models/operations/upload-import.d.ts +13 -0
  75. package/esm/models/operations/upload-import.js +17 -0
  76. package/esm/models/problem-counts.d.ts +17 -0
  77. package/esm/models/problem-counts.js +14 -0
  78. package/esm/models/received-import.d.ts +9 -0
  79. package/esm/models/received-import.js +13 -0
  80. package/esm/models/record-source.d.ts +13 -0
  81. package/esm/models/{absent-record-source.js → record-source.js} +3 -3
  82. package/esm/models/snapshot-app-full-load-counts.d.ts +57 -0
  83. package/esm/models/snapshot-app-full-load-counts.js +25 -0
  84. package/esm/models/snapshot-app-full-load.d.ts +101 -0
  85. package/esm/models/snapshot-app-full-load.js +42 -0
  86. package/esm/models/snapshot-app-limited-load-counts.d.ts +16 -0
  87. package/esm/models/snapshot-app-limited-load-counts.js +14 -0
  88. package/esm/models/snapshot-app-limited-load.d.ts +18 -0
  89. package/esm/models/snapshot-app-limited-load.js +16 -0
  90. package/esm/models/snapshot-app-load-counts.d.ts +13 -0
  91. package/esm/models/snapshot-app-load-counts.js +15 -0
  92. package/esm/models/snapshot-app-load.d.ts +5 -12
  93. package/esm/models/snapshot-app-load.js +6 -6
  94. package/esm/models/snapshot-list-item.d.ts +53 -0
  95. package/esm/models/snapshot-list-item.js +42 -0
  96. package/esm/models/snapshot.d.ts +1 -1
  97. package/esm/models/version.d.ts +3 -0
  98. package/esm/sdk/environments.d.ts +1 -0
  99. package/esm/sdk/environments.js +4 -0
  100. package/esm/sdk/sdk.d.ts +3 -0
  101. package/esm/sdk/sdk.js +12 -0
  102. package/openapi.json +1868 -510
  103. package/package.json +7 -3
  104. package/esm/models/absent-record-source.d.ts +0 -13
@@ -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 AppUser$inboundSchema = z.object({
9
+ default: types.boolean(),
10
+ email: types.nullable(types.string()),
11
+ id: types.string(),
12
+ name: types.string(),
13
+ role: types.nullable(types.string()),
14
+ username: types.nullable(types.string()),
15
+ });
16
+ export function appUserFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => AppUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppUser' from JSON`);
18
+ }
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4-mini";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { AppUser } from "./app-user.js";
3
4
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
4
5
  export type Login = {
5
6
  authentication: string;
@@ -14,7 +15,7 @@ export type Login = {
14
15
  export type CredentialsMcpServer = {
15
16
  name: string;
16
17
  /**
17
- * The MCP server's URL. On an environment created with `tokenInUrl`, a request with no `Authorization` header acts as the actor that this call picks when you send no `actorId`. To act as `actorId`, send the service's headers.
18
+ * The MCP server's URL. On an environment created with `tokenInUrl`, a request with no `Authorization` header acts as the app's default user. To act as the user of these credentials, send the service's headers.
18
19
  */
19
20
  url: string;
20
21
  };
@@ -30,6 +31,10 @@ export type CredentialsService = {
30
31
  url: string;
31
32
  };
32
33
  export type Credentials = {
34
+ /**
35
+ * A user of an app who can sign in, as the app answers it.
36
+ */
37
+ actor?: AppUser | undefined;
33
38
  actorId: string;
34
39
  appName: string;
35
40
  environmentId: string;
@@ -4,6 +4,7 @@
4
4
  import * as z from "zod/v4-mini";
5
5
  import { safeParse } from "../lib/schemas.js";
6
6
  import * as types from "../types/primitives.js";
7
+ import { AppUser$inboundSchema } from "./app-user.js";
7
8
  /** @internal */
8
9
  export const Login$inboundSchema = z.object({
9
10
  authentication: types.string(),
@@ -35,6 +36,7 @@ export function credentialsServiceFromJSON(jsonString) {
35
36
  /** @internal */
36
37
  export const Credentials$inboundSchema = z
37
38
  .object({
39
+ actor: types.optional(AppUser$inboundSchema),
38
40
  actorId: types.string(),
39
41
  appName: types.string(),
40
42
  environmentId: types.string(),
@@ -23,12 +23,12 @@ export type EnvironmentApp = {
23
23
  version: string;
24
24
  versionId: string;
25
25
  };
26
- export declare const Reason: {
26
+ export declare const EnvironmentReason: {
27
27
  readonly Cancelled: "cancelled";
28
28
  readonly Expired: "expired";
29
29
  readonly Failed: "failed";
30
30
  };
31
- export type Reason = OpenEnum<typeof Reason>;
31
+ export type EnvironmentReason = OpenEnum<typeof EnvironmentReason>;
32
32
  export type Environment = {
33
33
  apps: Array<EnvironmentApp>;
34
34
  createdAt: Date;
@@ -41,7 +41,7 @@ export type Environment = {
41
41
  [k: string]: string;
42
42
  };
43
43
  name: string | null;
44
- reason: Reason | null;
44
+ reason: EnvironmentReason | null;
45
45
  snapshotId: string | null;
46
46
  startedAt: Date | null;
47
47
  status: EnvironmentStatus;
@@ -56,7 +56,7 @@ export declare function browserServiceFromJSON(jsonString: string): SafeParseRes
56
56
  export declare const EnvironmentApp$inboundSchema: z.ZodMiniType<EnvironmentApp, unknown>;
57
57
  export declare function environmentAppFromJSON(jsonString: string): SafeParseResult<EnvironmentApp, SDKValidationError>;
58
58
  /** @internal */
59
- export declare const Reason$inboundSchema: z.ZodMiniType<Reason, unknown>;
59
+ export declare const EnvironmentReason$inboundSchema: z.ZodMiniType<EnvironmentReason, unknown>;
60
60
  /** @internal */
61
61
  export declare const Environment$inboundSchema: z.ZodMiniType<Environment, unknown>;
62
62
  export declare function environmentFromJSON(jsonString: string): SafeParseResult<Environment, SDKValidationError>;
@@ -8,7 +8,7 @@ import * as types from "../types/primitives.js";
8
8
  import { EnvironmentFailure$inboundSchema, } from "./environment-failure.js";
9
9
  import { EnvironmentStatus$inboundSchema, } from "./environment-status.js";
10
10
  import { Principal$inboundSchema } from "./principal.js";
11
- export const Reason = {
11
+ export const EnvironmentReason = {
12
12
  Cancelled: "cancelled",
13
13
  Expired: "expired",
14
14
  Failed: "failed",
@@ -36,8 +36,7 @@ export function environmentAppFromJSON(jsonString) {
36
36
  return safeParse(jsonString, (x) => EnvironmentApp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentApp' from JSON`);
37
37
  }
38
38
  /** @internal */
39
- export const Reason$inboundSchema = openEnums
40
- .inboundSchema(Reason);
39
+ export const EnvironmentReason$inboundSchema = openEnums.inboundSchema(EnvironmentReason);
41
40
  /** @internal */
42
41
  export const Environment$inboundSchema = z
43
42
  .object({
@@ -50,7 +49,7 @@ export const Environment$inboundSchema = z
50
49
  id: types.string(),
51
50
  labels: z.record(z.string(), types.string()),
52
51
  name: types.nullable(types.string()),
53
- reason: types.nullable(Reason$inboundSchema),
52
+ reason: types.nullable(EnvironmentReason$inboundSchema),
54
53
  snapshotId: types.nullable(types.string()),
55
54
  startedAt: types.nullable(types.date()),
56
55
  status: EnvironmentStatus$inboundSchema,
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/v4-mini";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { AppUser } from "./app-user.js";
4
5
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
6
  export declare const ErrorCode: {
6
7
  readonly InvalidRequest: "invalid_request";
@@ -16,8 +17,10 @@ export declare const ErrorCode: {
16
17
  readonly WorkspaceArchived: "workspace_archived";
17
18
  readonly VersionInUse: "version_in_use";
18
19
  readonly UiDisabled: "ui_disabled";
20
+ readonly ActorCannotSignIn: "actor_cannot_sign_in";
19
21
  readonly BodyTooLarge: "body_too_large";
20
22
  readonly VersionUnavailable: "version_unavailable";
23
+ readonly ActorNotFound: "actor_not_found";
21
24
  readonly EnvironmentLimitReached: "environment_limit_reached";
22
25
  readonly RateLimited: "rate_limited";
23
26
  readonly InternalError: "internal_error";
@@ -30,6 +33,10 @@ export type ErrorT = {
30
33
  [k: string]: Array<string>;
31
34
  } | undefined;
32
35
  message: string;
36
+ /**
37
+ * On `actor_not_found`, the users who can act in the app that are nearest to `as`, nearest first.
38
+ */
39
+ nearest?: Array<AppUser> | undefined;
33
40
  requestId: string;
34
41
  status?: string | undefined;
35
42
  };
@@ -5,6 +5,7 @@ import * as z from "zod/v4-mini";
5
5
  import { safeParse } from "../lib/schemas.js";
6
6
  import * as openEnums from "../types/enums.js";
7
7
  import * as types from "../types/primitives.js";
8
+ import { AppUser$inboundSchema } from "./app-user.js";
8
9
  export const ErrorCode = {
9
10
  InvalidRequest: "invalid_request",
10
11
  Unauthenticated: "unauthenticated",
@@ -19,8 +20,10 @@ export const ErrorCode = {
19
20
  WorkspaceArchived: "workspace_archived",
20
21
  VersionInUse: "version_in_use",
21
22
  UiDisabled: "ui_disabled",
23
+ ActorCannotSignIn: "actor_cannot_sign_in",
22
24
  BodyTooLarge: "body_too_large",
23
25
  VersionUnavailable: "version_unavailable",
26
+ ActorNotFound: "actor_not_found",
24
27
  EnvironmentLimitReached: "environment_limit_reached",
25
28
  RateLimited: "rate_limited",
26
29
  InternalError: "internal_error",
@@ -33,6 +36,7 @@ export const ErrorT$inboundSchema = z.object({
33
36
  code: ErrorCode$inboundSchema,
34
37
  fields: types.optional(z.record(z.string(), z.array(types.string()))),
35
38
  message: types.string(),
39
+ nearest: types.optional(z.array(AppUser$inboundSchema)),
36
40
  requestId: types.string(),
37
41
  status: types.optional(types.string()),
38
42
  });
@@ -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 FilledField = {
5
+ field: string;
6
+ object: string;
7
+ /**
8
+ * How many loaded records of the object the app filled the field for.
9
+ */
10
+ records: number;
11
+ };
12
+ /** @internal */
13
+ export declare const FilledField$inboundSchema: z.ZodMiniType<FilledField, unknown>;
14
+ export declare function filledFieldFromJSON(jsonString: string): SafeParseResult<FilledField, 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
+ /** @internal */
8
+ export const FilledField$inboundSchema = z
9
+ .object({
10
+ field: types.string(),
11
+ object: types.string(),
12
+ records: types.number(),
13
+ });
14
+ export function filledFieldFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => FilledField$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FilledField' from JSON`);
16
+ }
@@ -0,0 +1,16 @@
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 ImportActor = {
5
+ /**
6
+ * The ID of the user in the app's database.
7
+ */
8
+ id: string;
9
+ /**
10
+ * The entry of `actors` in the manifest: an email, a username or an ID.
11
+ */
12
+ user: string;
13
+ };
14
+ /** @internal */
15
+ export declare const ImportActor$inboundSchema: z.ZodMiniType<ImportActor, unknown>;
16
+ export declare function importActorFromJSON(jsonString: string): SafeParseResult<ImportActor, 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 ImportActor$inboundSchema = z
9
+ .object({
10
+ id: types.string(),
11
+ user: types.string(),
12
+ });
13
+ export function importActorFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => ImportActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportActor' from JSON`);
15
+ }
@@ -0,0 +1,56 @@
1
+ import * as z from "zod/v4-mini";
2
+ import * as discriminatedUnionTypes from "../types/discriminated-union.js";
3
+ import { OpenEnum } from "../types/enums.js";
4
+ import { Result as SafeParseResult } from "../types/fp.js";
5
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
6
+ export type Table = {
7
+ columns: Array<string>;
8
+ name: string;
9
+ rows: Array<Array<string>>;
10
+ truncated: boolean;
11
+ };
12
+ export type ImportFileText = {
13
+ kind: "text";
14
+ path: string;
15
+ sizeBytes: number;
16
+ tables: Array<Table>;
17
+ tablesTruncated: boolean;
18
+ text: string;
19
+ truncated: boolean;
20
+ };
21
+ export type ImportFileBinary = {
22
+ kind: "binary";
23
+ path: string;
24
+ sizeBytes: number;
25
+ };
26
+ export declare const ImportFileReason: {
27
+ readonly Uploading: "uploading";
28
+ readonly Invalid: "invalid";
29
+ readonly Deleted: "deleted";
30
+ readonly Missing: "missing";
31
+ readonly Unreadable: "unreadable";
32
+ readonly TooLarge: "too_large";
33
+ };
34
+ export type ImportFileReason = OpenEnum<typeof ImportFileReason>;
35
+ export type ImportFileUnavailable = {
36
+ kind: "unavailable";
37
+ reason: ImportFileReason;
38
+ };
39
+ export type ImportFile = ImportFileUnavailable | ImportFileBinary | ImportFileText | discriminatedUnionTypes.Unknown<"kind">;
40
+ /** @internal */
41
+ export declare const Table$inboundSchema: z.ZodMiniType<Table, unknown>;
42
+ export declare function tableFromJSON(jsonString: string): SafeParseResult<Table, SDKValidationError>;
43
+ /** @internal */
44
+ export declare const ImportFileText$inboundSchema: z.ZodMiniType<ImportFileText, unknown>;
45
+ export declare function importFileTextFromJSON(jsonString: string): SafeParseResult<ImportFileText, SDKValidationError>;
46
+ /** @internal */
47
+ export declare const ImportFileBinary$inboundSchema: z.ZodMiniType<ImportFileBinary, unknown>;
48
+ export declare function importFileBinaryFromJSON(jsonString: string): SafeParseResult<ImportFileBinary, SDKValidationError>;
49
+ /** @internal */
50
+ export declare const ImportFileReason$inboundSchema: z.ZodMiniType<ImportFileReason, unknown>;
51
+ /** @internal */
52
+ export declare const ImportFileUnavailable$inboundSchema: z.ZodMiniType<ImportFileUnavailable, unknown>;
53
+ export declare function importFileUnavailableFromJSON(jsonString: string): SafeParseResult<ImportFileUnavailable, SDKValidationError>;
54
+ /** @internal */
55
+ export declare const ImportFile$inboundSchema: z.ZodMiniType<ImportFile, unknown>;
56
+ export declare function importFileFromJSON(jsonString: string): SafeParseResult<ImportFile, SDKValidationError>;
@@ -0,0 +1,67 @@
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 openEnums from "../types/enums.js";
8
+ import * as types from "../types/primitives.js";
9
+ export const ImportFileReason = {
10
+ Uploading: "uploading",
11
+ Invalid: "invalid",
12
+ Deleted: "deleted",
13
+ Missing: "missing",
14
+ Unreadable: "unreadable",
15
+ TooLarge: "too_large",
16
+ };
17
+ /** @internal */
18
+ export const Table$inboundSchema = z.object({
19
+ columns: z.array(types.string()),
20
+ name: types.string(),
21
+ rows: z.array(z.array(types.string())),
22
+ truncated: types.boolean(),
23
+ });
24
+ export function tableFromJSON(jsonString) {
25
+ return safeParse(jsonString, (x) => Table$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Table' from JSON`);
26
+ }
27
+ /** @internal */
28
+ export const ImportFileText$inboundSchema = z.object({
29
+ kind: types.literal("text"),
30
+ path: types.string(),
31
+ sizeBytes: types.number(),
32
+ tables: z.array(z.lazy(() => Table$inboundSchema)),
33
+ tablesTruncated: types.boolean(),
34
+ text: types.string(),
35
+ truncated: types.boolean(),
36
+ });
37
+ export function importFileTextFromJSON(jsonString) {
38
+ return safeParse(jsonString, (x) => ImportFileText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFileText' from JSON`);
39
+ }
40
+ /** @internal */
41
+ export const ImportFileBinary$inboundSchema = z.object({
42
+ kind: types.literal("binary"),
43
+ path: types.string(),
44
+ sizeBytes: types.number(),
45
+ });
46
+ export function importFileBinaryFromJSON(jsonString) {
47
+ return safeParse(jsonString, (x) => ImportFileBinary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFileBinary' from JSON`);
48
+ }
49
+ /** @internal */
50
+ export const ImportFileReason$inboundSchema = openEnums.inboundSchema(ImportFileReason);
51
+ /** @internal */
52
+ export const ImportFileUnavailable$inboundSchema = z.object({
53
+ kind: types.literal("unavailable"),
54
+ reason: ImportFileReason$inboundSchema,
55
+ });
56
+ export function importFileUnavailableFromJSON(jsonString) {
57
+ return safeParse(jsonString, (x) => ImportFileUnavailable$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFileUnavailable' from JSON`);
58
+ }
59
+ /** @internal */
60
+ export const ImportFile$inboundSchema = discriminatedUnion("kind", {
61
+ unavailable: z.lazy(() => ImportFileUnavailable$inboundSchema),
62
+ binary: z.lazy(() => ImportFileBinary$inboundSchema),
63
+ text: z.lazy(() => ImportFileText$inboundSchema),
64
+ });
65
+ export function importFileFromJSON(jsonString) {
66
+ return safeParse(jsonString, (x) => ImportFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFile' from JSON`);
67
+ }
@@ -0,0 +1,56 @@
1
+ import * as z from "zod/v4-mini";
2
+ import * as discriminatedUnionTypes from "../types/discriminated-union.js";
3
+ import { OpenEnum } from "../types/enums.js";
4
+ import { Result as SafeParseResult } from "../types/fp.js";
5
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
6
+ export type EntryFile = {
7
+ kind: "file";
8
+ path: string;
9
+ sizeBytes: number;
10
+ };
11
+ export type EntryFolder = {
12
+ kind: "folder";
13
+ path: string;
14
+ };
15
+ export type Entry = EntryFolder | EntryFile | discriminatedUnionTypes.Unknown<"kind">;
16
+ export type ImportFolderFolder = {
17
+ entries: Array<EntryFolder | EntryFile | discriminatedUnionTypes.Unknown<"kind">>;
18
+ kind: "folder";
19
+ name: string | null;
20
+ nextCursor: string | null;
21
+ path: string;
22
+ };
23
+ export declare const ImportFolderReason: {
24
+ readonly Uploading: "uploading";
25
+ readonly Invalid: "invalid";
26
+ readonly Deleted: "deleted";
27
+ readonly Missing: "missing";
28
+ readonly Unreadable: "unreadable";
29
+ readonly TooLarge: "too_large";
30
+ };
31
+ export type ImportFolderReason = OpenEnum<typeof ImportFolderReason>;
32
+ export type ImportFolderUnavailable = {
33
+ kind: "unavailable";
34
+ reason: ImportFolderReason;
35
+ };
36
+ export type ImportFolder = ImportFolderUnavailable | ImportFolderFolder | discriminatedUnionTypes.Unknown<"kind">;
37
+ /** @internal */
38
+ export declare const EntryFile$inboundSchema: z.ZodMiniType<EntryFile, unknown>;
39
+ export declare function entryFileFromJSON(jsonString: string): SafeParseResult<EntryFile, SDKValidationError>;
40
+ /** @internal */
41
+ export declare const EntryFolder$inboundSchema: z.ZodMiniType<EntryFolder, unknown>;
42
+ export declare function entryFolderFromJSON(jsonString: string): SafeParseResult<EntryFolder, SDKValidationError>;
43
+ /** @internal */
44
+ export declare const Entry$inboundSchema: z.ZodMiniType<Entry, unknown>;
45
+ export declare function entryFromJSON(jsonString: string): SafeParseResult<Entry, SDKValidationError>;
46
+ /** @internal */
47
+ export declare const ImportFolderFolder$inboundSchema: z.ZodMiniType<ImportFolderFolder, unknown>;
48
+ export declare function importFolderFolderFromJSON(jsonString: string): SafeParseResult<ImportFolderFolder, SDKValidationError>;
49
+ /** @internal */
50
+ export declare const ImportFolderReason$inboundSchema: z.ZodMiniType<ImportFolderReason, unknown>;
51
+ /** @internal */
52
+ export declare const ImportFolderUnavailable$inboundSchema: z.ZodMiniType<ImportFolderUnavailable, unknown>;
53
+ export declare function importFolderUnavailableFromJSON(jsonString: string): SafeParseResult<ImportFolderUnavailable, SDKValidationError>;
54
+ /** @internal */
55
+ export declare const ImportFolder$inboundSchema: z.ZodMiniType<ImportFolder, unknown>;
56
+ export declare function importFolderFromJSON(jsonString: string): SafeParseResult<ImportFolder, SDKValidationError>;
@@ -0,0 +1,75 @@
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 openEnums from "../types/enums.js";
8
+ import * as types from "../types/primitives.js";
9
+ export const ImportFolderReason = {
10
+ Uploading: "uploading",
11
+ Invalid: "invalid",
12
+ Deleted: "deleted",
13
+ Missing: "missing",
14
+ Unreadable: "unreadable",
15
+ TooLarge: "too_large",
16
+ };
17
+ /** @internal */
18
+ export const EntryFile$inboundSchema = z
19
+ .object({
20
+ kind: types.literal("file"),
21
+ path: types.string(),
22
+ sizeBytes: types.number(),
23
+ });
24
+ export function entryFileFromJSON(jsonString) {
25
+ return safeParse(jsonString, (x) => EntryFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntryFile' from JSON`);
26
+ }
27
+ /** @internal */
28
+ export const EntryFolder$inboundSchema = z
29
+ .object({
30
+ kind: types.literal("folder"),
31
+ path: types.string(),
32
+ });
33
+ export function entryFolderFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => EntryFolder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntryFolder' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const Entry$inboundSchema = discriminatedUnion("kind", {
38
+ folder: z.lazy(() => EntryFolder$inboundSchema),
39
+ file: z.lazy(() => EntryFile$inboundSchema),
40
+ });
41
+ export function entryFromJSON(jsonString) {
42
+ return safeParse(jsonString, (x) => Entry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entry' from JSON`);
43
+ }
44
+ /** @internal */
45
+ export const ImportFolderFolder$inboundSchema = z.object({
46
+ entries: z.array(discriminatedUnion("kind", {
47
+ folder: z.lazy(() => EntryFolder$inboundSchema),
48
+ file: z.lazy(() => EntryFile$inboundSchema),
49
+ })),
50
+ kind: types.literal("folder"),
51
+ name: types.nullable(types.string()),
52
+ nextCursor: types.nullable(types.string()),
53
+ path: types.string(),
54
+ });
55
+ export function importFolderFolderFromJSON(jsonString) {
56
+ return safeParse(jsonString, (x) => ImportFolderFolder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFolderFolder' from JSON`);
57
+ }
58
+ /** @internal */
59
+ export const ImportFolderReason$inboundSchema = openEnums.inboundSchema(ImportFolderReason);
60
+ /** @internal */
61
+ export const ImportFolderUnavailable$inboundSchema = z.object({
62
+ kind: types.literal("unavailable"),
63
+ reason: ImportFolderReason$inboundSchema,
64
+ });
65
+ export function importFolderUnavailableFromJSON(jsonString) {
66
+ return safeParse(jsonString, (x) => ImportFolderUnavailable$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFolderUnavailable' from JSON`);
67
+ }
68
+ /** @internal */
69
+ export const ImportFolder$inboundSchema = discriminatedUnion("kind", {
70
+ unavailable: z.lazy(() => ImportFolderUnavailable$inboundSchema),
71
+ folder: z.lazy(() => ImportFolderFolder$inboundSchema),
72
+ });
73
+ export function importFolderFromJSON(jsonString) {
74
+ return safeParse(jsonString, (x) => ImportFolder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFolder' from JSON`);
75
+ }
@@ -3,14 +3,14 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
5
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.
6
+ * An error refuses the import, and the check makes the import `invalid`. In `skipRecord` mode, an error in the values, the ID, or the references of a record leaves out only that record. A warning refuses nothing.
7
7
  */
8
8
  export declare const Severity: {
9
9
  readonly Error: "error";
10
10
  readonly Warning: "warning";
11
11
  };
12
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.
13
+ * An error refuses the import, and the check makes the import `invalid`. In `skipRecord` mode, an error in the values, the ID, or the references of a record leaves out only that record. A warning refuses nothing.
14
14
  */
15
15
  export type Severity = OpenEnum<typeof Severity>;
16
16
  export type ImportProblem = {
@@ -25,11 +25,11 @@ export type ImportProblem = {
25
25
  line: number | null;
26
26
  message: string;
27
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.
28
+ * The JSON pointer of the value, such as `/apps/salesforce/appId`. In a records file, it points into the record on `line`. Null when the problem names no value.
29
29
  */
30
30
  pointer: string | null;
31
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.
32
+ * An error refuses the import, and the check makes the import `invalid`. In `skipRecord` mode, an error in the values, the ID, or the references of a record leaves out only that record. A warning refuses nothing.
33
33
  */
34
34
  severity: Severity;
35
35
  };
@@ -6,7 +6,7 @@ import { safeParse } from "../lib/schemas.js";
6
6
  import * as openEnums from "../types/enums.js";
7
7
  import * as types from "../types/primitives.js";
8
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.
9
+ * An error refuses the import, and the check makes the import `invalid`. In `skipRecord` mode, an error in the values, the ID, or the references of a record leaves out only that record. A warning refuses nothing.
10
10
  */
11
11
  export const Severity = {
12
12
  Error: "error",
@@ -1,8 +1,8 @@
1
1
  export * from "./absent-reason.js";
2
- export * from "./absent-record-source.js";
3
2
  export * from "./absent-record.js";
4
3
  export * from "./actor.js";
5
4
  export * from "./app-entry.js";
5
+ export * from "./app-user.js";
6
6
  export * from "./app.js";
7
7
  export * from "./audit-event.js";
8
8
  export * from "./body-preview.js";
@@ -19,22 +19,39 @@ export * from "./environment-failure.js";
19
19
  export * from "./environment-status.js";
20
20
  export * from "./environment.js";
21
21
  export * from "./error.js";
22
+ export * from "./filled-field.js";
23
+ export * from "./import-actor.js";
24
+ export * from "./import-file.js";
25
+ export * from "./import-folder.js";
22
26
  export * from "./import-problem.js";
23
27
  export * from "./import-status.js";
24
28
  export * from "./import.js";
29
+ export * from "./known-difference.js";
25
30
  export * from "./launch-ui-session.js";
31
+ export * from "./made-id.js";
32
+ export * from "./matched-record.js";
26
33
  export * from "./mcp-server.js";
27
34
  export * from "./mcp-tool.js";
28
35
  export * from "./me.js";
36
+ export * from "./object-load.js";
29
37
  export * from "./permission.js";
30
38
  export * from "./principal.js";
39
+ export * from "./problem-counts.js";
40
+ export * from "./received-import.js";
41
+ export * from "./record-source.js";
31
42
  export * from "./request-detail.js";
32
43
  export * from "./request-stats.js";
33
44
  export * from "./request.js";
34
45
  export * from "./security.js";
35
46
  export * from "./service.js";
47
+ export * from "./snapshot-app-full-load-counts.js";
48
+ export * from "./snapshot-app-full-load.js";
49
+ export * from "./snapshot-app-limited-load-counts.js";
50
+ export * from "./snapshot-app-limited-load.js";
51
+ export * from "./snapshot-app-load-counts.js";
36
52
  export * from "./snapshot-app-load.js";
37
53
  export * from "./snapshot-failure-union.js";
54
+ export * from "./snapshot-list-item.js";
38
55
  export * from "./snapshot-status.js";
39
56
  export * from "./snapshot.js";
40
57
  export * from "./ui-session-launch.js";
@@ -2,10 +2,10 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  export * from "./absent-reason.js";
5
- export * from "./absent-record-source.js";
6
5
  export * from "./absent-record.js";
7
6
  export * from "./actor.js";
8
7
  export * from "./app-entry.js";
8
+ export * from "./app-user.js";
9
9
  export * from "./app.js";
10
10
  export * from "./audit-event.js";
11
11
  export * from "./body-preview.js";
@@ -22,22 +22,39 @@ export * from "./environment-failure.js";
22
22
  export * from "./environment-status.js";
23
23
  export * from "./environment.js";
24
24
  export * from "./error.js";
25
+ export * from "./filled-field.js";
26
+ export * from "./import-actor.js";
27
+ export * from "./import-file.js";
28
+ export * from "./import-folder.js";
25
29
  export * from "./import-problem.js";
26
30
  export * from "./import-status.js";
27
31
  export * from "./import.js";
32
+ export * from "./known-difference.js";
28
33
  export * from "./launch-ui-session.js";
34
+ export * from "./made-id.js";
35
+ export * from "./matched-record.js";
29
36
  export * from "./mcp-server.js";
30
37
  export * from "./mcp-tool.js";
31
38
  export * from "./me.js";
39
+ export * from "./object-load.js";
32
40
  export * from "./permission.js";
33
41
  export * from "./principal.js";
42
+ export * from "./problem-counts.js";
43
+ export * from "./received-import.js";
44
+ export * from "./record-source.js";
34
45
  export * from "./request-detail.js";
35
46
  export * from "./request-stats.js";
36
47
  export * from "./request.js";
37
48
  export * from "./security.js";
38
49
  export * from "./service.js";
50
+ export * from "./snapshot-app-full-load-counts.js";
51
+ export * from "./snapshot-app-full-load.js";
52
+ export * from "./snapshot-app-limited-load-counts.js";
53
+ export * from "./snapshot-app-limited-load.js";
54
+ export * from "./snapshot-app-load-counts.js";
39
55
  export * from "./snapshot-app-load.js";
40
56
  export * from "./snapshot-failure-union.js";
57
+ export * from "./snapshot-list-item.js";
41
58
  export * from "./snapshot-status.js";
42
59
  export * from "./snapshot.js";
43
60
  export * from "./ui-session-launch.js";