@usestatemachines/sdk 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -2
- package/agents/SKILL.md +46 -30
- package/agents/index.js +6 -6
- package/agents/llms.txt +11 -4
- package/agents/prompt.md +1 -1
- package/esm/extensions/ui.d.ts +59 -0
- package/esm/extensions/ui.js +153 -0
- package/esm/funcs/launch-ui-session.d.ts +15 -0
- package/esm/funcs/launch-ui-session.js +101 -0
- package/esm/funcs/list-snapshot-creators.d.ts +11 -0
- package/esm/funcs/list-snapshot-creators.js +90 -0
- package/esm/funcs/revoke-ui-session.d.ts +15 -0
- package/esm/funcs/revoke-ui-session.js +104 -0
- package/esm/funcs/snapshots-list.js +3 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/browser-capability.d.ts +12 -0
- package/esm/models/browser-capability.js +16 -0
- package/esm/models/environment.d.ts +8 -0
- package/esm/models/environment.js +9 -0
- package/esm/models/error.d.ts +1 -0
- package/esm/models/error.js +1 -0
- package/esm/models/index.d.ts +5 -0
- package/esm/models/index.js +5 -0
- package/esm/models/launch-ui-session.d.ts +26 -0
- package/esm/models/launch-ui-session.js +16 -0
- package/esm/models/operations/index.d.ts +3 -0
- package/esm/models/operations/index.js +3 -0
- package/esm/models/operations/launch-ui-session.d.ts +16 -0
- package/esm/models/operations/launch-ui-session.js +14 -0
- package/esm/models/operations/list-snapshot-creators.d.ts +23 -0
- package/esm/models/operations/list-snapshot-creators.js +20 -0
- package/esm/models/operations/list-snapshots.d.ts +6 -0
- package/esm/models/operations/list-snapshots.js +3 -0
- package/esm/models/operations/revoke-ui-session.d.ts +15 -0
- package/esm/models/operations/revoke-ui-session.js +13 -0
- package/esm/models/service.d.ts +2 -0
- package/esm/models/service.js +2 -0
- package/esm/models/ui-session-launch.d.ts +21 -0
- package/esm/models/ui-session-launch.js +25 -0
- package/esm/models/ui-session-mode.d.ts +11 -0
- package/esm/models/ui-session-mode.js +12 -0
- package/esm/models/ui-session-revocation.d.ts +12 -0
- package/esm/models/ui-session-revocation.js +16 -0
- package/esm/sdk/sdk.d.ts +10 -0
- package/esm/sdk/sdk.js +18 -0
- package/openapi.json +738 -78
- package/package.json +6 -2
package/esm/models/error.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const ErrorCode: {
|
|
|
15
15
|
readonly LastWorkspace: "last_workspace";
|
|
16
16
|
readonly WorkspaceArchived: "workspace_archived";
|
|
17
17
|
readonly VersionInUse: "version_in_use";
|
|
18
|
+
readonly UiDisabled: "ui_disabled";
|
|
18
19
|
readonly BodyTooLarge: "body_too_large";
|
|
19
20
|
readonly VersionUnavailable: "version_unavailable";
|
|
20
21
|
readonly EnvironmentLimitReached: "environment_limit_reached";
|
package/esm/models/error.js
CHANGED
|
@@ -18,6 +18,7 @@ export const ErrorCode = {
|
|
|
18
18
|
LastWorkspace: "last_workspace",
|
|
19
19
|
WorkspaceArchived: "workspace_archived",
|
|
20
20
|
VersionInUse: "version_in_use",
|
|
21
|
+
UiDisabled: "ui_disabled",
|
|
21
22
|
BodyTooLarge: "body_too_large",
|
|
22
23
|
VersionUnavailable: "version_unavailable",
|
|
23
24
|
EnvironmentLimitReached: "environment_limit_reached",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./app-entry.js";
|
|
|
3
3
|
export * from "./app.js";
|
|
4
4
|
export * from "./audit-event.js";
|
|
5
5
|
export * from "./body-preview.js";
|
|
6
|
+
export * from "./browser-capability.js";
|
|
6
7
|
export * from "./create-environment-app.js";
|
|
7
8
|
export * from "./create-environment.js";
|
|
8
9
|
export * from "./credential.js";
|
|
@@ -11,6 +12,7 @@ export * from "./environment-failure.js";
|
|
|
11
12
|
export * from "./environment-status.js";
|
|
12
13
|
export * from "./environment.js";
|
|
13
14
|
export * from "./error.js";
|
|
15
|
+
export * from "./launch-ui-session.js";
|
|
14
16
|
export * from "./mcp-server.js";
|
|
15
17
|
export * from "./mcp-tool.js";
|
|
16
18
|
export * from "./me.js";
|
|
@@ -23,5 +25,8 @@ export * from "./security.js";
|
|
|
23
25
|
export * from "./service.js";
|
|
24
26
|
export * from "./snapshot-status.js";
|
|
25
27
|
export * from "./snapshot.js";
|
|
28
|
+
export * from "./ui-session-launch.js";
|
|
29
|
+
export * from "./ui-session-mode.js";
|
|
30
|
+
export * from "./ui-session-revocation.js";
|
|
26
31
|
export * from "./version.js";
|
|
27
32
|
export * from "./workspace.js";
|
package/esm/models/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./app-entry.js";
|
|
|
6
6
|
export * from "./app.js";
|
|
7
7
|
export * from "./audit-event.js";
|
|
8
8
|
export * from "./body-preview.js";
|
|
9
|
+
export * from "./browser-capability.js";
|
|
9
10
|
export * from "./create-environment-app.js";
|
|
10
11
|
export * from "./create-environment.js";
|
|
11
12
|
export * from "./credential.js";
|
|
@@ -14,6 +15,7 @@ export * from "./environment-failure.js";
|
|
|
14
15
|
export * from "./environment-status.js";
|
|
15
16
|
export * from "./environment.js";
|
|
16
17
|
export * from "./error.js";
|
|
18
|
+
export * from "./launch-ui-session.js";
|
|
17
19
|
export * from "./mcp-server.js";
|
|
18
20
|
export * from "./mcp-tool.js";
|
|
19
21
|
export * from "./me.js";
|
|
@@ -26,5 +28,8 @@ export * from "./security.js";
|
|
|
26
28
|
export * from "./service.js";
|
|
27
29
|
export * from "./snapshot-status.js";
|
|
28
30
|
export * from "./snapshot.js";
|
|
31
|
+
export * from "./ui-session-launch.js";
|
|
32
|
+
export * from "./ui-session-mode.js";
|
|
33
|
+
export * from "./ui-session-revocation.js";
|
|
29
34
|
export * from "./version.js";
|
|
30
35
|
export * from "./workspace.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { UiSessionMode } from "./ui-session-mode.js";
|
|
3
|
+
export type LaunchUiSession = {
|
|
4
|
+
actorId: string;
|
|
5
|
+
/**
|
|
6
|
+
* The path the session opens first, with an optional query. It must match one of the service's document routes.
|
|
7
|
+
*/
|
|
8
|
+
entryPath: string;
|
|
9
|
+
/**
|
|
10
|
+
* The exact origin of the page that posts the grant. The exchange refuses any other Origin, and an embedded session allows only this origin to frame it.
|
|
11
|
+
*/
|
|
12
|
+
launcherOrigin: string;
|
|
13
|
+
mode: UiSessionMode;
|
|
14
|
+
serviceId: string;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type LaunchUiSession$Outbound = {
|
|
18
|
+
actorId: string;
|
|
19
|
+
entryPath: string;
|
|
20
|
+
launcherOrigin: string;
|
|
21
|
+
mode: string;
|
|
22
|
+
serviceId: string;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const LaunchUiSession$outboundSchema: z.ZodMiniType<LaunchUiSession$Outbound, LaunchUiSession>;
|
|
26
|
+
export declare function launchUiSessionToJSON(launchUiSession: LaunchUiSession): string;
|
|
@@ -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 { UiSessionMode$outboundSchema, } from "./ui-session-mode.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const LaunchUiSession$outboundSchema = z.object({
|
|
8
|
+
actorId: z.string(),
|
|
9
|
+
entryPath: z.string(),
|
|
10
|
+
launcherOrigin: z.string(),
|
|
11
|
+
mode: UiSessionMode$outboundSchema,
|
|
12
|
+
serviceId: z.string(),
|
|
13
|
+
});
|
|
14
|
+
export function launchUiSessionToJSON(launchUiSession) {
|
|
15
|
+
return JSON.stringify(LaunchUiSession$outboundSchema.parse(launchUiSession));
|
|
16
|
+
}
|
|
@@ -9,13 +9,16 @@ export * from "./get-request-stats.js";
|
|
|
9
9
|
export * from "./get-request.js";
|
|
10
10
|
export * from "./get-snapshot.js";
|
|
11
11
|
export * from "./get-workspace.js";
|
|
12
|
+
export * from "./launch-ui-session.js";
|
|
12
13
|
export * from "./list-apps.js";
|
|
13
14
|
export * from "./list-audit-events.js";
|
|
14
15
|
export * from "./list-environment-creators.js";
|
|
15
16
|
export * from "./list-environments.js";
|
|
16
17
|
export * from "./list-requests.js";
|
|
18
|
+
export * from "./list-snapshot-creators.js";
|
|
17
19
|
export * from "./list-snapshots.js";
|
|
18
20
|
export * from "./list-versions.js";
|
|
19
21
|
export * from "./list-workspaces.js";
|
|
22
|
+
export * from "./revoke-ui-session.js";
|
|
20
23
|
export * from "./update-environment.js";
|
|
21
24
|
export * from "./update-snapshot.js";
|
|
@@ -12,13 +12,16 @@ export * from "./get-request-stats.js";
|
|
|
12
12
|
export * from "./get-request.js";
|
|
13
13
|
export * from "./get-snapshot.js";
|
|
14
14
|
export * from "./get-workspace.js";
|
|
15
|
+
export * from "./launch-ui-session.js";
|
|
15
16
|
export * from "./list-apps.js";
|
|
16
17
|
export * from "./list-audit-events.js";
|
|
17
18
|
export * from "./list-environment-creators.js";
|
|
18
19
|
export * from "./list-environments.js";
|
|
19
20
|
export * from "./list-requests.js";
|
|
21
|
+
export * from "./list-snapshot-creators.js";
|
|
20
22
|
export * from "./list-snapshots.js";
|
|
21
23
|
export * from "./list-versions.js";
|
|
22
24
|
export * from "./list-workspaces.js";
|
|
25
|
+
export * from "./revoke-ui-session.js";
|
|
23
26
|
export * from "./update-environment.js";
|
|
24
27
|
export * from "./update-snapshot.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type LaunchUiSessionRequest = {
|
|
4
|
+
environmentId: string;
|
|
5
|
+
appName: string;
|
|
6
|
+
body: models.LaunchUiSession;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type LaunchUiSessionRequest$Outbound = {
|
|
10
|
+
environmentId: string;
|
|
11
|
+
appName: string;
|
|
12
|
+
body: models.LaunchUiSession$Outbound;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const LaunchUiSessionRequest$outboundSchema: z.ZodMiniType<LaunchUiSessionRequest$Outbound, LaunchUiSessionRequest>;
|
|
16
|
+
export declare function launchUiSessionRequestToJSON(launchUiSessionRequest: LaunchUiSessionRequest): string;
|
|
@@ -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 * as models from "../index.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const LaunchUiSessionRequest$outboundSchema = z.object({
|
|
8
|
+
environmentId: z.string(),
|
|
9
|
+
appName: z.string(),
|
|
10
|
+
body: models.LaunchUiSession$outboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function launchUiSessionRequestToJSON(launchUiSessionRequest) {
|
|
13
|
+
return JSON.stringify(LaunchUiSessionRequest$outboundSchema.parse(launchUiSessionRequest));
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
4
|
+
import * as models from "../index.js";
|
|
5
|
+
export type ListSnapshotCreatorsRequest = {
|
|
6
|
+
workspaceId?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Each principal that created a snapshot in the workspace, by name
|
|
10
|
+
*/
|
|
11
|
+
export type ListSnapshotCreatorsResponse = {
|
|
12
|
+
data: Array<models.Principal>;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type ListSnapshotCreatorsRequest$Outbound = {
|
|
16
|
+
workspaceId?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ListSnapshotCreatorsRequest$outboundSchema: z.ZodMiniType<ListSnapshotCreatorsRequest$Outbound, ListSnapshotCreatorsRequest>;
|
|
20
|
+
export declare function listSnapshotCreatorsRequestToJSON(listSnapshotCreatorsRequest: ListSnapshotCreatorsRequest): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const ListSnapshotCreatorsResponse$inboundSchema: z.ZodMiniType<ListSnapshotCreatorsResponse, unknown>;
|
|
23
|
+
export declare function listSnapshotCreatorsResponseFromJSON(jsonString: string): SafeParseResult<ListSnapshotCreatorsResponse, SDKValidationError>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ListSnapshotCreatorsRequest$outboundSchema = z.object({
|
|
9
|
+
workspaceId: z.optional(z.string()),
|
|
10
|
+
});
|
|
11
|
+
export function listSnapshotCreatorsRequestToJSON(listSnapshotCreatorsRequest) {
|
|
12
|
+
return JSON.stringify(ListSnapshotCreatorsRequest$outboundSchema.parse(listSnapshotCreatorsRequest));
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const ListSnapshotCreatorsResponse$inboundSchema = z.object({
|
|
16
|
+
data: z.array(models.Principal$inboundSchema),
|
|
17
|
+
});
|
|
18
|
+
export function listSnapshotCreatorsResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => ListSnapshotCreatorsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListSnapshotCreatorsResponse' from JSON`);
|
|
20
|
+
}
|
|
@@ -8,6 +8,9 @@ export type ListSnapshotsRequest = {
|
|
|
8
8
|
workspaceId?: string | undefined;
|
|
9
9
|
environmentId?: string | undefined;
|
|
10
10
|
status?: Array<models.SnapshotStatus> | undefined;
|
|
11
|
+
appId?: Array<string> | undefined;
|
|
12
|
+
createdBy?: Array<string> | undefined;
|
|
13
|
+
search?: string | undefined;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* The workspace's snapshots, newest first
|
|
@@ -23,6 +26,9 @@ export type ListSnapshotsRequest$Outbound = {
|
|
|
23
26
|
workspaceId?: string | undefined;
|
|
24
27
|
environmentId?: string | undefined;
|
|
25
28
|
status?: Array<string> | undefined;
|
|
29
|
+
appId?: Array<string> | undefined;
|
|
30
|
+
createdBy?: Array<string> | undefined;
|
|
31
|
+
search?: string | undefined;
|
|
26
32
|
};
|
|
27
33
|
/** @internal */
|
|
28
34
|
export declare const ListSnapshotsRequest$outboundSchema: z.ZodMiniType<ListSnapshotsRequest$Outbound, ListSnapshotsRequest>;
|
|
@@ -12,6 +12,9 @@ export const ListSnapshotsRequest$outboundSchema = z.object({
|
|
|
12
12
|
workspaceId: z.optional(z.string()),
|
|
13
13
|
environmentId: z.optional(z.string()),
|
|
14
14
|
status: z.optional(z.array(models.SnapshotStatus$outboundSchema)),
|
|
15
|
+
appId: z.optional(z.array(z.string())),
|
|
16
|
+
createdBy: z.optional(z.array(z.string())),
|
|
17
|
+
search: z.optional(z.string()),
|
|
15
18
|
});
|
|
16
19
|
export function listSnapshotsRequestToJSON(listSnapshotsRequest) {
|
|
17
20
|
return JSON.stringify(ListSnapshotsRequest$outboundSchema.parse(listSnapshotsRequest));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type RevokeUiSessionRequest = {
|
|
3
|
+
environmentId: string;
|
|
4
|
+
appName: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type RevokeUiSessionRequest$Outbound = {
|
|
9
|
+
environmentId: string;
|
|
10
|
+
appName: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const RevokeUiSessionRequest$outboundSchema: z.ZodMiniType<RevokeUiSessionRequest$Outbound, RevokeUiSessionRequest>;
|
|
15
|
+
export declare function revokeUiSessionRequestToJSON(revokeUiSessionRequest: RevokeUiSessionRequest): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 RevokeUiSessionRequest$outboundSchema = z.object({
|
|
7
|
+
environmentId: z.string(),
|
|
8
|
+
appName: z.string(),
|
|
9
|
+
sessionId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export function revokeUiSessionRequestToJSON(revokeUiSessionRequest) {
|
|
12
|
+
return JSON.stringify(RevokeUiSessionRequest$outboundSchema.parse(revokeUiSessionRequest));
|
|
13
|
+
}
|
package/esm/models/service.d.ts
CHANGED
|
@@ -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 { BrowserCapability } from "./browser-capability.js";
|
|
4
5
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
6
|
import { McpServer } from "./mcp-server.js";
|
|
6
7
|
export declare const Visibility: {
|
|
@@ -9,6 +10,7 @@ export declare const Visibility: {
|
|
|
9
10
|
};
|
|
10
11
|
export type Visibility = OpenEnum<typeof Visibility>;
|
|
11
12
|
export type Service = {
|
|
13
|
+
browser?: BrowserCapability | undefined;
|
|
12
14
|
description: string;
|
|
13
15
|
id: string;
|
|
14
16
|
limitations: Array<string>;
|
package/esm/models/service.js
CHANGED
|
@@ -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 { BrowserCapability$inboundSchema, } from "./browser-capability.js";
|
|
8
9
|
import { McpServer$inboundSchema } from "./mcp-server.js";
|
|
9
10
|
export const Visibility = {
|
|
10
11
|
Public: "public",
|
|
@@ -14,6 +15,7 @@ export const Visibility = {
|
|
|
14
15
|
export const Visibility$inboundSchema = openEnums.inboundSchema(Visibility);
|
|
15
16
|
/** @internal */
|
|
16
17
|
export const Service$inboundSchema = z.object({
|
|
18
|
+
browser: types.optional(BrowserCapability$inboundSchema),
|
|
17
19
|
description: types.string(),
|
|
18
20
|
id: types.string(),
|
|
19
21
|
limitations: z.array(types.string()),
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { UiSessionMode } from "./ui-session-mode.js";
|
|
5
|
+
export type UiSessionLaunch = {
|
|
6
|
+
actorId: string;
|
|
7
|
+
appName: string;
|
|
8
|
+
entryPath: string;
|
|
9
|
+
environmentId: string;
|
|
10
|
+
exchangeUrl: string;
|
|
11
|
+
expiresAt: Date;
|
|
12
|
+
grant: string;
|
|
13
|
+
grantExpiresAt: Date;
|
|
14
|
+
mode: UiSessionMode;
|
|
15
|
+
origin: string;
|
|
16
|
+
serviceId: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const UiSessionLaunch$inboundSchema: z.ZodMiniType<UiSessionLaunch, unknown>;
|
|
21
|
+
export declare function uiSessionLaunchFromJSON(jsonString: string): SafeParseResult<UiSessionLaunch, 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 { UiSessionMode$inboundSchema, } from "./ui-session-mode.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const UiSessionLaunch$inboundSchema = z.object({
|
|
10
|
+
actorId: types.string(),
|
|
11
|
+
appName: types.string(),
|
|
12
|
+
entryPath: types.string(),
|
|
13
|
+
environmentId: types.string(),
|
|
14
|
+
exchangeUrl: types.string(),
|
|
15
|
+
expiresAt: types.date(),
|
|
16
|
+
grant: types.string(),
|
|
17
|
+
grantExpiresAt: types.date(),
|
|
18
|
+
mode: UiSessionMode$inboundSchema,
|
|
19
|
+
origin: types.string(),
|
|
20
|
+
serviceId: types.string(),
|
|
21
|
+
sessionId: types.string(),
|
|
22
|
+
});
|
|
23
|
+
export function uiSessionLaunchFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => UiSessionLaunch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UiSessionLaunch' from JSON`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const UiSessionMode: {
|
|
4
|
+
readonly Embedded: "embedded";
|
|
5
|
+
readonly Page: "page";
|
|
6
|
+
};
|
|
7
|
+
export type UiSessionMode = OpenEnum<typeof UiSessionMode>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const UiSessionMode$inboundSchema: z.ZodMiniType<UiSessionMode, unknown>;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const UiSessionMode$outboundSchema: z.ZodMiniType<string, UiSessionMode>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
export const UiSessionMode = {
|
|
6
|
+
Embedded: "embedded",
|
|
7
|
+
Page: "page",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const UiSessionMode$inboundSchema = openEnums.inboundSchema(UiSessionMode);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const UiSessionMode$outboundSchema = openEnums.outboundSchema(UiSessionMode);
|
|
@@ -0,0 +1,12 @@
|
|
|
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 UiSessionRevocation = {
|
|
5
|
+
appName: string;
|
|
6
|
+
environmentId: string;
|
|
7
|
+
revokedAt: Date;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const UiSessionRevocation$inboundSchema: z.ZodMiniType<UiSessionRevocation, unknown>;
|
|
12
|
+
export declare function uiSessionRevocationFromJSON(jsonString: string): SafeParseResult<UiSessionRevocation, 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 UiSessionRevocation$inboundSchema = z.object({
|
|
9
|
+
appName: types.string(),
|
|
10
|
+
environmentId: types.string(),
|
|
11
|
+
revokedAt: types.date(),
|
|
12
|
+
sessionId: types.string(),
|
|
13
|
+
});
|
|
14
|
+
export function uiSessionRevocationFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => UiSessionRevocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UiSessionRevocation' from JSON`);
|
|
16
|
+
}
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
2
|
import * as models from "../models/index.js";
|
|
3
|
+
import * as operations from "../models/operations/index.js";
|
|
3
4
|
import { Apps } from "./apps.js";
|
|
4
5
|
import { AuditEvents } from "./audit-events.js";
|
|
5
6
|
import { Environments } from "./environments.js";
|
|
@@ -19,5 +20,14 @@ export declare class StateMachines extends ClientSDK {
|
|
|
19
20
|
get snapshots(): Snapshots;
|
|
20
21
|
private _workspaces?;
|
|
21
22
|
get workspaces(): Workspaces;
|
|
23
|
+
/**
|
|
24
|
+
* Launches a browser session of one actor in an app's UI. The answer holds a one-use grant and no reusable credential. Return it only to the browser of the user it is for, which posts the grant to `exchangeUrl` from `launcherOrigin`.
|
|
25
|
+
*/
|
|
26
|
+
launchUiSession(request: operations.LaunchUiSessionRequest, options?: RequestOptions): Promise<models.UiSessionLaunch>;
|
|
27
|
+
/**
|
|
28
|
+
* Revokes a browser session that the caller's own credential launched. Revoking again answers the same result. Another credential's session is not found.
|
|
29
|
+
*/
|
|
30
|
+
revokeUiSession(request: operations.RevokeUiSessionRequest, options?: RequestOptions): Promise<models.UiSessionRevocation>;
|
|
22
31
|
me(options?: RequestOptions): Promise<models.Me>;
|
|
32
|
+
listSnapshotCreators(request?: operations.ListSnapshotCreatorsRequest | undefined, options?: RequestOptions): Promise<operations.ListSnapshotCreatorsResponse>;
|
|
23
33
|
}
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
import { launchUiSession } from "../funcs/launch-ui-session.js";
|
|
5
|
+
import { listSnapshotCreators } from "../funcs/list-snapshot-creators.js";
|
|
4
6
|
import { me } from "../funcs/me.js";
|
|
7
|
+
import { revokeUiSession } from "../funcs/revoke-ui-session.js";
|
|
5
8
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
9
|
import { unwrapAsync } from "../types/fp.js";
|
|
7
10
|
import { Apps } from "./apps.js";
|
|
@@ -35,7 +38,22 @@ export class StateMachines extends ClientSDK {
|
|
|
35
38
|
get workspaces() {
|
|
36
39
|
return (this._workspaces ?? (this._workspaces = new Workspaces(this._options)));
|
|
37
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Launches a browser session of one actor in an app's UI. The answer holds a one-use grant and no reusable credential. Return it only to the browser of the user it is for, which posts the grant to `exchangeUrl` from `launcherOrigin`.
|
|
43
|
+
*/
|
|
44
|
+
async launchUiSession(request, options) {
|
|
45
|
+
return unwrapAsync(launchUiSession(this, request, options));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Revokes a browser session that the caller's own credential launched. Revoking again answers the same result. Another credential's session is not found.
|
|
49
|
+
*/
|
|
50
|
+
async revokeUiSession(request, options) {
|
|
51
|
+
return unwrapAsync(revokeUiSession(this, request, options));
|
|
52
|
+
}
|
|
38
53
|
async me(options) {
|
|
39
54
|
return unwrapAsync(me(this, options));
|
|
40
55
|
}
|
|
56
|
+
async listSnapshotCreators(request, options) {
|
|
57
|
+
return unwrapAsync(listSnapshotCreators(this, request, options));
|
|
58
|
+
}
|
|
41
59
|
}
|