@statelyai/sdk 0.3.1 → 0.4.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 +168 -0
- package/dist/cli.d.mts +63 -0
- package/dist/cli.mjs +140 -0
- package/dist/embed.d.mts +26 -2
- package/dist/embed.mjs +55 -2
- package/dist/{graph-BTUkUCsl.d.mts → graph-BfezxFKJ.d.mts} +1 -1
- package/dist/graph.d.mts +1 -1
- package/dist/graphToXStateTS-Cfp_fxSH.mjs +530 -0
- package/dist/index.d.mts +147 -6
- package/dist/index.mjs +3 -2
- package/dist/inspect.d.mts +7 -3
- package/dist/inspect.mjs +1 -1
- package/dist/{protocol-DTIQmjHH.d.mts → protocol-CZVFCSg3.d.mts} +57 -4
- package/dist/studio-D2uQhrvX.d.mts +54 -0
- package/dist/studio.d.mts +1 -53
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +1 -304
- package/dist/{transport-D352iKKa.mjs → transport-C1fRAuv-.mjs} +2 -1
- package/package.json +16 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { C as EventTypeData, S as DigraphNodeConfig, _ as studioMachineConverter, a as StatelyGraphData, b as DigraphConfig, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, o as StatelyGuard, r as StatelyEdgeData, t as StatelyAction, v as toStudioMachine, w as StateNodeJSONData, x as DigraphEdgeConfig, y as DigraphAction } from "./graph-BTUkUCsl.mjs";
|
|
4
|
-
import { CreateInspectorOptions, InspectOptions, Inspector, createStatelyInspector } from "./inspect.mjs";
|
|
5
|
-
import { ExtractMachinesResponse, ExtractedMachine, GetMachineOptions, ProjectData, ProjectMachine, StudioApiError, StudioClient, StudioClientOptions, VerifyApiKeyResponse, createStatelyClient } from "./studio.mjs";
|
|
1
|
+
import { C as EventTypeData, S as DigraphNodeConfig, _ as studioMachineConverter, a as StatelyGraphData, b as DigraphConfig, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, o as StatelyGuard, r as StatelyEdgeData, t as StatelyAction, v as toStudioMachine, w as StateNodeJSONData, x as DigraphEdgeConfig, y as DigraphAction } from "./graph-BfezxFKJ.mjs";
|
|
2
|
+
import { a as ProjectMachine, c as StudioClientOptions, i as ProjectData, l as VerifyApiKeyResponse, n as ExtractedMachine, o as StudioApiError, r as GetMachineOptions, s as StudioClient, t as ExtractMachinesResponse, u as createStatelyClient } from "./studio-D2uQhrvX.mjs";
|
|
6
3
|
import { PlanSyncOptions, PullSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
|
|
4
|
+
import { a as EmbedMode, c as ExportFormatMap, d as UploadResult, i as EmbedEventName, l as InitOptions, n as EmbedEventHandler, o as ExportCallOptions, r as EmbedEventMap, s as ExportFormat, t as CommentsConfig, u as ProtocolMessage } from "./protocol-CZVFCSg3.mjs";
|
|
5
|
+
import { AssetConfig, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
|
|
6
|
+
import { CreateInspectorOptions, InspectOptions, Inspector, createStatelyInspector } from "./inspect.mjs";
|
|
7
|
+
import { JSONSchema7 } from "json-schema";
|
|
8
|
+
import { UnknownMachineConfig } from "xstate";
|
|
7
9
|
|
|
8
10
|
//#region src/transport.d.ts
|
|
9
11
|
interface Transport {
|
|
@@ -35,4 +37,143 @@ interface WebSocketTransportOptions {
|
|
|
35
37
|
}
|
|
36
38
|
declare function createWebSocketTransport(options: WebSocketTransportOptions): Transport;
|
|
37
39
|
//#endregion
|
|
38
|
-
|
|
40
|
+
//#region src/codegenTypes.d.ts
|
|
41
|
+
interface CodeGenAction {
|
|
42
|
+
type: string;
|
|
43
|
+
params?: Record<string, unknown>;
|
|
44
|
+
code?: string;
|
|
45
|
+
}
|
|
46
|
+
interface CodeGenGuard {
|
|
47
|
+
type: string;
|
|
48
|
+
code?: string;
|
|
49
|
+
params?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
interface CodeGenInvoke {
|
|
52
|
+
src: string;
|
|
53
|
+
id: string;
|
|
54
|
+
input?: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface CodeGenNodeData {
|
|
57
|
+
key: string;
|
|
58
|
+
type?: 'normal' | 'parallel' | 'final' | 'history' | null;
|
|
59
|
+
initialId?: string | null;
|
|
60
|
+
history?: 'shallow' | 'deep' | boolean;
|
|
61
|
+
entry?: CodeGenAction[];
|
|
62
|
+
exit?: CodeGenAction[];
|
|
63
|
+
invokes?: CodeGenInvoke[];
|
|
64
|
+
tags?: Array<string | {
|
|
65
|
+
name: string;
|
|
66
|
+
}>;
|
|
67
|
+
description?: string | null;
|
|
68
|
+
meta?: Record<string, unknown> | null;
|
|
69
|
+
color?: string;
|
|
70
|
+
parentId?: string | null;
|
|
71
|
+
temp?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface CodeGenEdgeData {
|
|
74
|
+
eventType: string;
|
|
75
|
+
transitionType?: 'normal' | 'targetless' | 'reenter';
|
|
76
|
+
guard?: CodeGenGuard | null;
|
|
77
|
+
actions?: CodeGenAction[];
|
|
78
|
+
description?: string | null;
|
|
79
|
+
color?: string;
|
|
80
|
+
meta?: Record<string, unknown> | null;
|
|
81
|
+
temp?: boolean;
|
|
82
|
+
}
|
|
83
|
+
interface CodeGenImplementation {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string | null;
|
|
87
|
+
icon?: string;
|
|
88
|
+
paramsSchema?: JSONSchema7 | null;
|
|
89
|
+
code?: {
|
|
90
|
+
body: string;
|
|
91
|
+
lang?: string;
|
|
92
|
+
} | null;
|
|
93
|
+
}
|
|
94
|
+
interface CodeGenActorImplementation {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string | null;
|
|
98
|
+
icon?: string;
|
|
99
|
+
inputSchema?: JSONSchema7 | null;
|
|
100
|
+
outputSchema?: JSONSchema7 | null;
|
|
101
|
+
code?: {
|
|
102
|
+
body: string;
|
|
103
|
+
lang?: string;
|
|
104
|
+
} | null;
|
|
105
|
+
}
|
|
106
|
+
interface CodeGenGraphData {
|
|
107
|
+
schemas?: {
|
|
108
|
+
context?: Record<string, JSONSchema7> | null;
|
|
109
|
+
events?: Record<string, JSONSchema7> | null;
|
|
110
|
+
input?: JSONSchema7 | null;
|
|
111
|
+
output?: JSONSchema7 | null;
|
|
112
|
+
} | null;
|
|
113
|
+
implementations?: {
|
|
114
|
+
actions: CodeGenImplementation[];
|
|
115
|
+
guards: CodeGenImplementation[];
|
|
116
|
+
actors: CodeGenActorImplementation[];
|
|
117
|
+
delays: CodeGenImplementation[];
|
|
118
|
+
} | null;
|
|
119
|
+
}
|
|
120
|
+
interface CodeGenNode {
|
|
121
|
+
id: string;
|
|
122
|
+
parentId?: string | null;
|
|
123
|
+
data: CodeGenNodeData;
|
|
124
|
+
}
|
|
125
|
+
interface CodeGenEdge {
|
|
126
|
+
id: string;
|
|
127
|
+
sourceId: string;
|
|
128
|
+
targetId: string;
|
|
129
|
+
data: CodeGenEdgeData;
|
|
130
|
+
}
|
|
131
|
+
interface CodeGenGraph {
|
|
132
|
+
id: string;
|
|
133
|
+
nodes: CodeGenNode[];
|
|
134
|
+
edges: CodeGenEdge[];
|
|
135
|
+
data: CodeGenGraphData;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/graphToMachineConfig.d.ts
|
|
139
|
+
interface MachineConfigOptions {
|
|
140
|
+
showDescriptions?: boolean;
|
|
141
|
+
showMeta?: boolean;
|
|
142
|
+
}
|
|
143
|
+
declare function graphToMachineConfig(graph: CodeGenGraph, options?: MachineConfigOptions): UnknownMachineConfig;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/graphToXStateTS.d.ts
|
|
146
|
+
interface XStateTSOptions extends MachineConfigOptions {
|
|
147
|
+
exportStyle?: 'named' | 'default' | 'none';
|
|
148
|
+
}
|
|
149
|
+
declare function graphToXStateTS(graph: CodeGenGraph, options?: XStateTSOptions): string;
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/serializeJS.d.ts
|
|
152
|
+
/**
|
|
153
|
+
* Serializes JavaScript values as JS source code (not JSON).
|
|
154
|
+
* - Unquoted keys for valid identifiers
|
|
155
|
+
* - Single-quoted strings
|
|
156
|
+
* - Omits undefined values
|
|
157
|
+
* - Supports RawCode for verbatim expressions
|
|
158
|
+
*/
|
|
159
|
+
declare class RawCode {
|
|
160
|
+
code: string;
|
|
161
|
+
constructor(code: string);
|
|
162
|
+
}
|
|
163
|
+
declare function raw(code: string): RawCode;
|
|
164
|
+
declare function serializeJS(value: unknown, indent?: number, step?: number): string;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/jsonSchemaToTSType.d.ts
|
|
167
|
+
declare function jsonSchemaToTSType(schema: JSONSchema7 | undefined | null): string;
|
|
168
|
+
/**
|
|
169
|
+
* Build an inline context type string from the schemas.context record.
|
|
170
|
+
* Each key is a context property name, value is its JSONSchema7.
|
|
171
|
+
*/
|
|
172
|
+
declare function contextSchemaToTSType(context: Record<string, JSONSchema7> | null | undefined): string | null;
|
|
173
|
+
/**
|
|
174
|
+
* Build an event union type from the schemas.events record.
|
|
175
|
+
* Each key is the event type name, value describes the payload properties.
|
|
176
|
+
*/
|
|
177
|
+
declare function eventsSchemaToTSType(events: Record<string, JSONSchema7> | null | undefined): string | null;
|
|
178
|
+
//#endregion
|
|
179
|
+
export { type AssetConfig, type CodeGenGraph, type CommentsConfig, type CreateInspectorOptions, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedMode, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesResponse, type ExtractedMachine, type GetMachineOptions, type InitOptions, type InspectOptions, type Inspector, type MachineConfigOptions, type PlanSyncOptions, type ProjectData, type ProjectMachine, type PullSyncResult, RawCode, type ResolvedSyncInput, type StateNodeJSONData, type StatelyAction, type StatelyEdgeData, type StatelyEmbed, type StatelyEmbedOptions, type StatelyGraph, type StatelyGraphData, type StatelyGuard, type StatelyInvoke, type StatelyNodeData, type StudioAction, StudioApiError, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioNode, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type UploadResult, type VerifyApiKeyResponse, type XStateTSOptions, contextSchemaToTSType, createPostMessageTransport, createStatelyClient, createStatelyEmbed, createStatelyInspector, createWebSocketTransport, eventsSchemaToTSType, fromStudioMachine, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, serializeJS, studioMachineConverter, toStudioMachine };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { n as createWebSocketTransport, t as createPostMessageTransport } from "./transport-
|
|
1
|
+
import { n as createWebSocketTransport, t as createPostMessageTransport } from "./transport-C1fRAuv-.mjs";
|
|
2
2
|
import { createStatelyEmbed } from "./embed.mjs";
|
|
3
3
|
import { createStatelyInspector } from "./inspect.mjs";
|
|
4
4
|
import { StudioApiError, createStatelyClient } from "./studio.mjs";
|
|
5
5
|
import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
|
|
6
|
+
import { a as graphToMachineConfig, c as serializeJS, i as jsonSchemaToTSType, n as contextSchemaToTSType, o as RawCode, r as eventsSchemaToTSType, s as raw, t as graphToXStateTS } from "./graphToXStateTS-Cfp_fxSH.mjs";
|
|
6
7
|
|
|
7
|
-
export { StudioApiError, createPostMessageTransport, createStatelyClient, createStatelyEmbed, createStatelyInspector, createWebSocketTransport, fromStudioMachine, studioMachineConverter, toStudioMachine };
|
|
8
|
+
export { RawCode, StudioApiError, contextSchemaToTSType, createPostMessageTransport, createStatelyClient, createStatelyEmbed, createStatelyInspector, createWebSocketTransport, eventsSchemaToTSType, fromStudioMachine, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, serializeJS, studioMachineConverter, toStudioMachine };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as EmbedMode, c as ExportFormatMap, i as EmbedEventName, n as EmbedEventHandler, o as ExportCallOptions, r as EmbedEventMap, s as ExportFormat } from "./protocol-CZVFCSg3.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/inspect.d.ts
|
|
4
4
|
interface CreateInspectorOptions {
|
|
@@ -38,8 +38,12 @@ interface InspectOptions {
|
|
|
38
38
|
theme?: 'light' | 'dark';
|
|
39
39
|
readOnly?: boolean;
|
|
40
40
|
depth?: number;
|
|
41
|
-
panels?:
|
|
41
|
+
panels?: {
|
|
42
|
+
leftPanels?: string[];
|
|
43
|
+
rightPanels?: string[];
|
|
44
|
+
activePanels?: string[];
|
|
45
|
+
};
|
|
42
46
|
}
|
|
43
47
|
declare function createStatelyInspector(options?: CreateInspectorOptions): Inspector;
|
|
44
48
|
//#endregion
|
|
45
|
-
export { CreateInspectorOptions, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedMode, type ExportCallOptions, type ExportFormat, type ExportFormatMap,
|
|
49
|
+
export { CreateInspectorOptions, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedMode, type ExportCallOptions, type ExportFormat, type ExportFormatMap, InspectOptions, Inspector, createStatelyInspector };
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createRequestId, i as createPendingExportManager, n as createWebSocketTransport, o as toInitMessage, r as createEventRegistry } from "./transport-
|
|
1
|
+
import { a as createRequestId, i as createPendingExportManager, n as createWebSocketTransport, o as toInitMessage, r as createEventRegistry } from "./transport-C1fRAuv-.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/inspect.ts
|
|
4
4
|
function generateId() {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
//#region src/protocol.d.ts
|
|
2
2
|
type EmbedMode = 'editing' | 'viewing' | 'simulating' | 'inspecting';
|
|
3
|
+
interface CommentsConfig {
|
|
4
|
+
roomId: string;
|
|
5
|
+
userId?: string | null;
|
|
6
|
+
publicApiKey?: string;
|
|
7
|
+
authEndpoint?: string;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
}
|
|
3
10
|
interface ExportFormatMap {
|
|
4
11
|
xstate: {
|
|
5
12
|
options: {
|
|
@@ -72,6 +79,7 @@ interface InitOptions {
|
|
|
72
79
|
rightPanels?: string[];
|
|
73
80
|
activePanels?: string[];
|
|
74
81
|
};
|
|
82
|
+
comments?: CommentsConfig;
|
|
75
83
|
}
|
|
76
84
|
interface InitMessage {
|
|
77
85
|
type: '@statelyai.init';
|
|
@@ -84,6 +92,7 @@ interface InitMessage {
|
|
|
84
92
|
leftPanels?: string[];
|
|
85
93
|
rightPanels?: string[];
|
|
86
94
|
activePanels?: string[];
|
|
95
|
+
comments?: CommentsConfig;
|
|
87
96
|
}
|
|
88
97
|
interface UpdateMessage {
|
|
89
98
|
type: '@statelyai.update';
|
|
@@ -98,6 +107,10 @@ interface SetThemeMessage {
|
|
|
98
107
|
type: '@statelyai.setTheme';
|
|
99
108
|
theme: 'light' | 'dark';
|
|
100
109
|
}
|
|
110
|
+
interface SetSettingsMessage {
|
|
111
|
+
type: '@statelyai.setSettings';
|
|
112
|
+
settings: Record<string, unknown>;
|
|
113
|
+
}
|
|
101
114
|
interface RetrieveMessage {
|
|
102
115
|
type: '@statelyai.retrieve';
|
|
103
116
|
requestId: string;
|
|
@@ -114,8 +127,6 @@ interface InspectSnapshotMessage {
|
|
|
114
127
|
snapshot: unknown;
|
|
115
128
|
event: unknown | null;
|
|
116
129
|
}
|
|
117
|
-
/** All messages a client (embed/inspector) can send to the viz. */
|
|
118
|
-
type ClientMessage = InitMessage | UpdateMessage | SetModeMessage | SetThemeMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage;
|
|
119
130
|
interface ReadyMessage {
|
|
120
131
|
type: '@statelyai.ready';
|
|
121
132
|
version: string;
|
|
@@ -145,8 +156,50 @@ interface ErrorMessage {
|
|
|
145
156
|
message: string;
|
|
146
157
|
requestId?: string;
|
|
147
158
|
}
|
|
159
|
+
/** File metadata sent from viz to SDK when a file needs uploading. */
|
|
160
|
+
interface UploadFileInfo {
|
|
161
|
+
/** Original filename (e.g. "screenshot.png") */
|
|
162
|
+
name: string;
|
|
163
|
+
/** MIME type (e.g. "image/png") */
|
|
164
|
+
mimeType: string;
|
|
165
|
+
/** File size in bytes */
|
|
166
|
+
size: number;
|
|
167
|
+
/** File content as base64-encoded string */
|
|
168
|
+
data: string;
|
|
169
|
+
}
|
|
170
|
+
/** The result the consumer returns after uploading. */
|
|
171
|
+
interface UploadResult {
|
|
172
|
+
/** The publicly accessible URL of the uploaded file */
|
|
173
|
+
url: string;
|
|
174
|
+
/** Optional display name (defaults to original filename) */
|
|
175
|
+
name?: string;
|
|
176
|
+
/** Optional metadata stored on the asset */
|
|
177
|
+
metadata?: Record<string, unknown>;
|
|
178
|
+
}
|
|
179
|
+
/** Viz requests the parent to upload a file. */
|
|
180
|
+
interface UploadRequestMessage {
|
|
181
|
+
type: '@statelyai.uploadRequest';
|
|
182
|
+
requestId: string;
|
|
183
|
+
file: UploadFileInfo;
|
|
184
|
+
stateNodeId: string;
|
|
185
|
+
}
|
|
186
|
+
/** Parent tells the viz the upload capabilities on init. */
|
|
187
|
+
interface UploadCapabilitiesMessage {
|
|
188
|
+
type: '@statelyai.uploadCapabilities';
|
|
189
|
+
enabled: boolean;
|
|
190
|
+
accept?: string[];
|
|
191
|
+
maxFileSize?: number;
|
|
192
|
+
}
|
|
193
|
+
/** Parent sends the upload result back to the viz. */
|
|
194
|
+
interface UploadResponseMessage {
|
|
195
|
+
type: '@statelyai.uploadResponse';
|
|
196
|
+
requestId: string;
|
|
197
|
+
result: UploadResult;
|
|
198
|
+
}
|
|
199
|
+
/** All messages a client (embed/inspector) can send to the viz. */
|
|
200
|
+
type ClientMessage = InitMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | UploadCapabilitiesMessage | UploadResponseMessage | ErrorMessage;
|
|
148
201
|
/** All messages the viz can send back to a client. */
|
|
149
|
-
type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | RetrievedMessage | ErrorMessage;
|
|
202
|
+
type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | RetrievedMessage | ErrorMessage | UploadRequestMessage;
|
|
150
203
|
interface RegisterMessage {
|
|
151
204
|
type: '@statelyai.register';
|
|
152
205
|
role: 'client' | 'viz';
|
|
@@ -169,4 +222,4 @@ type SessionMessage = RegisterMessage | RegisteredMessage | RequestOpenMessage;
|
|
|
169
222
|
/** Any valid protocol message. */
|
|
170
223
|
type ProtocolMessage = ClientMessage | VizMessage | SessionMessage;
|
|
171
224
|
//#endregion
|
|
172
|
-
export {
|
|
225
|
+
export { EmbedMode as a, ExportFormatMap as c, UploadResult as d, EmbedEventName as i, InitOptions as l, EmbedEventHandler as n, ExportCallOptions as o, EmbedEventMap as r, ExportFormat as s, CommentsConfig as t, ProtocolMessage as u };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region src/studio.d.ts
|
|
2
|
+
interface StudioClientOptions {
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
}
|
|
7
|
+
interface VerifyApiKeyResponse {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface ProjectMachine {
|
|
11
|
+
machineId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
interface ProjectData {
|
|
15
|
+
projectId: string;
|
|
16
|
+
machines: ProjectMachine[];
|
|
17
|
+
}
|
|
18
|
+
interface ExtractedMachine {
|
|
19
|
+
id?: string;
|
|
20
|
+
config: Record<string, unknown>;
|
|
21
|
+
setupConfig?: Record<string, unknown>;
|
|
22
|
+
implementations?: Record<string, unknown>;
|
|
23
|
+
_type: 'setup.createMachine' | 'createMachine';
|
|
24
|
+
}
|
|
25
|
+
interface ExtractMachinesResponse {
|
|
26
|
+
machines: ExtractedMachine[];
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
interface GetMachineOptions {
|
|
30
|
+
version?: string;
|
|
31
|
+
}
|
|
32
|
+
declare class StudioApiError extends Error {
|
|
33
|
+
readonly status: number;
|
|
34
|
+
constructor(message: string, status: number);
|
|
35
|
+
}
|
|
36
|
+
interface StudioClient {
|
|
37
|
+
auth: {
|
|
38
|
+
verify(apiKey?: string): Promise<VerifyApiKeyResponse>;
|
|
39
|
+
};
|
|
40
|
+
projects: {
|
|
41
|
+
get(projectId: string): Promise<ProjectData>;
|
|
42
|
+
};
|
|
43
|
+
machines: {
|
|
44
|
+
get<TMachine = Record<string, unknown>>(machineId: string, options?: GetMachineOptions): Promise<TMachine>;
|
|
45
|
+
};
|
|
46
|
+
code: {
|
|
47
|
+
extractMachines(code: string, options?: {
|
|
48
|
+
apiKey?: string | null;
|
|
49
|
+
}): Promise<ExtractMachinesResponse>;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
declare function createStatelyClient(options?: StudioClientOptions): StudioClient;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ProjectMachine as a, StudioClientOptions as c, ProjectData as i, VerifyApiKeyResponse as l, ExtractedMachine as n, StudioApiError as o, GetMachineOptions as r, StudioClient as s, ExtractMachinesResponse as t, createStatelyClient as u };
|
package/dist/studio.d.mts
CHANGED
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface StudioClientOptions {
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
apiKey?: string;
|
|
5
|
-
fetch?: typeof fetch;
|
|
6
|
-
}
|
|
7
|
-
interface VerifyApiKeyResponse {
|
|
8
|
-
valid: boolean;
|
|
9
|
-
}
|
|
10
|
-
interface ProjectMachine {
|
|
11
|
-
machineId: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}
|
|
14
|
-
interface ProjectData {
|
|
15
|
-
projectId: string;
|
|
16
|
-
machines: ProjectMachine[];
|
|
17
|
-
}
|
|
18
|
-
interface ExtractedMachine {
|
|
19
|
-
id?: string;
|
|
20
|
-
config: Record<string, unknown>;
|
|
21
|
-
setupConfig?: Record<string, unknown>;
|
|
22
|
-
implementations?: Record<string, unknown>;
|
|
23
|
-
_type: 'setup.createMachine' | 'createMachine';
|
|
24
|
-
}
|
|
25
|
-
interface ExtractMachinesResponse {
|
|
26
|
-
machines: ExtractedMachine[];
|
|
27
|
-
error?: string;
|
|
28
|
-
}
|
|
29
|
-
interface GetMachineOptions {
|
|
30
|
-
version?: string;
|
|
31
|
-
}
|
|
32
|
-
declare class StudioApiError extends Error {
|
|
33
|
-
readonly status: number;
|
|
34
|
-
constructor(message: string, status: number);
|
|
35
|
-
}
|
|
36
|
-
interface StudioClient {
|
|
37
|
-
auth: {
|
|
38
|
-
verify(apiKey?: string): Promise<VerifyApiKeyResponse>;
|
|
39
|
-
};
|
|
40
|
-
projects: {
|
|
41
|
-
get(projectId: string): Promise<ProjectData>;
|
|
42
|
-
};
|
|
43
|
-
machines: {
|
|
44
|
-
get<TMachine = Record<string, unknown>>(machineId: string, options?: GetMachineOptions): Promise<TMachine>;
|
|
45
|
-
};
|
|
46
|
-
code: {
|
|
47
|
-
extractMachines(code: string, options?: {
|
|
48
|
-
apiKey?: string | null;
|
|
49
|
-
}): Promise<ExtractMachinesResponse>;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
declare function createStatelyClient(options?: StudioClientOptions): StudioClient;
|
|
53
|
-
//#endregion
|
|
1
|
+
import { a as ProjectMachine, c as StudioClientOptions, i as ProjectData, l as VerifyApiKeyResponse, n as ExtractedMachine, o as StudioApiError, r as GetMachineOptions, s as StudioClient, t as ExtractMachinesResponse, u as createStatelyClient } from "./studio-D2uQhrvX.mjs";
|
|
54
2
|
export { ExtractMachinesResponse, ExtractedMachine, GetMachineOptions, ProjectData, ProjectMachine, StudioApiError, StudioClient, StudioClientOptions, VerifyApiKeyResponse, createStatelyClient };
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as StatelyGraph } from "./graph-
|
|
2
|
-
import { StudioClient } from "./studio.mjs";
|
|
1
|
+
import { i as StatelyGraph } from "./graph-BfezxFKJ.mjs";
|
|
2
|
+
import { s as StudioClient } from "./studio-D2uQhrvX.mjs";
|
|
3
3
|
import { GraphDiff } from "@statelyai/graph";
|
|
4
4
|
|
|
5
5
|
//#region src/sync.d.ts
|