@supacloud/cli 0.3.4 → 0.3.5
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.js +24 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5312,6 +5312,29 @@ var backgroundRoutesSchema = exports_external.preprocess((value) => {
|
|
|
5312
5312
|
}
|
|
5313
5313
|
}
|
|
5314
5314
|
}));
|
|
5315
|
+
var secretsSchema = exports_external.preprocess((value) => {
|
|
5316
|
+
if (typeof value !== "string")
|
|
5317
|
+
return value;
|
|
5318
|
+
const trimmed = value.trim();
|
|
5319
|
+
if (!trimmed)
|
|
5320
|
+
return [];
|
|
5321
|
+
if (trimmed.startsWith("[")) {
|
|
5322
|
+
try {
|
|
5323
|
+
return JSON.parse(trimmed);
|
|
5324
|
+
} catch {
|
|
5325
|
+
return trimmed;
|
|
5326
|
+
}
|
|
5327
|
+
}
|
|
5328
|
+
return trimmed.split(",").map((entry) => {
|
|
5329
|
+
const separator = entry.indexOf("=");
|
|
5330
|
+
if (separator <= 0)
|
|
5331
|
+
return { name: entry.trim(), value: "" };
|
|
5332
|
+
return {
|
|
5333
|
+
name: entry.slice(0, separator).trim(),
|
|
5334
|
+
value: entry.slice(separator + 1)
|
|
5335
|
+
};
|
|
5336
|
+
}).filter((entry) => entry.name);
|
|
5337
|
+
}, exports_external.array(exports_external.object({ name: exports_external.string(), value: exports_external.string() })).optional());
|
|
5315
5338
|
function registerAdvancedTools(server, http) {
|
|
5316
5339
|
server.tool("edge_functions", `Edge Function management (Deno/Bun serverless). Server auto-bundles dependencies.
|
|
5317
5340
|
Actions: list, deploy, deploy_bundle, config, source, delete, check`, {
|
|
@@ -5431,7 +5454,7 @@ ${await updateFunctionConfig()}` : `✅ Function ${slug} bundle deployed (${Obje
|
|
|
5431
5454
|
Actions: list, upsert, delete`, {
|
|
5432
5455
|
action: exports_external.enum(["list", "upsert", "delete"]).describe("Action"),
|
|
5433
5456
|
ref: exports_external.string().describe("Project ref"),
|
|
5434
|
-
secrets:
|
|
5457
|
+
secrets: secretsSchema.describe("[upsert] Secret list as JSON array or KEY=VALUE,KEY2=VALUE2"),
|
|
5435
5458
|
name: exports_external.string().optional().describe("[delete] Secret name to delete")
|
|
5436
5459
|
}, async (args) => {
|
|
5437
5460
|
const { action, ref, secrets, name } = args;
|