unfazed 0.0.1 → 0.1.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.
@@ -0,0 +1,41 @@
1
+ /**
2
+ * unfazed — official TypeScript SDK.
3
+ *
4
+ * The code-mode companion to the unfazed MCP server: write one script that
5
+ * deploys, waits, reads logs and filters them locally, instead of chaining a
6
+ * dozen tool calls through a model's context.
7
+ *
8
+ * ```ts
9
+ * import { Unfazed } from "unfazed";
10
+ *
11
+ * const unfazed = new Unfazed(); // reads UNFZ_API_TOKEN
12
+ * const ws = await unfazed.createWorkspace("hello");
13
+ * await unfazed.writeFiles(ws.id, {
14
+ * "server.ts": `export default { fetch: () => new Response("hi") }`,
15
+ * });
16
+ * const app = await unfazed.deployService({ workspaceId: ws.id, alias: "hello", wait: true });
17
+ * console.log(app.url);
18
+ * ```
19
+ *
20
+ * Two layers, both public:
21
+ * - {@link Unfazed} — the workflow layer (deploy + wait, batch writes, one-call rollback).
22
+ * - {@link UnfazedClient} — the typed GraphQL transport, for anything not wrapped.
23
+ */
24
+ export { Unfazed } from "./unfazed.js";
25
+ export type { Deployment, DeployBoxOptions, DeployOptions, DeployServiceOptions, DeployStaticOptions, EnvVar, FileContent, FilesMap, RollbackOptions, UnfazedOptions, WorkspaceFile, WriteFilesOptions, } from "./unfazed.js";
26
+ export { UnfazedClient, DEFAULT_BASE_URL, DEFAULT_ENDPOINT, ENDPOINT_ENV_VAR, GRAPHQL_PATH, TOKEN_ENV_VAR, VERSION, } from "./client.js";
27
+ export type { ClientOptions, FetchLike, GraphQLDocument, RequestOptions, ResultOf, VariablesOf, } from "./client.js";
28
+ export { UnfazedAuthError, UnfazedConfigError, UnfazedConflictError, UnfazedDeployError, UnfazedError, UnfazedGraphQLError, UnfazedHTTPError, UnfazedNotFoundError, UnfazedTimeoutError, } from "./errors.js";
29
+ export type { GraphQLResponseError } from "./errors.js";
30
+ export type { WaitOptions } from "./wait.js";
31
+ /**
32
+ * Every operation document the workflow layer uses, for callers that want the
33
+ * typed documents but not the wrapper methods.
34
+ */
35
+ export * as operations from "./operations.js";
36
+ /**
37
+ * Schema types generated from the platform's `graph/schema.graphqls`: enums
38
+ * (`DeploymentStatus`, `ServiceMode`, ...), input objects
39
+ * (`CreateDeploymentInput`, ...) and every operation's result type.
40
+ */
41
+ export type * from "./generated/graphql.js";
package/dist/index.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * unfazed — official TypeScript SDK.
3
+ *
4
+ * The code-mode companion to the unfazed MCP server: write one script that
5
+ * deploys, waits, reads logs and filters them locally, instead of chaining a
6
+ * dozen tool calls through a model's context.
7
+ *
8
+ * ```ts
9
+ * import { Unfazed } from "unfazed";
10
+ *
11
+ * const unfazed = new Unfazed(); // reads UNFZ_API_TOKEN
12
+ * const ws = await unfazed.createWorkspace("hello");
13
+ * await unfazed.writeFiles(ws.id, {
14
+ * "server.ts": `export default { fetch: () => new Response("hi") }`,
15
+ * });
16
+ * const app = await unfazed.deployService({ workspaceId: ws.id, alias: "hello", wait: true });
17
+ * console.log(app.url);
18
+ * ```
19
+ *
20
+ * Two layers, both public:
21
+ * - {@link Unfazed} — the workflow layer (deploy + wait, batch writes, one-call rollback).
22
+ * - {@link UnfazedClient} — the typed GraphQL transport, for anything not wrapped.
23
+ */
24
+ export { Unfazed } from "./unfazed.js";
25
+ export { UnfazedClient, DEFAULT_BASE_URL, DEFAULT_ENDPOINT, ENDPOINT_ENV_VAR, GRAPHQL_PATH, TOKEN_ENV_VAR, VERSION, } from "./client.js";
26
+ export { UnfazedAuthError, UnfazedConfigError, UnfazedConflictError, UnfazedDeployError, UnfazedError, UnfazedGraphQLError, UnfazedHTTPError, UnfazedNotFoundError, UnfazedTimeoutError, } from "./errors.js";
27
+ /**
28
+ * Every operation document the workflow layer uses, for callers that want the
29
+ * typed documents but not the wrapper methods.
30
+ */
31
+ export * as operations from "./operations.js";
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAgBvC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,OAAO,GACR,MAAM,aAAa,CAAC;AAUrB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAKrB;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC","sourcesContent":["/**\n * unfazed — official TypeScript SDK.\n *\n * The code-mode companion to the unfazed MCP server: write one script that\n * deploys, waits, reads logs and filters them locally, instead of chaining a\n * dozen tool calls through a model's context.\n *\n * ```ts\n * import { Unfazed } from \"unfazed\";\n *\n * const unfazed = new Unfazed(); // reads UNFZ_API_TOKEN\n * const ws = await unfazed.createWorkspace(\"hello\");\n * await unfazed.writeFiles(ws.id, {\n * \"server.ts\": `export default { fetch: () => new Response(\"hi\") }`,\n * });\n * const app = await unfazed.deployService({ workspaceId: ws.id, alias: \"hello\", wait: true });\n * console.log(app.url);\n * ```\n *\n * Two layers, both public:\n * - {@link Unfazed} — the workflow layer (deploy + wait, batch writes, one-call rollback).\n * - {@link UnfazedClient} — the typed GraphQL transport, for anything not wrapped.\n */\n\nexport { Unfazed } from \"./unfazed.js\";\nexport type {\n Deployment,\n DeployBoxOptions,\n DeployOptions,\n DeployServiceOptions,\n DeployStaticOptions,\n EnvVar,\n FileContent,\n FilesMap,\n RollbackOptions,\n UnfazedOptions,\n WorkspaceFile,\n WriteFilesOptions,\n} from \"./unfazed.js\";\n\nexport {\n UnfazedClient,\n DEFAULT_BASE_URL,\n DEFAULT_ENDPOINT,\n ENDPOINT_ENV_VAR,\n GRAPHQL_PATH,\n TOKEN_ENV_VAR,\n VERSION,\n} from \"./client.js\";\nexport type {\n ClientOptions,\n FetchLike,\n GraphQLDocument,\n RequestOptions,\n ResultOf,\n VariablesOf,\n} from \"./client.js\";\n\nexport {\n UnfazedAuthError,\n UnfazedConfigError,\n UnfazedConflictError,\n UnfazedDeployError,\n UnfazedError,\n UnfazedGraphQLError,\n UnfazedHTTPError,\n UnfazedNotFoundError,\n UnfazedTimeoutError,\n} from \"./errors.js\";\nexport type { GraphQLResponseError } from \"./errors.js\";\n\nexport type { WaitOptions } from \"./wait.js\";\n\n/**\n * Every operation document the workflow layer uses, for callers that want the\n * typed documents but not the wrapper methods.\n */\nexport * as operations from \"./operations.js\";\n\n/**\n * Schema types generated from the platform's `graph/schema.graphqls`: enums\n * (`DeploymentStatus`, `ServiceMode`, ...), input objects\n * (`CreateDeploymentInput`, ...) and every operation's result type.\n */\nexport type * from \"./generated/graphql.js\";\n"]}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Deployment fields the SDK returns everywhere.
3
+ *
4
+ * `id` + `aliasRevision` + `aliasHeld` are the rollback compare-and-swap
5
+ * triple; `previewUrl` is the immutable by-id URL you can verify BEFORE the
6
+ * alias moves; `error` carries the build failure text when status is FAILED.
7
+ */
8
+ export declare const DeploymentFieldsFragment: import("./index.js").TypedDocumentString<import("./index.js").DeploymentFieldsFragment, unknown>;
9
+ export declare const WhoamiDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWhoamiQuery, {
10
+ [x: string]: never;
11
+ }>;
12
+ export declare const CreateWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkCreateWorkspaceMutation, {
13
+ name: string;
14
+ }>;
15
+ export declare const ListWorkspacesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListWorkspacesQuery, {
16
+ [x: string]: never;
17
+ }>;
18
+ export declare const DeleteWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteWorkspaceMutation, {
19
+ workspaceID: string | number;
20
+ }>;
21
+ export declare const WriteTextFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteTextFileMutation, {
22
+ workspaceID: string | number;
23
+ path: string;
24
+ text: string;
25
+ }>;
26
+ export declare const WriteBase64FileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteBase64FileMutation, {
27
+ workspaceID: string | number;
28
+ path: string;
29
+ contentBase64: string;
30
+ }>;
31
+ export declare const ListFilesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListFilesQuery, {
32
+ input: import("./index.js").ListWorkspaceFilesInput;
33
+ }>;
34
+ export declare const ReadFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkReadFileQuery, {
35
+ input: import("./index.js").ReadWorkspaceFileInput;
36
+ }>;
37
+ export declare const DeleteFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteFileMutation, {
38
+ workspaceID: string | number;
39
+ path: string;
40
+ }>;
41
+ export declare const CreateDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkCreateDeploymentMutation, {
42
+ input: import("./index.js").CreateDeploymentInput;
43
+ }>;
44
+ export declare const DeployWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeployWorkspaceMutation, {
45
+ input: import("./index.js").DeployWorkspaceInput;
46
+ }>;
47
+ export declare const GetDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkGetDeploymentQuery, {
48
+ id: string | number;
49
+ }>;
50
+ /**
51
+ * The poll document, deliberately narrow.
52
+ *
53
+ * Waiting can run for minutes at a few seconds per tick; selecting the full
54
+ * fragment every time would cost the server (and an agent's rate limit) far
55
+ * more than the four fields the state machine actually reads.
56
+ */
57
+ export declare const PollDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkPollDeploymentQuery, {
58
+ id: string | number;
59
+ }>;
60
+ export declare const GetDeploymentByAliasDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkGetDeploymentByAliasQuery, {
61
+ alias: string;
62
+ }>;
63
+ export declare const ListDeploymentsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListDeploymentsQuery, {
64
+ input?: import("./index.js").ListDeploymentsInput | null | undefined;
65
+ }>;
66
+ export declare const ListReleasesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListReleasesQuery, {
67
+ alias: string;
68
+ }>;
69
+ export declare const RollbackDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRollbackMutation, {
70
+ deploymentID: string | number;
71
+ expectedCurrentDeploymentID: string | number;
72
+ expectedCurrentAliasRevision: string;
73
+ }>;
74
+ export declare const ServiceStatusDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkServiceStatusQuery, {
75
+ deploymentID: string | number;
76
+ }>;
77
+ export declare const ServiceLogsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkServiceLogsQuery, {
78
+ deploymentID: string | number;
79
+ tailBytes?: number | null | undefined | undefined;
80
+ }>;
81
+ export declare const DeploymentEventsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeploymentEventsQuery, {
82
+ deploymentID: string | number;
83
+ limit?: number | null | undefined | undefined;
84
+ }>;
85
+ export declare const RestartServiceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRestartServiceMutation, {
86
+ deploymentID: string | number;
87
+ }>;
88
+ export declare const StopServiceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkStopServiceMutation, {
89
+ deploymentID: string | number;
90
+ }>;
91
+ export declare const DeleteDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteDeploymentMutation, {
92
+ deploymentID: string | number;
93
+ }>;
94
+ export declare const SetWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetWorkspaceEnvMutation, {
95
+ workspaceID: string | number;
96
+ name: string;
97
+ value: string;
98
+ }>;
99
+ export declare const SetWorkspaceSecretDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetWorkspaceSecretMutation, {
100
+ workspaceID: string | number;
101
+ name: string;
102
+ value: string;
103
+ }>;
104
+ export declare const DeleteWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteWorkspaceEnvMutation, {
105
+ workspaceID: string | number;
106
+ name: string;
107
+ }>;
108
+ export declare const ListWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListWorkspaceEnvQuery, {
109
+ workspaceID: string | number;
110
+ }>;
111
+ export declare const SetAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetAppEnvMutation, {
112
+ workspaceID: string | number;
113
+ alias: string;
114
+ name: string;
115
+ value: string;
116
+ }>;
117
+ export declare const SetAppSecretDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetAppSecretMutation, {
118
+ workspaceID: string | number;
119
+ alias: string;
120
+ name: string;
121
+ value: string;
122
+ }>;
123
+ export declare const RemoveAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRemoveAppEnvMutation, {
124
+ workspaceID: string | number;
125
+ alias: string;
126
+ name: string;
127
+ }>;
128
+ export declare const InheritAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkInheritAppEnvMutation, {
129
+ workspaceID: string | number;
130
+ alias: string;
131
+ name: string;
132
+ }>;
133
+ export declare const ListAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListAppEnvQuery, {
134
+ workspaceID: string | number;
135
+ alias: string;
136
+ }>;
@@ -0,0 +1,461 @@
1
+ /**
2
+ * Every GraphQL document the workflow layer sends.
3
+ *
4
+ * These are wrapped in `graphql(...)` so graphql-codegen validates them
5
+ * against the vendored schema at codegen time and emits exact result/variable
6
+ * types. A field that stops existing server-side turns into a compile error
7
+ * here rather than a runtime surprise in an agent's script.
8
+ *
9
+ * The one document NOT defined here is the batched file write: it has a
10
+ * variable number of aliased root fields, so it is assembled at runtime in
11
+ * `unfazed.ts`. See the comment there.
12
+ */
13
+ import { graphql } from "./generated/gql.js";
14
+ /**
15
+ * Deployment fields the SDK returns everywhere.
16
+ *
17
+ * `id` + `aliasRevision` + `aliasHeld` are the rollback compare-and-swap
18
+ * triple; `previewUrl` is the immutable by-id URL you can verify BEFORE the
19
+ * alias moves; `error` carries the build failure text when status is FAILED.
20
+ */
21
+ export const DeploymentFieldsFragment = graphql(`
22
+ fragment DeploymentFields on Deployment {
23
+ id
24
+ workspaceID
25
+ kind
26
+ runtime
27
+ alias
28
+ serviceMode
29
+ healthPath
30
+ cronSchedule
31
+ cronPath
32
+ url
33
+ previewUrl
34
+ sshCommand
35
+ aliasHeld
36
+ aliasRevision
37
+ status
38
+ error
39
+ filesCount
40
+ sizeBytes
41
+ size
42
+ spaMode
43
+ gitRepo
44
+ gitCommit
45
+ createdAt
46
+ }
47
+ `);
48
+ export const WhoamiDocument = graphql(`
49
+ query SdkWhoami {
50
+ whoami {
51
+ kind
52
+ userID
53
+ name
54
+ agentID
55
+ agentName
56
+ claimed
57
+ claimedBy
58
+ scopes
59
+ expiresAt
60
+ usage {
61
+ month
62
+ requests
63
+ limit
64
+ }
65
+ resources {
66
+ workspaces
67
+ workspaceLimit
68
+ services
69
+ serviceLimit
70
+ }
71
+ }
72
+ }
73
+ `);
74
+ export const CreateWorkspaceDocument = graphql(`
75
+ mutation SdkCreateWorkspace($name: String!) {
76
+ createWorkspace(input: { name: $name }) {
77
+ workspace {
78
+ id
79
+ name
80
+ ownerId
81
+ projectId
82
+ createdAt
83
+ updatedAt
84
+ }
85
+ }
86
+ }
87
+ `);
88
+ export const ListWorkspacesDocument = graphql(`
89
+ query SdkListWorkspaces {
90
+ workspaces {
91
+ id
92
+ name
93
+ ownerId
94
+ projectId
95
+ createdAt
96
+ updatedAt
97
+ }
98
+ }
99
+ `);
100
+ export const DeleteWorkspaceDocument = graphql(`
101
+ mutation SdkDeleteWorkspace($workspaceID: ID!) {
102
+ deleteWorkspace(input: { workspaceID: $workspaceID }) {
103
+ ok
104
+ }
105
+ }
106
+ `);
107
+ export const WriteTextFileDocument = graphql(`
108
+ mutation SdkWriteTextFile($workspaceID: ID!, $path: String!, $text: String!) {
109
+ writeWorkspaceTextFile(input: { workspaceID: $workspaceID, path: $path, text: $text }) {
110
+ file {
111
+ path
112
+ sizeBytes
113
+ size
114
+ sha256
115
+ updatedAt
116
+ }
117
+ }
118
+ }
119
+ `);
120
+ export const WriteBase64FileDocument = graphql(`
121
+ mutation SdkWriteBase64File($workspaceID: ID!, $path: String!, $contentBase64: String!) {
122
+ writeWorkspaceBase64File(
123
+ input: { workspaceID: $workspaceID, path: $path, contentBase64: $contentBase64 }
124
+ ) {
125
+ file {
126
+ path
127
+ sizeBytes
128
+ size
129
+ sha256
130
+ updatedAt
131
+ }
132
+ }
133
+ }
134
+ `);
135
+ export const ListFilesDocument = graphql(`
136
+ query SdkListFiles($input: ListWorkspaceFilesInput!) {
137
+ workspaceFilesPage(input: $input) {
138
+ items {
139
+ path
140
+ sizeBytes
141
+ size
142
+ sha256
143
+ updatedAt
144
+ }
145
+ total
146
+ limit
147
+ offset
148
+ hasMore
149
+ nextOffset
150
+ }
151
+ }
152
+ `);
153
+ export const ReadFileDocument = graphql(`
154
+ query SdkReadFile($input: ReadWorkspaceFileInput!) {
155
+ readWorkspaceFile(input: $input) {
156
+ text
157
+ offset
158
+ limit
159
+ totalBytes
160
+ truncated
161
+ nextOffset
162
+ file {
163
+ path
164
+ sizeBytes
165
+ size
166
+ sha256
167
+ updatedAt
168
+ }
169
+ }
170
+ }
171
+ `);
172
+ export const DeleteFileDocument = graphql(`
173
+ mutation SdkDeleteFile($workspaceID: ID!, $path: String!) {
174
+ deleteWorkspaceFile(input: { workspaceID: $workspaceID, path: $path }) {
175
+ ok
176
+ }
177
+ }
178
+ `);
179
+ export const CreateDeploymentDocument = graphql(`
180
+ mutation SdkCreateDeployment($input: CreateDeploymentInput!) {
181
+ createDeployment(input: $input) {
182
+ deployment {
183
+ ...DeploymentFields
184
+ }
185
+ }
186
+ }
187
+ `);
188
+ export const DeployWorkspaceDocument = graphql(`
189
+ mutation SdkDeployWorkspace($input: DeployWorkspaceInput!) {
190
+ deployWorkspace(input: $input) {
191
+ deployment {
192
+ ...DeploymentFields
193
+ }
194
+ }
195
+ }
196
+ `);
197
+ export const GetDeploymentDocument = graphql(`
198
+ query SdkGetDeployment($id: ID!) {
199
+ deployment(id: $id) {
200
+ ...DeploymentFields
201
+ }
202
+ }
203
+ `);
204
+ /**
205
+ * The poll document, deliberately narrow.
206
+ *
207
+ * Waiting can run for minutes at a few seconds per tick; selecting the full
208
+ * fragment every time would cost the server (and an agent's rate limit) far
209
+ * more than the four fields the state machine actually reads.
210
+ */
211
+ export const PollDeploymentDocument = graphql(`
212
+ query SdkPollDeployment($id: ID!) {
213
+ deployment(id: $id) {
214
+ id
215
+ status
216
+ error
217
+ aliasHeld
218
+ url
219
+ previewUrl
220
+ }
221
+ }
222
+ `);
223
+ export const GetDeploymentByAliasDocument = graphql(`
224
+ query SdkGetDeploymentByAlias($alias: String!) {
225
+ deploymentByAlias(alias: $alias) {
226
+ ...DeploymentFields
227
+ }
228
+ }
229
+ `);
230
+ export const ListDeploymentsDocument = graphql(`
231
+ query SdkListDeployments($input: ListDeploymentsInput) {
232
+ deploymentsPage(input: $input) {
233
+ items {
234
+ ...DeploymentFields
235
+ }
236
+ total
237
+ limit
238
+ offset
239
+ hasMore
240
+ nextOffset
241
+ }
242
+ }
243
+ `);
244
+ export const ListReleasesDocument = graphql(`
245
+ query SdkListReleases($alias: String!) {
246
+ deploymentReleases(alias: $alias) {
247
+ ...DeploymentFields
248
+ }
249
+ }
250
+ `);
251
+ export const RollbackDocument = graphql(`
252
+ mutation SdkRollback(
253
+ $deploymentID: ID!
254
+ $expectedCurrentDeploymentID: ID!
255
+ $expectedCurrentAliasRevision: String!
256
+ ) {
257
+ rollbackDeployment(
258
+ input: {
259
+ deploymentID: $deploymentID
260
+ expectedCurrentDeploymentID: $expectedCurrentDeploymentID
261
+ expectedCurrentAliasRevision: $expectedCurrentAliasRevision
262
+ }
263
+ ) {
264
+ ...DeploymentFields
265
+ }
266
+ }
267
+ `);
268
+ export const ServiceStatusDocument = graphql(`
269
+ query SdkServiceStatus($deploymentID: ID!) {
270
+ serviceStatus(deploymentID: $deploymentID) {
271
+ deploymentID
272
+ alias
273
+ serviceMode
274
+ running
275
+ health
276
+ vmID
277
+ inFlight
278
+ alwaysOn
279
+ memSizeMiB
280
+ startedAt
281
+ lastUsedAt
282
+ lastStoppedAt
283
+ restartCount
284
+ lastError
285
+ }
286
+ }
287
+ `);
288
+ export const ServiceLogsDocument = graphql(`
289
+ query SdkServiceLogs($deploymentID: ID!, $tailBytes: Int) {
290
+ serviceLogs(deploymentID: $deploymentID, tailBytes: $tailBytes) {
291
+ deploymentID
292
+ stdout
293
+ stderr
294
+ truncated
295
+ stdoutBytes
296
+ stderrBytes
297
+ tailBytes
298
+ }
299
+ }
300
+ `);
301
+ export const DeploymentEventsDocument = graphql(`
302
+ query SdkDeploymentEvents($deploymentID: ID!, $limit: Int) {
303
+ deploymentEvents(deploymentID: $deploymentID, limit: $limit) {
304
+ id
305
+ deploymentID
306
+ type
307
+ rawType
308
+ severity
309
+ message
310
+ vmID
311
+ createdAt
312
+ }
313
+ }
314
+ `);
315
+ export const RestartServiceDocument = graphql(`
316
+ mutation SdkRestartService($deploymentID: ID!) {
317
+ restartService(input: { deploymentID: $deploymentID }) {
318
+ deploymentID
319
+ running
320
+ health
321
+ vmID
322
+ restartCount
323
+ lastError
324
+ }
325
+ }
326
+ `);
327
+ export const StopServiceDocument = graphql(`
328
+ mutation SdkStopService($deploymentID: ID!) {
329
+ stopService(input: { deploymentID: $deploymentID }) {
330
+ deploymentID
331
+ running
332
+ health
333
+ vmID
334
+ restartCount
335
+ lastError
336
+ }
337
+ }
338
+ `);
339
+ export const DeleteDeploymentDocument = graphql(`
340
+ mutation SdkDeleteDeployment($deploymentID: ID!) {
341
+ deleteDeployment(input: { deploymentID: $deploymentID }) {
342
+ ok
343
+ }
344
+ }
345
+ `);
346
+ /* -------------------------------------------------------------------------
347
+ * Env & secrets
348
+ *
349
+ * Workspace-scoped values are SERVICE defaults for every app in the source;
350
+ * app-scoped values override them for one alias. Both are snapshotted into a
351
+ * release at deploy time, so a change only reaches a running app after a
352
+ * redeploy — the workflow layer's doc comments repeat this where it matters.
353
+ * ---------------------------------------------------------------------- */
354
+ export const SetWorkspaceEnvDocument = graphql(`
355
+ mutation SdkSetWorkspaceEnv($workspaceID: ID!, $name: String!, $value: String!) {
356
+ setWorkspaceEnv(input: { workspaceID: $workspaceID, name: $name, value: $value }) {
357
+ env {
358
+ name
359
+ value
360
+ secret
361
+ alias
362
+ inherited
363
+ masked
364
+ updatedAt
365
+ }
366
+ }
367
+ }
368
+ `);
369
+ export const SetWorkspaceSecretDocument = graphql(`
370
+ mutation SdkSetWorkspaceSecret($workspaceID: ID!, $name: String!, $value: String!) {
371
+ setWorkspaceSecret(input: { workspaceID: $workspaceID, name: $name, value: $value }) {
372
+ env {
373
+ name
374
+ value
375
+ secret
376
+ alias
377
+ inherited
378
+ masked
379
+ updatedAt
380
+ }
381
+ }
382
+ }
383
+ `);
384
+ export const DeleteWorkspaceEnvDocument = graphql(`
385
+ mutation SdkDeleteWorkspaceEnv($workspaceID: ID!, $name: String!) {
386
+ deleteWorkspaceEnv(input: { workspaceID: $workspaceID, name: $name }) {
387
+ ok
388
+ }
389
+ }
390
+ `);
391
+ export const ListWorkspaceEnvDocument = graphql(`
392
+ query SdkListWorkspaceEnv($workspaceID: ID!) {
393
+ workspaceEnv(workspaceID: $workspaceID) {
394
+ name
395
+ value
396
+ secret
397
+ alias
398
+ inherited
399
+ masked
400
+ updatedAt
401
+ }
402
+ }
403
+ `);
404
+ export const SetAppEnvDocument = graphql(`
405
+ mutation SdkSetAppEnv($workspaceID: ID!, $alias: String!, $name: String!, $value: String!) {
406
+ setAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name, value: $value }) {
407
+ env {
408
+ name
409
+ value
410
+ secret
411
+ alias
412
+ inherited
413
+ masked
414
+ updatedAt
415
+ }
416
+ }
417
+ }
418
+ `);
419
+ export const SetAppSecretDocument = graphql(`
420
+ mutation SdkSetAppSecret($workspaceID: ID!, $alias: String!, $name: String!, $value: String!) {
421
+ setAppSecret(input: { workspaceID: $workspaceID, alias: $alias, name: $name, value: $value }) {
422
+ env {
423
+ name
424
+ value
425
+ secret
426
+ alias
427
+ inherited
428
+ masked
429
+ updatedAt
430
+ }
431
+ }
432
+ }
433
+ `);
434
+ export const RemoveAppEnvDocument = graphql(`
435
+ mutation SdkRemoveAppEnv($workspaceID: ID!, $alias: String!, $name: String!) {
436
+ removeAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name }) {
437
+ ok
438
+ }
439
+ }
440
+ `);
441
+ export const InheritAppEnvDocument = graphql(`
442
+ mutation SdkInheritAppEnv($workspaceID: ID!, $alias: String!, $name: String!) {
443
+ inheritAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name }) {
444
+ ok
445
+ }
446
+ }
447
+ `);
448
+ export const ListAppEnvDocument = graphql(`
449
+ query SdkListAppEnv($workspaceID: ID!, $alias: String!) {
450
+ appEnv(workspaceID: $workspaceID, alias: $alias) {
451
+ name
452
+ value
453
+ secret
454
+ alias
455
+ inherited
456
+ masked
457
+ updatedAt
458
+ }
459
+ }
460
+ `);
461
+ //# sourceMappingURL=operations.js.map