unfazed 0.0.1 → 0.2.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/LICENSE +21 -0
- package/README.md +386 -1
- package/dist/client.d.ts +134 -0
- package/dist/client.js +266 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +116 -0
- package/dist/errors.js +177 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/gql.d.ts +132 -0
- package/dist/generated/gql.js +41 -0
- package/dist/generated/gql.js.map +1 -0
- package/dist/generated/graphql.d.ts +775 -0
- package/dist/generated/graphql.js +609 -0
- package/dist/generated/graphql.js.map +1 -0
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/operations.d.ts +146 -0
- package/dist/operations.js +470 -0
- package/dist/operations.js.map +1 -0
- package/dist/unfazed.d.ts +653 -0
- package/dist/unfazed.js +738 -0
- package/dist/unfazed.js.map +1 -0
- package/dist/wait.d.ts +57 -0
- package/dist/wait.js +59 -0
- package/dist/wait.js.map +1 -0
- package/package.json +50 -6
- package/schema/SOURCE.json +9 -0
- package/schema/schema.graphqls +1303 -0
- package/index.js +0 -2
package/dist/index.d.ts
ADDED
|
@@ -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 { DeleteDeploymentOptions, DeleteWorkspaceOptions, Deployment, DeployBoxOptions, DeployOptions, DeployServiceOptions, DeployStaticOptions, EnvVar, FileContent, FilesMap, RollbackOptions, UnfazedOptions, Workspace, 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 { DEPLOYMENT_NOT_FOUND, UnfazedAuthError, UnfazedConfigError, UnfazedConflictError, UnfazedDeployError, UnfazedError, UnfazedGraphQLError, UnfazedHTTPError, UnfazedNotFoundError, UnfazedTimeoutError, WORKSPACE_NOT_FOUND, isDuplicateWorkspaceName, isNotFoundSentinel, } 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 { DEPLOYMENT_NOT_FOUND, UnfazedAuthError, UnfazedConfigError, UnfazedConflictError, UnfazedDeployError, UnfazedError, UnfazedGraphQLError, UnfazedHTTPError, UnfazedNotFoundError, UnfazedTimeoutError, WORKSPACE_NOT_FOUND, isDuplicateWorkspaceName, isNotFoundSentinel, } 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;AAmBvC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,OAAO,GACR,MAAM,aAAa,CAAC;AAUrB,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,GACnB,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 DeleteDeploymentOptions,\n DeleteWorkspaceOptions,\n Deployment,\n DeployBoxOptions,\n DeployOptions,\n DeployServiceOptions,\n DeployStaticOptions,\n EnvVar,\n FileContent,\n FilesMap,\n RollbackOptions,\n UnfazedOptions,\n Workspace,\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 DEPLOYMENT_NOT_FOUND,\n UnfazedAuthError,\n UnfazedConfigError,\n UnfazedConflictError,\n UnfazedDeployError,\n UnfazedError,\n UnfazedGraphQLError,\n UnfazedHTTPError,\n UnfazedNotFoundError,\n UnfazedTimeoutError,\n WORKSPACE_NOT_FOUND,\n isDuplicateWorkspaceName,\n isNotFoundSentinel,\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,146 @@
|
|
|
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
|
+
/**
|
|
19
|
+
* Deleting a workspace, with the deployment cascade made explicit.
|
|
20
|
+
*
|
|
21
|
+
* `withDeployments` is not decoration: without it the server REFUSES while the
|
|
22
|
+
* workspace has any deployment history at all — including FAILED records —
|
|
23
|
+
* with `workspace %q still has deployments; delete them first`. A workspace
|
|
24
|
+
* that was ever deployed is therefore undeletable through the bare mutation,
|
|
25
|
+
* so the SDK always sends the flag and lets the caller choose the value.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DeleteWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteWorkspaceMutation, {
|
|
28
|
+
workspaceID: string | number;
|
|
29
|
+
withDeployments?: boolean | null | undefined | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const WriteTextFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteTextFileMutation, {
|
|
32
|
+
workspaceID: string | number;
|
|
33
|
+
path: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const WriteBase64FileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteBase64FileMutation, {
|
|
37
|
+
workspaceID: string | number;
|
|
38
|
+
path: string;
|
|
39
|
+
contentBase64: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const ListFilesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListFilesQuery, {
|
|
42
|
+
input: import("./index.js").ListWorkspaceFilesInput;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const ReadFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkReadFileQuery, {
|
|
45
|
+
input: import("./index.js").ReadWorkspaceFileInput;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const DeleteFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteFileMutation, {
|
|
48
|
+
workspaceID: string | number;
|
|
49
|
+
path: string;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const CreateDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkCreateDeploymentMutation, {
|
|
52
|
+
input: import("./index.js").CreateDeploymentInput;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const DeployWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeployWorkspaceMutation, {
|
|
55
|
+
input: import("./index.js").DeployWorkspaceInput;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const GetDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkGetDeploymentQuery, {
|
|
58
|
+
id: string | number;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* The poll document, deliberately narrow.
|
|
62
|
+
*
|
|
63
|
+
* Waiting can run for minutes at a few seconds per tick; selecting the full
|
|
64
|
+
* fragment every time would cost the server (and an agent's rate limit) far
|
|
65
|
+
* more than the four fields the state machine actually reads.
|
|
66
|
+
*/
|
|
67
|
+
export declare const PollDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkPollDeploymentQuery, {
|
|
68
|
+
id: string | number;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const GetDeploymentByAliasDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkGetDeploymentByAliasQuery, {
|
|
71
|
+
alias: string;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const ListDeploymentsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListDeploymentsQuery, {
|
|
74
|
+
input?: import("./index.js").ListDeploymentsInput | null | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const ListReleasesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListReleasesQuery, {
|
|
77
|
+
alias: string;
|
|
78
|
+
}>;
|
|
79
|
+
export declare const RollbackDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRollbackMutation, {
|
|
80
|
+
deploymentID: string | number;
|
|
81
|
+
expectedCurrentDeploymentID: string | number;
|
|
82
|
+
expectedCurrentAliasRevision: string;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const ServiceStatusDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkServiceStatusQuery, {
|
|
85
|
+
deploymentID: string | number;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const ServiceLogsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkServiceLogsQuery, {
|
|
88
|
+
deploymentID: string | number;
|
|
89
|
+
tailBytes?: number | null | undefined | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
export declare const DeploymentEventsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeploymentEventsQuery, {
|
|
92
|
+
deploymentID: string | number;
|
|
93
|
+
limit?: number | null | undefined | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const RestartServiceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRestartServiceMutation, {
|
|
96
|
+
deploymentID: string | number;
|
|
97
|
+
}>;
|
|
98
|
+
export declare const StopServiceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkStopServiceMutation, {
|
|
99
|
+
deploymentID: string | number;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const DeleteDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteDeploymentMutation, {
|
|
102
|
+
deploymentID: string | number;
|
|
103
|
+
}>;
|
|
104
|
+
export declare const SetWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetWorkspaceEnvMutation, {
|
|
105
|
+
workspaceID: string | number;
|
|
106
|
+
name: string;
|
|
107
|
+
value: string;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const SetWorkspaceSecretDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetWorkspaceSecretMutation, {
|
|
110
|
+
workspaceID: string | number;
|
|
111
|
+
name: string;
|
|
112
|
+
value: string;
|
|
113
|
+
}>;
|
|
114
|
+
export declare const DeleteWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteWorkspaceEnvMutation, {
|
|
115
|
+
workspaceID: string | number;
|
|
116
|
+
name: string;
|
|
117
|
+
}>;
|
|
118
|
+
export declare const ListWorkspaceEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListWorkspaceEnvQuery, {
|
|
119
|
+
workspaceID: string | number;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const SetAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetAppEnvMutation, {
|
|
122
|
+
workspaceID: string | number;
|
|
123
|
+
alias: string;
|
|
124
|
+
name: string;
|
|
125
|
+
value: string;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const SetAppSecretDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkSetAppSecretMutation, {
|
|
128
|
+
workspaceID: string | number;
|
|
129
|
+
alias: string;
|
|
130
|
+
name: string;
|
|
131
|
+
value: string;
|
|
132
|
+
}>;
|
|
133
|
+
export declare const RemoveAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRemoveAppEnvMutation, {
|
|
134
|
+
workspaceID: string | number;
|
|
135
|
+
alias: string;
|
|
136
|
+
name: string;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const InheritAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkInheritAppEnvMutation, {
|
|
139
|
+
workspaceID: string | number;
|
|
140
|
+
alias: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}>;
|
|
143
|
+
export declare const ListAppEnvDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListAppEnvQuery, {
|
|
144
|
+
workspaceID: string | number;
|
|
145
|
+
alias: string;
|
|
146
|
+
}>;
|
|
@@ -0,0 +1,470 @@
|
|
|
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
|
+
/**
|
|
101
|
+
* Deleting a workspace, with the deployment cascade made explicit.
|
|
102
|
+
*
|
|
103
|
+
* `withDeployments` is not decoration: without it the server REFUSES while the
|
|
104
|
+
* workspace has any deployment history at all — including FAILED records —
|
|
105
|
+
* with `workspace %q still has deployments; delete them first`. A workspace
|
|
106
|
+
* that was ever deployed is therefore undeletable through the bare mutation,
|
|
107
|
+
* so the SDK always sends the flag and lets the caller choose the value.
|
|
108
|
+
*/
|
|
109
|
+
export const DeleteWorkspaceDocument = graphql(`
|
|
110
|
+
mutation SdkDeleteWorkspace($workspaceID: ID!, $withDeployments: Boolean) {
|
|
111
|
+
deleteWorkspace(input: { workspaceID: $workspaceID, withDeployments: $withDeployments }) {
|
|
112
|
+
ok
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`);
|
|
116
|
+
export const WriteTextFileDocument = graphql(`
|
|
117
|
+
mutation SdkWriteTextFile($workspaceID: ID!, $path: String!, $text: String!) {
|
|
118
|
+
writeWorkspaceTextFile(input: { workspaceID: $workspaceID, path: $path, text: $text }) {
|
|
119
|
+
file {
|
|
120
|
+
path
|
|
121
|
+
sizeBytes
|
|
122
|
+
size
|
|
123
|
+
sha256
|
|
124
|
+
updatedAt
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`);
|
|
129
|
+
export const WriteBase64FileDocument = graphql(`
|
|
130
|
+
mutation SdkWriteBase64File($workspaceID: ID!, $path: String!, $contentBase64: String!) {
|
|
131
|
+
writeWorkspaceBase64File(
|
|
132
|
+
input: { workspaceID: $workspaceID, path: $path, contentBase64: $contentBase64 }
|
|
133
|
+
) {
|
|
134
|
+
file {
|
|
135
|
+
path
|
|
136
|
+
sizeBytes
|
|
137
|
+
size
|
|
138
|
+
sha256
|
|
139
|
+
updatedAt
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`);
|
|
144
|
+
export const ListFilesDocument = graphql(`
|
|
145
|
+
query SdkListFiles($input: ListWorkspaceFilesInput!) {
|
|
146
|
+
workspaceFilesPage(input: $input) {
|
|
147
|
+
items {
|
|
148
|
+
path
|
|
149
|
+
sizeBytes
|
|
150
|
+
size
|
|
151
|
+
sha256
|
|
152
|
+
updatedAt
|
|
153
|
+
}
|
|
154
|
+
total
|
|
155
|
+
limit
|
|
156
|
+
offset
|
|
157
|
+
hasMore
|
|
158
|
+
nextOffset
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`);
|
|
162
|
+
export const ReadFileDocument = graphql(`
|
|
163
|
+
query SdkReadFile($input: ReadWorkspaceFileInput!) {
|
|
164
|
+
readWorkspaceFile(input: $input) {
|
|
165
|
+
text
|
|
166
|
+
offset
|
|
167
|
+
limit
|
|
168
|
+
totalBytes
|
|
169
|
+
truncated
|
|
170
|
+
nextOffset
|
|
171
|
+
file {
|
|
172
|
+
path
|
|
173
|
+
sizeBytes
|
|
174
|
+
size
|
|
175
|
+
sha256
|
|
176
|
+
updatedAt
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
`);
|
|
181
|
+
export const DeleteFileDocument = graphql(`
|
|
182
|
+
mutation SdkDeleteFile($workspaceID: ID!, $path: String!) {
|
|
183
|
+
deleteWorkspaceFile(input: { workspaceID: $workspaceID, path: $path }) {
|
|
184
|
+
ok
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
`);
|
|
188
|
+
export const CreateDeploymentDocument = graphql(`
|
|
189
|
+
mutation SdkCreateDeployment($input: CreateDeploymentInput!) {
|
|
190
|
+
createDeployment(input: $input) {
|
|
191
|
+
deployment {
|
|
192
|
+
...DeploymentFields
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
`);
|
|
197
|
+
export const DeployWorkspaceDocument = graphql(`
|
|
198
|
+
mutation SdkDeployWorkspace($input: DeployWorkspaceInput!) {
|
|
199
|
+
deployWorkspace(input: $input) {
|
|
200
|
+
deployment {
|
|
201
|
+
...DeploymentFields
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`);
|
|
206
|
+
export const GetDeploymentDocument = graphql(`
|
|
207
|
+
query SdkGetDeployment($id: ID!) {
|
|
208
|
+
deployment(id: $id) {
|
|
209
|
+
...DeploymentFields
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`);
|
|
213
|
+
/**
|
|
214
|
+
* The poll document, deliberately narrow.
|
|
215
|
+
*
|
|
216
|
+
* Waiting can run for minutes at a few seconds per tick; selecting the full
|
|
217
|
+
* fragment every time would cost the server (and an agent's rate limit) far
|
|
218
|
+
* more than the four fields the state machine actually reads.
|
|
219
|
+
*/
|
|
220
|
+
export const PollDeploymentDocument = graphql(`
|
|
221
|
+
query SdkPollDeployment($id: ID!) {
|
|
222
|
+
deployment(id: $id) {
|
|
223
|
+
id
|
|
224
|
+
status
|
|
225
|
+
error
|
|
226
|
+
aliasHeld
|
|
227
|
+
url
|
|
228
|
+
previewUrl
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`);
|
|
232
|
+
export const GetDeploymentByAliasDocument = graphql(`
|
|
233
|
+
query SdkGetDeploymentByAlias($alias: String!) {
|
|
234
|
+
deploymentByAlias(alias: $alias) {
|
|
235
|
+
...DeploymentFields
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`);
|
|
239
|
+
export const ListDeploymentsDocument = graphql(`
|
|
240
|
+
query SdkListDeployments($input: ListDeploymentsInput) {
|
|
241
|
+
deploymentsPage(input: $input) {
|
|
242
|
+
items {
|
|
243
|
+
...DeploymentFields
|
|
244
|
+
}
|
|
245
|
+
total
|
|
246
|
+
limit
|
|
247
|
+
offset
|
|
248
|
+
hasMore
|
|
249
|
+
nextOffset
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
`);
|
|
253
|
+
export const ListReleasesDocument = graphql(`
|
|
254
|
+
query SdkListReleases($alias: String!) {
|
|
255
|
+
deploymentReleases(alias: $alias) {
|
|
256
|
+
...DeploymentFields
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
`);
|
|
260
|
+
export const RollbackDocument = graphql(`
|
|
261
|
+
mutation SdkRollback(
|
|
262
|
+
$deploymentID: ID!
|
|
263
|
+
$expectedCurrentDeploymentID: ID!
|
|
264
|
+
$expectedCurrentAliasRevision: String!
|
|
265
|
+
) {
|
|
266
|
+
rollbackDeployment(
|
|
267
|
+
input: {
|
|
268
|
+
deploymentID: $deploymentID
|
|
269
|
+
expectedCurrentDeploymentID: $expectedCurrentDeploymentID
|
|
270
|
+
expectedCurrentAliasRevision: $expectedCurrentAliasRevision
|
|
271
|
+
}
|
|
272
|
+
) {
|
|
273
|
+
...DeploymentFields
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
`);
|
|
277
|
+
export const ServiceStatusDocument = graphql(`
|
|
278
|
+
query SdkServiceStatus($deploymentID: ID!) {
|
|
279
|
+
serviceStatus(deploymentID: $deploymentID) {
|
|
280
|
+
deploymentID
|
|
281
|
+
alias
|
|
282
|
+
serviceMode
|
|
283
|
+
running
|
|
284
|
+
health
|
|
285
|
+
vmID
|
|
286
|
+
inFlight
|
|
287
|
+
alwaysOn
|
|
288
|
+
memSizeMiB
|
|
289
|
+
startedAt
|
|
290
|
+
lastUsedAt
|
|
291
|
+
lastStoppedAt
|
|
292
|
+
restartCount
|
|
293
|
+
lastError
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
`);
|
|
297
|
+
export const ServiceLogsDocument = graphql(`
|
|
298
|
+
query SdkServiceLogs($deploymentID: ID!, $tailBytes: Int) {
|
|
299
|
+
serviceLogs(deploymentID: $deploymentID, tailBytes: $tailBytes) {
|
|
300
|
+
deploymentID
|
|
301
|
+
stdout
|
|
302
|
+
stderr
|
|
303
|
+
truncated
|
|
304
|
+
stdoutBytes
|
|
305
|
+
stderrBytes
|
|
306
|
+
tailBytes
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
`);
|
|
310
|
+
export const DeploymentEventsDocument = graphql(`
|
|
311
|
+
query SdkDeploymentEvents($deploymentID: ID!, $limit: Int) {
|
|
312
|
+
deploymentEvents(deploymentID: $deploymentID, limit: $limit) {
|
|
313
|
+
id
|
|
314
|
+
deploymentID
|
|
315
|
+
type
|
|
316
|
+
rawType
|
|
317
|
+
severity
|
|
318
|
+
message
|
|
319
|
+
vmID
|
|
320
|
+
createdAt
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
`);
|
|
324
|
+
export const RestartServiceDocument = graphql(`
|
|
325
|
+
mutation SdkRestartService($deploymentID: ID!) {
|
|
326
|
+
restartService(input: { deploymentID: $deploymentID }) {
|
|
327
|
+
deploymentID
|
|
328
|
+
running
|
|
329
|
+
health
|
|
330
|
+
vmID
|
|
331
|
+
restartCount
|
|
332
|
+
lastError
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`);
|
|
336
|
+
export const StopServiceDocument = graphql(`
|
|
337
|
+
mutation SdkStopService($deploymentID: ID!) {
|
|
338
|
+
stopService(input: { deploymentID: $deploymentID }) {
|
|
339
|
+
deploymentID
|
|
340
|
+
running
|
|
341
|
+
health
|
|
342
|
+
vmID
|
|
343
|
+
restartCount
|
|
344
|
+
lastError
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
`);
|
|
348
|
+
export const DeleteDeploymentDocument = graphql(`
|
|
349
|
+
mutation SdkDeleteDeployment($deploymentID: ID!) {
|
|
350
|
+
deleteDeployment(input: { deploymentID: $deploymentID }) {
|
|
351
|
+
ok
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
`);
|
|
355
|
+
/* -------------------------------------------------------------------------
|
|
356
|
+
* Env & secrets
|
|
357
|
+
*
|
|
358
|
+
* Workspace-scoped values are SERVICE defaults for every app in the source;
|
|
359
|
+
* app-scoped values override them for one alias. Both are snapshotted into a
|
|
360
|
+
* release at deploy time, so a change only reaches a running app after a
|
|
361
|
+
* redeploy — the workflow layer's doc comments repeat this where it matters.
|
|
362
|
+
* ---------------------------------------------------------------------- */
|
|
363
|
+
export const SetWorkspaceEnvDocument = graphql(`
|
|
364
|
+
mutation SdkSetWorkspaceEnv($workspaceID: ID!, $name: String!, $value: String!) {
|
|
365
|
+
setWorkspaceEnv(input: { workspaceID: $workspaceID, name: $name, value: $value }) {
|
|
366
|
+
env {
|
|
367
|
+
name
|
|
368
|
+
value
|
|
369
|
+
secret
|
|
370
|
+
alias
|
|
371
|
+
inherited
|
|
372
|
+
masked
|
|
373
|
+
updatedAt
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
`);
|
|
378
|
+
export const SetWorkspaceSecretDocument = graphql(`
|
|
379
|
+
mutation SdkSetWorkspaceSecret($workspaceID: ID!, $name: String!, $value: String!) {
|
|
380
|
+
setWorkspaceSecret(input: { workspaceID: $workspaceID, name: $name, value: $value }) {
|
|
381
|
+
env {
|
|
382
|
+
name
|
|
383
|
+
value
|
|
384
|
+
secret
|
|
385
|
+
alias
|
|
386
|
+
inherited
|
|
387
|
+
masked
|
|
388
|
+
updatedAt
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
`);
|
|
393
|
+
export const DeleteWorkspaceEnvDocument = graphql(`
|
|
394
|
+
mutation SdkDeleteWorkspaceEnv($workspaceID: ID!, $name: String!) {
|
|
395
|
+
deleteWorkspaceEnv(input: { workspaceID: $workspaceID, name: $name }) {
|
|
396
|
+
ok
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
`);
|
|
400
|
+
export const ListWorkspaceEnvDocument = graphql(`
|
|
401
|
+
query SdkListWorkspaceEnv($workspaceID: ID!) {
|
|
402
|
+
workspaceEnv(workspaceID: $workspaceID) {
|
|
403
|
+
name
|
|
404
|
+
value
|
|
405
|
+
secret
|
|
406
|
+
alias
|
|
407
|
+
inherited
|
|
408
|
+
masked
|
|
409
|
+
updatedAt
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
`);
|
|
413
|
+
export const SetAppEnvDocument = graphql(`
|
|
414
|
+
mutation SdkSetAppEnv($workspaceID: ID!, $alias: String!, $name: String!, $value: String!) {
|
|
415
|
+
setAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name, value: $value }) {
|
|
416
|
+
env {
|
|
417
|
+
name
|
|
418
|
+
value
|
|
419
|
+
secret
|
|
420
|
+
alias
|
|
421
|
+
inherited
|
|
422
|
+
masked
|
|
423
|
+
updatedAt
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
`);
|
|
428
|
+
export const SetAppSecretDocument = graphql(`
|
|
429
|
+
mutation SdkSetAppSecret($workspaceID: ID!, $alias: String!, $name: String!, $value: String!) {
|
|
430
|
+
setAppSecret(input: { workspaceID: $workspaceID, alias: $alias, name: $name, value: $value }) {
|
|
431
|
+
env {
|
|
432
|
+
name
|
|
433
|
+
value
|
|
434
|
+
secret
|
|
435
|
+
alias
|
|
436
|
+
inherited
|
|
437
|
+
masked
|
|
438
|
+
updatedAt
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
`);
|
|
443
|
+
export const RemoveAppEnvDocument = graphql(`
|
|
444
|
+
mutation SdkRemoveAppEnv($workspaceID: ID!, $alias: String!, $name: String!) {
|
|
445
|
+
removeAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name }) {
|
|
446
|
+
ok
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
`);
|
|
450
|
+
export const InheritAppEnvDocument = graphql(`
|
|
451
|
+
mutation SdkInheritAppEnv($workspaceID: ID!, $alias: String!, $name: String!) {
|
|
452
|
+
inheritAppEnv(input: { workspaceID: $workspaceID, alias: $alias, name: $name }) {
|
|
453
|
+
ok
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
`);
|
|
457
|
+
export const ListAppEnvDocument = graphql(`
|
|
458
|
+
query SdkListAppEnv($workspaceID: ID!, $alias: String!) {
|
|
459
|
+
appEnv(workspaceID: $workspaceID, alias: $alias) {
|
|
460
|
+
name
|
|
461
|
+
value
|
|
462
|
+
secret
|
|
463
|
+
alias
|
|
464
|
+
inherited
|
|
465
|
+
masked
|
|
466
|
+
updatedAt
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
`);
|
|
470
|
+
//# sourceMappingURL=operations.js.map
|