@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.
- package/README.md +17 -3
- package/agents/SKILL.md +46 -30
- package/agents/index.js +6 -6
- package/agents/llms.txt +15 -8
- package/agents/prompt.md +1 -1
- package/esm/extensions/client.d.ts +31 -1
- package/esm/extensions/client.js +74 -2
- package/esm/extensions/errors.d.ts +7 -0
- package/esm/extensions/errors.js +46 -2
- package/esm/extensions/index.d.ts +2 -2
- package/esm/funcs/imports-complete.d.ts +12 -0
- package/esm/funcs/imports-complete.js +93 -0
- package/esm/funcs/imports-create.d.ts +12 -0
- package/esm/funcs/imports-create.js +89 -0
- package/esm/funcs/imports-delete.d.ts +12 -0
- package/esm/funcs/imports-delete.js +93 -0
- package/esm/funcs/imports-get.d.ts +12 -0
- package/esm/funcs/imports-get.js +93 -0
- package/esm/funcs/imports-list.d.ts +11 -0
- package/esm/funcs/imports-list.js +93 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/absent-reason.d.ts +36 -0
- package/esm/models/absent-reason.js +44 -0
- package/esm/models/absent-record-source.d.ts +13 -0
- package/esm/models/absent-record-source.js +14 -0
- package/esm/models/absent-record.d.ts +23 -0
- package/esm/models/absent-record.js +18 -0
- package/esm/models/create-snapshot-from-environment.d.ts +13 -0
- package/esm/models/create-snapshot-from-environment.js +12 -0
- package/esm/models/create-snapshot-from-import.d.ts +16 -0
- package/esm/models/create-snapshot-from-import.js +12 -0
- package/esm/models/create-snapshot.d.ts +9 -0
- package/esm/models/create-snapshot.js +14 -0
- package/esm/models/created-import.d.ts +38 -0
- package/esm/models/created-import.js +30 -0
- package/esm/models/import-problem.d.ts +40 -0
- package/esm/models/import-problem.js +28 -0
- package/esm/models/import-status.d.ts +13 -0
- package/esm/models/import-status.js +14 -0
- package/esm/models/import.d.ts +45 -0
- package/esm/models/import.js +36 -0
- package/esm/models/index.d.ts +12 -0
- package/esm/models/index.js +12 -0
- package/esm/models/operations/complete-import.d.ts +11 -0
- package/esm/models/operations/complete-import.js +11 -0
- package/esm/models/operations/create-import.d.ts +36 -0
- package/esm/models/operations/create-import.js +26 -0
- package/esm/models/operations/create-snapshot.d.ts +3 -14
- package/esm/models/operations/create-snapshot.js +2 -9
- package/esm/models/operations/delete-import.d.ts +11 -0
- package/esm/models/operations/delete-import.js +11 -0
- package/esm/models/operations/get-import.d.ts +11 -0
- package/esm/models/operations/get-import.js +11 -0
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/list-imports.d.ts +30 -0
- package/esm/models/operations/list-imports.js +25 -0
- package/esm/models/snapshot-app-load.d.ts +20 -0
- package/esm/models/snapshot-app-load.js +15 -0
- package/esm/models/snapshot-failure-union.d.ts +40 -0
- package/esm/models/snapshot-failure-union.js +42 -0
- package/esm/models/snapshot.d.ts +15 -17
- package/esm/models/snapshot.js +6 -17
- package/esm/sdk/imports.d.ts +10 -0
- package/esm/sdk/imports.js +27 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +5 -0
- package/openapi.json +1258 -184
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
|
+
import { ImportProblem } from "./import-problem.js";
|
|
5
|
+
import { ImportStatus } from "./import-status.js";
|
|
6
|
+
import { Principal } from "./principal.js";
|
|
7
|
+
export type ImportApp = {
|
|
8
|
+
appId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
export type Import = {
|
|
12
|
+
/**
|
|
13
|
+
* Each app of the import's manifest, by its name and its app ID. Empty until the check reads the manifest, and when the check cannot read it.
|
|
14
|
+
*/
|
|
15
|
+
apps: Array<ImportApp>;
|
|
16
|
+
checkedAt: Date | null;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
createdBy: Principal;
|
|
19
|
+
deletedAt: Date | null;
|
|
20
|
+
/**
|
|
21
|
+
* `sha256:` and the lowercase hex SHA-256 of the zip file, as the create declared it.
|
|
22
|
+
*/
|
|
23
|
+
digest: string;
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* How many problems the check found. It is larger than the length of `problems` when they did not all fit.
|
|
27
|
+
*/
|
|
28
|
+
problemCount: number;
|
|
29
|
+
/**
|
|
30
|
+
* The first problems that the check found, errors before warnings. A delete clears them.
|
|
31
|
+
*/
|
|
32
|
+
problems: Array<ImportProblem>;
|
|
33
|
+
/**
|
|
34
|
+
* The size of the zip file in bytes, as the create declared it.
|
|
35
|
+
*/
|
|
36
|
+
sizeBytes: number;
|
|
37
|
+
status: ImportStatus;
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const ImportApp$inboundSchema: z.ZodMiniType<ImportApp, unknown>;
|
|
42
|
+
export declare function importAppFromJSON(jsonString: string): SafeParseResult<ImportApp, SDKValidationError>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare const Import$inboundSchema: z.ZodMiniType<Import, unknown>;
|
|
45
|
+
export declare function importFromJSON(jsonString: string): SafeParseResult<Import, SDKValidationError>;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { ImportProblem$inboundSchema, } from "./import-problem.js";
|
|
8
|
+
import { ImportStatus$inboundSchema } from "./import-status.js";
|
|
9
|
+
import { Principal$inboundSchema } from "./principal.js";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ImportApp$inboundSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
appId: types.string(),
|
|
14
|
+
name: types.string(),
|
|
15
|
+
});
|
|
16
|
+
export function importAppFromJSON(jsonString) {
|
|
17
|
+
return safeParse(jsonString, (x) => ImportApp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportApp' from JSON`);
|
|
18
|
+
}
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Import$inboundSchema = z.object({
|
|
21
|
+
apps: z.array(z.lazy(() => ImportApp$inboundSchema)),
|
|
22
|
+
checkedAt: types.nullable(types.date()),
|
|
23
|
+
createdAt: types.date(),
|
|
24
|
+
createdBy: Principal$inboundSchema,
|
|
25
|
+
deletedAt: types.nullable(types.date()),
|
|
26
|
+
digest: types.string(),
|
|
27
|
+
id: types.string(),
|
|
28
|
+
problemCount: types.number(),
|
|
29
|
+
problems: z.array(ImportProblem$inboundSchema),
|
|
30
|
+
sizeBytes: types.number(),
|
|
31
|
+
status: ImportStatus$inboundSchema,
|
|
32
|
+
workspaceId: types.string(),
|
|
33
|
+
});
|
|
34
|
+
export function importFromJSON(jsonString) {
|
|
35
|
+
return safeParse(jsonString, (x) => Import$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Import' from JSON`);
|
|
36
|
+
}
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "./absent-reason.js";
|
|
2
|
+
export * from "./absent-record-source.js";
|
|
3
|
+
export * from "./absent-record.js";
|
|
1
4
|
export * from "./actor.js";
|
|
2
5
|
export * from "./app-entry.js";
|
|
3
6
|
export * from "./app.js";
|
|
@@ -6,12 +9,19 @@ export * from "./body-preview.js";
|
|
|
6
9
|
export * from "./browser-capability.js";
|
|
7
10
|
export * from "./create-environment-app.js";
|
|
8
11
|
export * from "./create-environment.js";
|
|
12
|
+
export * from "./create-snapshot-from-environment.js";
|
|
13
|
+
export * from "./create-snapshot-from-import.js";
|
|
14
|
+
export * from "./create-snapshot.js";
|
|
15
|
+
export * from "./created-import.js";
|
|
9
16
|
export * from "./credential.js";
|
|
10
17
|
export * from "./credentials.js";
|
|
11
18
|
export * from "./environment-failure.js";
|
|
12
19
|
export * from "./environment-status.js";
|
|
13
20
|
export * from "./environment.js";
|
|
14
21
|
export * from "./error.js";
|
|
22
|
+
export * from "./import-problem.js";
|
|
23
|
+
export * from "./import-status.js";
|
|
24
|
+
export * from "./import.js";
|
|
15
25
|
export * from "./launch-ui-session.js";
|
|
16
26
|
export * from "./mcp-server.js";
|
|
17
27
|
export * from "./mcp-tool.js";
|
|
@@ -23,6 +33,8 @@ export * from "./request-stats.js";
|
|
|
23
33
|
export * from "./request.js";
|
|
24
34
|
export * from "./security.js";
|
|
25
35
|
export * from "./service.js";
|
|
36
|
+
export * from "./snapshot-app-load.js";
|
|
37
|
+
export * from "./snapshot-failure-union.js";
|
|
26
38
|
export * from "./snapshot-status.js";
|
|
27
39
|
export * from "./snapshot.js";
|
|
28
40
|
export * from "./ui-session-launch.js";
|
package/esm/models/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
export * from "./absent-reason.js";
|
|
5
|
+
export * from "./absent-record-source.js";
|
|
6
|
+
export * from "./absent-record.js";
|
|
4
7
|
export * from "./actor.js";
|
|
5
8
|
export * from "./app-entry.js";
|
|
6
9
|
export * from "./app.js";
|
|
@@ -9,12 +12,19 @@ export * from "./body-preview.js";
|
|
|
9
12
|
export * from "./browser-capability.js";
|
|
10
13
|
export * from "./create-environment-app.js";
|
|
11
14
|
export * from "./create-environment.js";
|
|
15
|
+
export * from "./create-snapshot-from-environment.js";
|
|
16
|
+
export * from "./create-snapshot-from-import.js";
|
|
17
|
+
export * from "./create-snapshot.js";
|
|
18
|
+
export * from "./created-import.js";
|
|
12
19
|
export * from "./credential.js";
|
|
13
20
|
export * from "./credentials.js";
|
|
14
21
|
export * from "./environment-failure.js";
|
|
15
22
|
export * from "./environment-status.js";
|
|
16
23
|
export * from "./environment.js";
|
|
17
24
|
export * from "./error.js";
|
|
25
|
+
export * from "./import-problem.js";
|
|
26
|
+
export * from "./import-status.js";
|
|
27
|
+
export * from "./import.js";
|
|
18
28
|
export * from "./launch-ui-session.js";
|
|
19
29
|
export * from "./mcp-server.js";
|
|
20
30
|
export * from "./mcp-tool.js";
|
|
@@ -26,6 +36,8 @@ export * from "./request-stats.js";
|
|
|
26
36
|
export * from "./request.js";
|
|
27
37
|
export * from "./security.js";
|
|
28
38
|
export * from "./service.js";
|
|
39
|
+
export * from "./snapshot-app-load.js";
|
|
40
|
+
export * from "./snapshot-failure-union.js";
|
|
29
41
|
export * from "./snapshot-status.js";
|
|
30
42
|
export * from "./snapshot.js";
|
|
31
43
|
export * from "./ui-session-launch.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type CompleteImportRequest = {
|
|
3
|
+
importId: string;
|
|
4
|
+
};
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type CompleteImportRequest$Outbound = {
|
|
7
|
+
importId: string;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const CompleteImportRequest$outboundSchema: z.ZodMiniType<CompleteImportRequest$Outbound, CompleteImportRequest>;
|
|
11
|
+
export declare function completeImportRequestToJSON(completeImportRequest: CompleteImportRequest): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const CompleteImportRequest$outboundSchema = z.object({
|
|
7
|
+
importId: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export function completeImportRequestToJSON(completeImportRequest) {
|
|
10
|
+
return JSON.stringify(CompleteImportRequest$outboundSchema.parse(completeImportRequest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type CreateImportRequestBody = {
|
|
3
|
+
/**
|
|
4
|
+
* `sha256:` and the lowercase hex SHA-256 of the zip file. The check refuses a zip file with another digest.
|
|
5
|
+
*/
|
|
6
|
+
digest: string;
|
|
7
|
+
/**
|
|
8
|
+
* The size of the zip file in bytes. The upload URL takes exactly this many bytes.
|
|
9
|
+
*/
|
|
10
|
+
sizeBytes: number;
|
|
11
|
+
/**
|
|
12
|
+
* The import's workspace. A member must send it. An API key's own workspace is the default.
|
|
13
|
+
*/
|
|
14
|
+
workspaceId?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type CreateImportRequest = {
|
|
17
|
+
idempotencyKey?: string | undefined;
|
|
18
|
+
body: CreateImportRequestBody;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type CreateImportRequestBody$Outbound = {
|
|
22
|
+
digest: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
workspaceId?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const CreateImportRequestBody$outboundSchema: z.ZodMiniType<CreateImportRequestBody$Outbound, CreateImportRequestBody>;
|
|
28
|
+
export declare function createImportRequestBodyToJSON(createImportRequestBody: CreateImportRequestBody): string;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type CreateImportRequest$Outbound = {
|
|
31
|
+
"idempotency-key"?: string | undefined;
|
|
32
|
+
body: CreateImportRequestBody$Outbound;
|
|
33
|
+
};
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare const CreateImportRequest$outboundSchema: z.ZodMiniType<CreateImportRequest$Outbound, CreateImportRequest>;
|
|
36
|
+
export declare function createImportRequestToJSON(createImportRequest: CreateImportRequest): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const CreateImportRequestBody$outboundSchema = z.object({
|
|
8
|
+
digest: z.string(),
|
|
9
|
+
sizeBytes: z.int(),
|
|
10
|
+
workspaceId: z.optional(z.string()),
|
|
11
|
+
});
|
|
12
|
+
export function createImportRequestBodyToJSON(createImportRequestBody) {
|
|
13
|
+
return JSON.stringify(CreateImportRequestBody$outboundSchema.parse(createImportRequestBody));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CreateImportRequest$outboundSchema = z.pipe(z.object({
|
|
17
|
+
idempotencyKey: z.optional(z.string()),
|
|
18
|
+
body: z.lazy(() => CreateImportRequestBody$outboundSchema),
|
|
19
|
+
}), z.transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
idempotencyKey: "idempotency-key",
|
|
22
|
+
});
|
|
23
|
+
}));
|
|
24
|
+
export function createImportRequestToJSON(createImportRequest) {
|
|
25
|
+
return JSON.stringify(CreateImportRequest$outboundSchema.parse(createImportRequest));
|
|
26
|
+
}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
|
-
|
|
3
|
-
environmentId: string;
|
|
4
|
-
name?: string | null | undefined;
|
|
5
|
-
};
|
|
2
|
+
import * as models from "../index.js";
|
|
6
3
|
export type CreateSnapshotRequest = {
|
|
7
4
|
idempotencyKey?: string | undefined;
|
|
8
|
-
body:
|
|
9
|
-
};
|
|
10
|
-
/** @internal */
|
|
11
|
-
export type CreateSnapshotRequestBody$Outbound = {
|
|
12
|
-
environmentId: string;
|
|
13
|
-
name?: string | null | undefined;
|
|
5
|
+
body: models.CreateSnapshot;
|
|
14
6
|
};
|
|
15
7
|
/** @internal */
|
|
16
|
-
export declare const CreateSnapshotRequestBody$outboundSchema: z.ZodMiniType<CreateSnapshotRequestBody$Outbound, CreateSnapshotRequestBody>;
|
|
17
|
-
export declare function createSnapshotRequestBodyToJSON(createSnapshotRequestBody: CreateSnapshotRequestBody): string;
|
|
18
|
-
/** @internal */
|
|
19
8
|
export type CreateSnapshotRequest$Outbound = {
|
|
20
9
|
"idempotency-key"?: string | undefined;
|
|
21
|
-
body:
|
|
10
|
+
body: models.CreateSnapshot$Outbound;
|
|
22
11
|
};
|
|
23
12
|
/** @internal */
|
|
24
13
|
export declare const CreateSnapshotRequest$outboundSchema: z.ZodMiniType<CreateSnapshotRequest$Outbound, CreateSnapshotRequest>;
|
|
@@ -3,18 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
5
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
-
|
|
7
|
-
export const CreateSnapshotRequestBody$outboundSchema = z.object({
|
|
8
|
-
environmentId: z.string(),
|
|
9
|
-
name: z.optional(z.nullable(z.string())),
|
|
10
|
-
});
|
|
11
|
-
export function createSnapshotRequestBodyToJSON(createSnapshotRequestBody) {
|
|
12
|
-
return JSON.stringify(CreateSnapshotRequestBody$outboundSchema.parse(createSnapshotRequestBody));
|
|
13
|
-
}
|
|
6
|
+
import * as models from "../index.js";
|
|
14
7
|
/** @internal */
|
|
15
8
|
export const CreateSnapshotRequest$outboundSchema = z.pipe(z.object({
|
|
16
9
|
idempotencyKey: z.optional(z.string()),
|
|
17
|
-
body:
|
|
10
|
+
body: models.CreateSnapshot$outboundSchema,
|
|
18
11
|
}), z.transform((v) => {
|
|
19
12
|
return remap$(v, {
|
|
20
13
|
idempotencyKey: "idempotency-key",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type DeleteImportRequest = {
|
|
3
|
+
importId: string;
|
|
4
|
+
};
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type DeleteImportRequest$Outbound = {
|
|
7
|
+
importId: string;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const DeleteImportRequest$outboundSchema: z.ZodMiniType<DeleteImportRequest$Outbound, DeleteImportRequest>;
|
|
11
|
+
export declare function deleteImportRequestToJSON(deleteImportRequest: DeleteImportRequest): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const DeleteImportRequest$outboundSchema = z.object({
|
|
7
|
+
importId: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export function deleteImportRequestToJSON(deleteImportRequest) {
|
|
10
|
+
return JSON.stringify(DeleteImportRequest$outboundSchema.parse(deleteImportRequest));
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type GetImportRequest = {
|
|
3
|
+
importId: string;
|
|
4
|
+
};
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type GetImportRequest$Outbound = {
|
|
7
|
+
importId: string;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const GetImportRequest$outboundSchema: z.ZodMiniType<GetImportRequest$Outbound, GetImportRequest>;
|
|
11
|
+
export declare function getImportRequestToJSON(getImportRequest: GetImportRequest): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const GetImportRequest$outboundSchema = z.object({
|
|
7
|
+
importId: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export function getImportRequestToJSON(getImportRequest) {
|
|
10
|
+
return JSON.stringify(GetImportRequest$outboundSchema.parse(getImportRequest));
|
|
11
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
export * from "./complete-import.js";
|
|
1
2
|
export * from "./create-credentials.js";
|
|
2
3
|
export * from "./create-environment.js";
|
|
4
|
+
export * from "./create-import.js";
|
|
3
5
|
export * from "./create-snapshot.js";
|
|
4
6
|
export * from "./delete-environment.js";
|
|
7
|
+
export * from "./delete-import.js";
|
|
5
8
|
export * from "./delete-snapshot.js";
|
|
6
9
|
export * from "./get-environment.js";
|
|
10
|
+
export * from "./get-import.js";
|
|
7
11
|
export * from "./get-request-body.js";
|
|
8
12
|
export * from "./get-request-stats.js";
|
|
9
13
|
export * from "./get-request.js";
|
|
@@ -14,6 +18,7 @@ export * from "./list-apps.js";
|
|
|
14
18
|
export * from "./list-audit-events.js";
|
|
15
19
|
export * from "./list-environment-creators.js";
|
|
16
20
|
export * from "./list-environments.js";
|
|
21
|
+
export * from "./list-imports.js";
|
|
17
22
|
export * from "./list-requests.js";
|
|
18
23
|
export * from "./list-snapshot-creators.js";
|
|
19
24
|
export * from "./list-snapshots.js";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
export * from "./complete-import.js";
|
|
4
5
|
export * from "./create-credentials.js";
|
|
5
6
|
export * from "./create-environment.js";
|
|
7
|
+
export * from "./create-import.js";
|
|
6
8
|
export * from "./create-snapshot.js";
|
|
7
9
|
export * from "./delete-environment.js";
|
|
10
|
+
export * from "./delete-import.js";
|
|
8
11
|
export * from "./delete-snapshot.js";
|
|
9
12
|
export * from "./get-environment.js";
|
|
13
|
+
export * from "./get-import.js";
|
|
10
14
|
export * from "./get-request-body.js";
|
|
11
15
|
export * from "./get-request-stats.js";
|
|
12
16
|
export * from "./get-request.js";
|
|
@@ -17,6 +21,7 @@ export * from "./list-apps.js";
|
|
|
17
21
|
export * from "./list-audit-events.js";
|
|
18
22
|
export * from "./list-environment-creators.js";
|
|
19
23
|
export * from "./list-environments.js";
|
|
24
|
+
export * from "./list-imports.js";
|
|
20
25
|
export * from "./list-requests.js";
|
|
21
26
|
export * from "./list-snapshot-creators.js";
|
|
22
27
|
export * from "./list-snapshots.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
4
|
+
import * as models from "../index.js";
|
|
5
|
+
export type ListImportsRequest = {
|
|
6
|
+
limit?: number | undefined;
|
|
7
|
+
cursor?: string | undefined;
|
|
8
|
+
workspaceId?: string | undefined;
|
|
9
|
+
status?: Array<models.ImportStatus> | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The workspace's imports, newest first
|
|
13
|
+
*/
|
|
14
|
+
export type ListImportsResponse = {
|
|
15
|
+
data: Array<models.Import>;
|
|
16
|
+
nextCursor: string | null;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export type ListImportsRequest$Outbound = {
|
|
20
|
+
limit: number;
|
|
21
|
+
cursor?: string | undefined;
|
|
22
|
+
workspaceId?: string | undefined;
|
|
23
|
+
status?: Array<string> | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ListImportsRequest$outboundSchema: z.ZodMiniType<ListImportsRequest$Outbound, ListImportsRequest>;
|
|
27
|
+
export declare function listImportsRequestToJSON(listImportsRequest: ListImportsRequest): string;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const ListImportsResponse$inboundSchema: z.ZodMiniType<ListImportsResponse, unknown>;
|
|
30
|
+
export declare function listImportsResponseFromJSON(jsonString: string): SafeParseResult<ListImportsResponse, SDKValidationError>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ListImportsRequest$outboundSchema = z.object({
|
|
10
|
+
limit: z._default(z.int(), 50),
|
|
11
|
+
cursor: z.optional(z.string()),
|
|
12
|
+
workspaceId: z.optional(z.string()),
|
|
13
|
+
status: z.optional(z.array(models.ImportStatus$outboundSchema)),
|
|
14
|
+
});
|
|
15
|
+
export function listImportsRequestToJSON(listImportsRequest) {
|
|
16
|
+
return JSON.stringify(ListImportsRequest$outboundSchema.parse(listImportsRequest));
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ListImportsResponse$inboundSchema = z.object({
|
|
20
|
+
data: z.array(models.Import$inboundSchema),
|
|
21
|
+
nextCursor: types.nullable(types.string()),
|
|
22
|
+
});
|
|
23
|
+
export function listImportsResponseFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => ListImportsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListImportsResponse' from JSON`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { AbsentRecord } from "./absent-record.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
|
+
/**
|
|
6
|
+
* What the load of the snapshot's import left out of the app. Null for a snapshot of an environment, and until the app's load ends.
|
|
7
|
+
*/
|
|
8
|
+
export type SnapshotAppLoad = {
|
|
9
|
+
/**
|
|
10
|
+
* The first records of the import that did not load, in the order of the import.
|
|
11
|
+
*/
|
|
12
|
+
absent: Array<AbsentRecord>;
|
|
13
|
+
/**
|
|
14
|
+
* How many records of the import did not load. It is larger than the length of `absent` when they did not all fit.
|
|
15
|
+
*/
|
|
16
|
+
absentCount: number;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const SnapshotAppLoad$inboundSchema: z.ZodMiniType<SnapshotAppLoad, unknown>;
|
|
20
|
+
export declare function snapshotAppLoadFromJSON(jsonString: string): SafeParseResult<SnapshotAppLoad, 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
|
+
import { AbsentRecord$inboundSchema } from "./absent-record.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const SnapshotAppLoad$inboundSchema = z.object({
|
|
10
|
+
absent: z.array(AbsentRecord$inboundSchema),
|
|
11
|
+
absentCount: types.number(),
|
|
12
|
+
});
|
|
13
|
+
export function snapshotAppLoadFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => SnapshotAppLoad$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotAppLoad' from JSON`);
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
import { ImportProblem } from "./import-problem.js";
|
|
7
|
+
export type SnapshotFailureInvalidImport = {
|
|
8
|
+
appName?: string | undefined;
|
|
9
|
+
code: "invalid_import";
|
|
10
|
+
message: string;
|
|
11
|
+
/**
|
|
12
|
+
* The first problems that the load of the refusing app found, errors before warnings. It can be empty, such as when the load passed its time limit.
|
|
13
|
+
*/
|
|
14
|
+
problems?: Array<ImportProblem> | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare const SnapshotFailureCodeEnum: {
|
|
17
|
+
readonly Interrupted: "interrupted";
|
|
18
|
+
readonly InternalError: "internal_error";
|
|
19
|
+
};
|
|
20
|
+
export type SnapshotFailureCodeEnum = OpenEnum<typeof SnapshotFailureCodeEnum>;
|
|
21
|
+
export type SnapshotFailure = {
|
|
22
|
+
code: SnapshotFailureCodeEnum;
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
export type SnapshotFailureUnion = (SnapshotFailure & {
|
|
26
|
+
code: "interrupted";
|
|
27
|
+
}) | (SnapshotFailure & {
|
|
28
|
+
code: "internal_error";
|
|
29
|
+
}) | SnapshotFailureInvalidImport | discriminatedUnionTypes.Unknown<"code">;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const SnapshotFailureInvalidImport$inboundSchema: z.ZodMiniType<SnapshotFailureInvalidImport, unknown>;
|
|
32
|
+
export declare function snapshotFailureInvalidImportFromJSON(jsonString: string): SafeParseResult<SnapshotFailureInvalidImport, SDKValidationError>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const SnapshotFailureCodeEnum$inboundSchema: z.ZodMiniType<SnapshotFailureCodeEnum, unknown>;
|
|
35
|
+
/** @internal */
|
|
36
|
+
export declare const SnapshotFailure$inboundSchema: z.ZodMiniType<SnapshotFailure, unknown>;
|
|
37
|
+
export declare function snapshotFailureFromJSON(jsonString: string): SafeParseResult<SnapshotFailure, SDKValidationError>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const SnapshotFailureUnion$inboundSchema: z.ZodMiniType<SnapshotFailureUnion, unknown>;
|
|
40
|
+
export declare function snapshotFailureUnionFromJSON(jsonString: string): SafeParseResult<SnapshotFailureUnion, SDKValidationError>;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
import { ImportProblem$inboundSchema, } from "./import-problem.js";
|
|
10
|
+
export const SnapshotFailureCodeEnum = {
|
|
11
|
+
Interrupted: "interrupted",
|
|
12
|
+
InternalError: "internal_error",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const SnapshotFailureInvalidImport$inboundSchema = z.object({
|
|
16
|
+
appName: types.optional(types.string()),
|
|
17
|
+
code: types.literal("invalid_import"),
|
|
18
|
+
message: types.string(),
|
|
19
|
+
problems: types.optional(z.array(ImportProblem$inboundSchema)),
|
|
20
|
+
});
|
|
21
|
+
export function snapshotFailureInvalidImportFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => SnapshotFailureInvalidImport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotFailureInvalidImport' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const SnapshotFailureCodeEnum$inboundSchema = openEnums.inboundSchema(SnapshotFailureCodeEnum);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const SnapshotFailure$inboundSchema = z.object({
|
|
28
|
+
code: SnapshotFailureCodeEnum$inboundSchema,
|
|
29
|
+
message: types.string(),
|
|
30
|
+
});
|
|
31
|
+
export function snapshotFailureFromJSON(jsonString) {
|
|
32
|
+
return safeParse(jsonString, (x) => SnapshotFailure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotFailure' from JSON`);
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const SnapshotFailureUnion$inboundSchema = discriminatedUnion("code", {
|
|
36
|
+
interrupted: z.intersection(z.lazy(() => SnapshotFailure$inboundSchema), z.object({ code: z.literal("interrupted") })),
|
|
37
|
+
internal_error: z.intersection(z.lazy(() => SnapshotFailure$inboundSchema), z.object({ code: z.literal("internal_error") })),
|
|
38
|
+
invalid_import: z.lazy(() => SnapshotFailureInvalidImport$inboundSchema),
|
|
39
|
+
});
|
|
40
|
+
export function snapshotFailureUnionFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => SnapshotFailureUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotFailureUnion' from JSON`);
|
|
42
|
+
}
|
package/esm/models/snapshot.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
4
|
import { Principal } from "./principal.js";
|
|
5
|
+
import { SnapshotAppLoad } from "./snapshot-app-load.js";
|
|
6
|
+
import { SnapshotFailureUnion } from "./snapshot-failure-union.js";
|
|
6
7
|
import { SnapshotStatus } from "./snapshot-status.js";
|
|
7
8
|
export type SnapshotApp = {
|
|
8
9
|
appId: string;
|
|
10
|
+
/**
|
|
11
|
+
* What the load of the snapshot's import left out of the app. Null for a snapshot of an environment, and until the app's load ends.
|
|
12
|
+
*/
|
|
13
|
+
load?: SnapshotAppLoad | null | undefined;
|
|
9
14
|
name: string;
|
|
10
15
|
services: {
|
|
11
16
|
[k: string]: any;
|
|
@@ -17,24 +22,22 @@ export type SnapshotApp = {
|
|
|
17
22
|
version: string;
|
|
18
23
|
versionId: string;
|
|
19
24
|
};
|
|
20
|
-
export declare const SnapshotCode: {
|
|
21
|
-
readonly Interrupted: "interrupted";
|
|
22
|
-
readonly InternalError: "internal_error";
|
|
23
|
-
};
|
|
24
|
-
export type SnapshotCode = OpenEnum<typeof SnapshotCode>;
|
|
25
|
-
export type Failure = {
|
|
26
|
-
code: SnapshotCode;
|
|
27
|
-
message: string;
|
|
28
|
-
};
|
|
29
25
|
export type Snapshot = {
|
|
30
26
|
apps: Array<SnapshotApp>;
|
|
31
27
|
createdAt: Date;
|
|
32
28
|
createdBy: Principal;
|
|
33
29
|
deletedAt: Date | null;
|
|
34
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The environment that the snapshot copies, or null for a snapshot built from an import.
|
|
32
|
+
*/
|
|
33
|
+
environmentId: string | null;
|
|
35
34
|
environmentName: string | null;
|
|
36
|
-
failure:
|
|
35
|
+
failure: SnapshotFailureUnion | null;
|
|
37
36
|
id: string;
|
|
37
|
+
/**
|
|
38
|
+
* The import that the snapshot was built from, or null for a snapshot of an environment.
|
|
39
|
+
*/
|
|
40
|
+
importId?: string | null | undefined;
|
|
38
41
|
name: string | null;
|
|
39
42
|
readyAt: Date | null;
|
|
40
43
|
sizeBytes: number | null;
|
|
@@ -45,10 +48,5 @@ export type Snapshot = {
|
|
|
45
48
|
export declare const SnapshotApp$inboundSchema: z.ZodMiniType<SnapshotApp, unknown>;
|
|
46
49
|
export declare function snapshotAppFromJSON(jsonString: string): SafeParseResult<SnapshotApp, SDKValidationError>;
|
|
47
50
|
/** @internal */
|
|
48
|
-
export declare const SnapshotCode$inboundSchema: z.ZodMiniType<SnapshotCode, unknown>;
|
|
49
|
-
/** @internal */
|
|
50
|
-
export declare const Failure$inboundSchema: z.ZodMiniType<Failure, unknown>;
|
|
51
|
-
export declare function failureFromJSON(jsonString: string): SafeParseResult<Failure, SDKValidationError>;
|
|
52
|
-
/** @internal */
|
|
53
51
|
export declare const Snapshot$inboundSchema: z.ZodMiniType<Snapshot, unknown>;
|
|
54
52
|
export declare function snapshotFromJSON(jsonString: string): SafeParseResult<Snapshot, SDKValidationError>;
|