@fluid-app/fluid-cli-mist 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.
- package/dist/index.d.mts +158 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1398 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { FluidPlugin } from "@fluid-app/fluid-cli";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Wire types for the Mist API. Hand-rolled until
|
|
6
|
+
* `docs/openapi/storefront-v202604.yaml` lands in the Fluid repo and we can
|
|
7
|
+
* generate them — at which point this file gets swapped for the generated
|
|
8
|
+
* version (the field names are the same, so consumers don't change).
|
|
9
|
+
*
|
|
10
|
+
* Source of truth: `features/mist/cli-spec.md` § 4.
|
|
11
|
+
*/
|
|
12
|
+
type MistKind = "next_app";
|
|
13
|
+
type MistState = "pending" | "provisioning" | "live" | "failed" | "pending_destroy" | "archived";
|
|
14
|
+
/**
|
|
15
|
+
* Canonical hostable type strings as used on the wire. These match the Rails
|
|
16
|
+
* model class names exactly — the API rejects anything else with a 400.
|
|
17
|
+
*
|
|
18
|
+
* Source: fluid `features/mist/cli-spec.md` § "What changed on the Rails side"
|
|
19
|
+
* (PR #18678).
|
|
20
|
+
*/
|
|
21
|
+
type HostableType = "Droplet::Application" | "MobileWidget" | "DropZone";
|
|
22
|
+
interface Droplet {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
uuid: string;
|
|
26
|
+
}
|
|
27
|
+
interface Mist {
|
|
28
|
+
id: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
/** Optional display label set via `--name`; falls back to `hostable.name`
|
|
31
|
+
* server-side when blank. */
|
|
32
|
+
name: string | null;
|
|
33
|
+
state: MistState;
|
|
34
|
+
kind: MistKind;
|
|
35
|
+
hostable_type: HostableType | null;
|
|
36
|
+
hostable_id: number | null;
|
|
37
|
+
vendor_name: string;
|
|
38
|
+
public_url: string | null;
|
|
39
|
+
/** ISO-8601 when state === "pending_destroy"; null otherwise. */
|
|
40
|
+
scheduled_destroy_at: string | null;
|
|
41
|
+
droplet: Droplet | null;
|
|
42
|
+
provisioned_at: string | null;
|
|
43
|
+
created_at: string;
|
|
44
|
+
updated_at: string;
|
|
45
|
+
}
|
|
46
|
+
interface PaginationCursor {
|
|
47
|
+
cursor: string | null;
|
|
48
|
+
limit: number;
|
|
49
|
+
prev_cursor: string | null;
|
|
50
|
+
next_cursor: string | null;
|
|
51
|
+
}
|
|
52
|
+
interface ApiMeta {
|
|
53
|
+
request_id: string;
|
|
54
|
+
timestamp: string;
|
|
55
|
+
pagination?: PaginationCursor;
|
|
56
|
+
}
|
|
57
|
+
interface ApiCollection<TKey extends string, TItem> {
|
|
58
|
+
meta: ApiMeta;
|
|
59
|
+
status: number;
|
|
60
|
+
}
|
|
61
|
+
type MistListResponse = {
|
|
62
|
+
mists: Mist[];
|
|
63
|
+
meta: ApiMeta;
|
|
64
|
+
status: number;
|
|
65
|
+
};
|
|
66
|
+
type MistShowResponse = {
|
|
67
|
+
mist: Mist;
|
|
68
|
+
meta: ApiMeta;
|
|
69
|
+
status: number;
|
|
70
|
+
};
|
|
71
|
+
interface MistCreateRequest {
|
|
72
|
+
mist: {
|
|
73
|
+
name?: string;
|
|
74
|
+
kind?: MistKind; /** Must be paired with `hostable_id`; both null/absent = standalone. */
|
|
75
|
+
hostable_type?: HostableType;
|
|
76
|
+
hostable_id?: number;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `PATCH /api/v202604/mists/:id` body. Three operations on one endpoint:
|
|
81
|
+
*
|
|
82
|
+
* - **Rename** — pass `name` (and/or `kind`)
|
|
83
|
+
* - **Attach / replace** — pass both `hostable_type` and `hostable_id`
|
|
84
|
+
* - **Detach** — pass both as **explicit `null`**. `maybe(...)` on the Rails
|
|
85
|
+
* side means absent keys leave attachment alone; explicit nulls clear it.
|
|
86
|
+
*/
|
|
87
|
+
interface MistUpdateRequest {
|
|
88
|
+
mist: {
|
|
89
|
+
name?: string;
|
|
90
|
+
kind?: MistKind;
|
|
91
|
+
hostable_type?: HostableType | null;
|
|
92
|
+
hostable_id?: number | null;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
interface EnvVar {
|
|
96
|
+
key: string;
|
|
97
|
+
value: string;
|
|
98
|
+
targets: ("production" | "preview" | "development")[];
|
|
99
|
+
managed_by: "user" | "mist";
|
|
100
|
+
}
|
|
101
|
+
interface EnvVarsListResponse {
|
|
102
|
+
env_vars: EnvVar[];
|
|
103
|
+
meta: ApiMeta;
|
|
104
|
+
status: number;
|
|
105
|
+
}
|
|
106
|
+
interface GitCredential {
|
|
107
|
+
remote_url: string;
|
|
108
|
+
expires_at: string;
|
|
109
|
+
}
|
|
110
|
+
interface GitCredentialResponse {
|
|
111
|
+
git_credential: GitCredential;
|
|
112
|
+
meta: ApiMeta;
|
|
113
|
+
status: number;
|
|
114
|
+
}
|
|
115
|
+
type DeploymentState = "ready" | "building" | "error" | "canceled" | "queued";
|
|
116
|
+
interface Deployment {
|
|
117
|
+
id: string;
|
|
118
|
+
state: DeploymentState;
|
|
119
|
+
url: string | null;
|
|
120
|
+
commit_sha: string | null;
|
|
121
|
+
commit_message: string | null;
|
|
122
|
+
created_at: string;
|
|
123
|
+
target: "production" | "preview";
|
|
124
|
+
}
|
|
125
|
+
interface DeploymentsListResponse {
|
|
126
|
+
deployments: Deployment[];
|
|
127
|
+
meta: ApiMeta;
|
|
128
|
+
status: number;
|
|
129
|
+
}
|
|
130
|
+
interface DeploymentShowResponse {
|
|
131
|
+
deployment: Deployment;
|
|
132
|
+
meta: ApiMeta;
|
|
133
|
+
status: number;
|
|
134
|
+
}
|
|
135
|
+
interface LogEntry {
|
|
136
|
+
timestamp: string;
|
|
137
|
+
level: "stdout" | "stderr";
|
|
138
|
+
message: string;
|
|
139
|
+
source: string;
|
|
140
|
+
}
|
|
141
|
+
interface LogsResponse {
|
|
142
|
+
deployment_id: string;
|
|
143
|
+
logs: LogEntry[];
|
|
144
|
+
meta: ApiMeta;
|
|
145
|
+
status: number;
|
|
146
|
+
}
|
|
147
|
+
/** The `.mist` file the CLI writes after `fluid mist clone <slug>`. */
|
|
148
|
+
interface MistFile {
|
|
149
|
+
slug: string;
|
|
150
|
+
vendor_name: string;
|
|
151
|
+
public_url: string | null;
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/index.d.ts
|
|
155
|
+
declare const plugin: FluidPlugin;
|
|
156
|
+
//#endregion
|
|
157
|
+
export { ApiCollection, ApiMeta, Deployment, DeploymentShowResponse, DeploymentState, DeploymentsListResponse, Droplet, EnvVar, EnvVarsListResponse, GitCredential, GitCredentialResponse, HostableType, LogEntry, LogsResponse, Mist, MistCreateRequest, MistFile, MistKind, MistListResponse, MistShowResponse, MistState, MistUpdateRequest, PaginationCursor, plugin as default };
|
|
158
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;AASA;;;;;KAAY,QAAA;AAAA,KAEA,SAAA;;;;AAeZ;;;;KAAY,YAAA;AAAA,UAEK,OAAA;EACf,EAAA;EACA,IAAA;EACA,IAAA;AAAA;AAAA,UAGe,IAAA;EACf,EAAA;EACA,IAAA;EALA;AAGF;EAKE,IAAA;EACA,KAAA,EAAO,SAAA;EACP,IAAA,EAAM,QAAA;EACN,aAAA,EAAe,YAAA;EACf,WAAA;EACA,WAAA;EACA,UAAA;EAGS;EADT,oBAAA;EACA,OAAA,EAAS,OAAA;EACT,cAAA;EACA,UAAA;EACA,UAAA;AAAA;AAAA,UAGe,gBAAA;EACf,MAAA;EACA,KAAA;EACA,WAAA;EACA,WAAA;AAAA;AAAA,UAGe,OA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