@supacloud/admin 0.8.0 → 0.8.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 +1 -1
- package/dist/index.js +37 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ npx @supacloud/admin status
|
|
|
29
29
|
npx @supacloud/admin ssh ping
|
|
30
30
|
npx @supacloud/admin ssh versions
|
|
31
31
|
npx @supacloud/admin ssh diagnose
|
|
32
|
-
npx @supacloud/admin project create --name my-app
|
|
32
|
+
npx @supacloud/admin project create --name my-app --domain example.com
|
|
33
33
|
npx @supacloud/admin project list
|
|
34
34
|
```
|
|
35
35
|
|
package/dist/index.js
CHANGED
|
@@ -28736,19 +28736,49 @@ function registerAdminProjectCliTools(server, http) {
|
|
|
28736
28736
|
name: optional(Type.String(), "[create] Project name"),
|
|
28737
28737
|
region: optional(Type.String(), "[create] Region (default: local)"),
|
|
28738
28738
|
organization_id: optional(Type.String(), "[create] Organization ID"),
|
|
28739
|
+
domain: optional(Type.String(), "[create] Base custom domain"),
|
|
28740
|
+
api_domain: optional(Type.String(), "[create] Explicit API domain"),
|
|
28741
|
+
auth_domain: optional(Type.String(), "[create] Explicit Auth/OIDC domain"),
|
|
28742
|
+
studio_domain: optional(Type.String(), "[create] Explicit Studio domain"),
|
|
28739
28743
|
settings: optional(Type.Record(Type.String(), Type.Unknown()), "[update_settings] Config fields to update"),
|
|
28740
28744
|
log_type: optional(stringEnum(["all", "auth", "database", "api"]), "[logs] Filter by service")
|
|
28741
|
-
}, async ({
|
|
28745
|
+
}, async ({
|
|
28746
|
+
action,
|
|
28747
|
+
ref,
|
|
28748
|
+
name,
|
|
28749
|
+
region,
|
|
28750
|
+
organization_id,
|
|
28751
|
+
domain,
|
|
28752
|
+
api_domain,
|
|
28753
|
+
auth_domain,
|
|
28754
|
+
studio_domain,
|
|
28755
|
+
settings,
|
|
28756
|
+
log_type
|
|
28757
|
+
}) => {
|
|
28742
28758
|
let text;
|
|
28743
28759
|
switch (action) {
|
|
28744
28760
|
case "list":
|
|
28745
28761
|
text = ok(await http.get("/v1/projects"));
|
|
28746
28762
|
break;
|
|
28747
|
-
case "create":
|
|
28763
|
+
case "create": {
|
|
28748
28764
|
if (!name)
|
|
28749
28765
|
throw new Error("'name' is required for create");
|
|
28750
|
-
|
|
28766
|
+
const createRequest = {
|
|
28767
|
+
name,
|
|
28768
|
+
region: region || "local",
|
|
28769
|
+
organization_id
|
|
28770
|
+
};
|
|
28771
|
+
if (domain)
|
|
28772
|
+
createRequest.domain = domain;
|
|
28773
|
+
if (api_domain)
|
|
28774
|
+
createRequest.api_domain = api_domain;
|
|
28775
|
+
if (auth_domain)
|
|
28776
|
+
createRequest.auth_domain = auth_domain;
|
|
28777
|
+
if (studio_domain)
|
|
28778
|
+
createRequest.studio_domain = studio_domain;
|
|
28779
|
+
text = ok(await http.post("/v1/projects", createRequest));
|
|
28751
28780
|
break;
|
|
28781
|
+
}
|
|
28752
28782
|
case "get":
|
|
28753
28783
|
text = ok(await http.get(`/v1/projects/${resolveRef(ref)}`));
|
|
28754
28784
|
break;
|
|
@@ -29137,7 +29167,7 @@ Actions: routes, upsert_route, update_route, delete_route, config, get_certifica
|
|
|
29137
29167
|
// package.json
|
|
29138
29168
|
var package_default = {
|
|
29139
29169
|
name: "@supacloud/admin",
|
|
29140
|
-
version: "0.8.
|
|
29170
|
+
version: "0.8.1",
|
|
29141
29171
|
description: "Platform administration CLI for SupaCloud operators",
|
|
29142
29172
|
type: "module",
|
|
29143
29173
|
main: "./dist/index.js",
|
|
@@ -29178,21 +29208,6 @@ var package_default = {
|
|
|
29178
29208
|
};
|
|
29179
29209
|
|
|
29180
29210
|
// src/index.ts
|
|
29181
|
-
var adminProjectActionSchema = stringEnum([
|
|
29182
|
-
"list",
|
|
29183
|
-
"create",
|
|
29184
|
-
"get",
|
|
29185
|
-
"delete",
|
|
29186
|
-
"pause",
|
|
29187
|
-
"restore",
|
|
29188
|
-
"restart",
|
|
29189
|
-
"settings",
|
|
29190
|
-
"update_settings",
|
|
29191
|
-
"api_keys",
|
|
29192
|
-
"health",
|
|
29193
|
-
"logs",
|
|
29194
|
-
"tasks"
|
|
29195
|
-
]);
|
|
29196
29211
|
var platformActionSchema = stringEnum([
|
|
29197
29212
|
"metrics",
|
|
29198
29213
|
"list_backups",
|
|
@@ -29264,7 +29279,7 @@ EXAMPLES
|
|
|
29264
29279
|
supacloud-admin ssh ping
|
|
29265
29280
|
supacloud-admin ssh versions
|
|
29266
29281
|
supacloud-admin ssh install --public_domain api.example.com --studio_domain studio.example.com
|
|
29267
|
-
supacloud-admin project create --name my-app
|
|
29282
|
+
supacloud-admin project create --name my-app --domain example.com
|
|
29268
29283
|
supacloud-admin project list
|
|
29269
29284
|
supacloud-admin platform metrics
|
|
29270
29285
|
supacloud-admin gateway routes --ref abc123
|
|
@@ -29296,8 +29311,9 @@ function createAdminTools(context = resolveSupaCloudContext()) {
|
|
|
29296
29311
|
}
|
|
29297
29312
|
};
|
|
29298
29313
|
const registerAdminHelp = () => {
|
|
29314
|
+
const projectHelpTool = captureTools((server) => registerAdminProjectCliTools(server, {})).project;
|
|
29299
29315
|
tools.project = {
|
|
29300
|
-
schema:
|
|
29316
|
+
schema: projectHelpTool.schema,
|
|
29301
29317
|
callback: async () => ({
|
|
29302
29318
|
isError: true,
|
|
29303
29319
|
content: [
|