@zuplo/cli 7.15.28 → 7.15.32
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 +0 -11
- package/dist/cli.js +0 -2
- package/dist/cli.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@posthog/core/dist/gzip.d.ts +2 -0
- package/node_modules/@posthog/core/dist/gzip.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/gzip.js +17 -1
- package/node_modules/@posthog/core/dist/gzip.mjs +15 -2
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/gzip.ts +21 -4
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +82 -0
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/posthog-config.ts +84 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +296 -296
- package/node_modules/@zuplo/core/index.minified.js +305 -305
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +11 -11
- package/dist/cmds/proxies/create.d.ts +0 -9
- package/dist/cmds/proxies/create.d.ts.map +0 -1
- package/dist/cmds/proxies/create.js +0 -66
- package/dist/cmds/proxies/create.js.map +0 -1
- package/dist/cmds/proxies/delete.d.ts +0 -9
- package/dist/cmds/proxies/delete.d.ts.map +0 -1
- package/dist/cmds/proxies/delete.js +0 -56
- package/dist/cmds/proxies/delete.js.map +0 -1
- package/dist/cmds/proxies/describe.d.ts +0 -9
- package/dist/cmds/proxies/describe.d.ts.map +0 -1
- package/dist/cmds/proxies/describe.js +0 -56
- package/dist/cmds/proxies/describe.js.map +0 -1
- package/dist/cmds/proxies/index.d.ts +0 -10
- package/dist/cmds/proxies/index.d.ts.map +0 -1
- package/dist/cmds/proxies/index.js +0 -15
- package/dist/cmds/proxies/index.js.map +0 -1
- package/dist/cmds/proxies/update.d.ts +0 -9
- package/dist/cmds/proxies/update.d.ts.map +0 -1
- package/dist/cmds/proxies/update.js +0 -66
- package/dist/cmds/proxies/update.js.map +0 -1
- package/dist/common/middleware/validate-fleet.d.ts +0 -4
- package/dist/common/middleware/validate-fleet.d.ts.map +0 -1
- package/dist/common/middleware/validate-fleet.js +0 -53
- package/dist/common/middleware/validate-fleet.js.map +0 -1
- package/dist/proxies/create/handler.d.ts +0 -8
- package/dist/proxies/create/handler.d.ts.map +0 -1
- package/dist/proxies/create/handler.js +0 -26
- package/dist/proxies/create/handler.js.map +0 -1
- package/dist/proxies/delete/handler.d.ts +0 -9
- package/dist/proxies/delete/handler.d.ts.map +0 -1
- package/dist/proxies/delete/handler.js +0 -13
- package/dist/proxies/delete/handler.js.map +0 -1
- package/dist/proxies/describe/handler.d.ts +0 -7
- package/dist/proxies/describe/handler.d.ts.map +0 -1
- package/dist/proxies/describe/handler.js +0 -12
- package/dist/proxies/describe/handler.js.map +0 -1
- package/dist/proxies/models.d.ts +0 -4
- package/dist/proxies/models.d.ts.map +0 -1
- package/dist/proxies/models.js +0 -2
- package/dist/proxies/models.js.map +0 -1
- package/dist/proxies/update/handler.d.ts +0 -8
- package/dist/proxies/update/handler.d.ts.map +0 -1
- package/dist/proxies/update/handler.js +0 -26
- package/dist/proxies/update/handler.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "7.15.
|
|
3
|
+
"version": "7.15.32",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"@opentelemetry/api": "1.9.0",
|
|
33
33
|
"@opentelemetry/api-logs": "0.220.0",
|
|
34
34
|
"@swc/core": "1.10.18",
|
|
35
|
-
"@zuplo/core": "7.15.
|
|
35
|
+
"@zuplo/core": "7.15.32",
|
|
36
36
|
"@zuplo/editor": "1.0.39603386871",
|
|
37
|
-
"@zuplo/openapi-tools": "7.15.
|
|
38
|
-
"@zuplo/runtime": "7.15.
|
|
37
|
+
"@zuplo/openapi-tools": "7.15.32",
|
|
38
|
+
"@zuplo/runtime": "7.15.32",
|
|
39
39
|
"chalk": "5.4.1",
|
|
40
40
|
"chokidar": "3.5.3",
|
|
41
41
|
"cookie": "1.0.2",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
"workerd": "1.20261002.1",
|
|
67
67
|
"yargs": "17.7.2",
|
|
68
68
|
"zod": "4.6.7",
|
|
69
|
-
"@zuplo/graphql": "7.15.
|
|
70
|
-
"@zuplo/otel": "7.15.
|
|
69
|
+
"@zuplo/graphql": "7.15.32",
|
|
70
|
+
"@zuplo/otel": "7.15.32"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@zuplo/lint-darwin-arm64": "7.15.
|
|
74
|
-
"@zuplo/lint-darwin-x64": "7.15.
|
|
75
|
-
"@zuplo/lint-linux-x64": "7.15.
|
|
76
|
-
"@zuplo/lint-linux-arm64": "7.15.
|
|
77
|
-
"@zuplo/lint-win32-x64": "7.15.
|
|
73
|
+
"@zuplo/lint-darwin-arm64": "7.15.32",
|
|
74
|
+
"@zuplo/lint-darwin-x64": "7.15.32",
|
|
75
|
+
"@zuplo/lint-linux-x64": "7.15.32",
|
|
76
|
+
"@zuplo/lint-linux-arm64": "7.15.32",
|
|
77
|
+
"@zuplo/lint-win32-x64": "7.15.32"
|
|
78
78
|
},
|
|
79
79
|
"bundleDependencies": [
|
|
80
80
|
"@inquirer/prompts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cmds/proxies/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAmDf,OAAO;;AAtD/B,wBA6DE"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { captureEvent } from "../../common/analytics/lib.js";
|
|
2
|
-
import { authenticate } from "../../common/middleware/authentication.js";
|
|
3
|
-
import { fetchAccount } from "../../common/middleware/get-account-param.js";
|
|
4
|
-
import { configure } from "../../common/middleware/user-configuration.js";
|
|
5
|
-
import { identify } from "../../common/middleware/user-identification.js";
|
|
6
|
-
import { validateFleet } from "../../common/middleware/validate-fleet.js";
|
|
7
|
-
import { validateFileExists } from "../../common/validators/argument-validators.js";
|
|
8
|
-
import { create } from "../../proxies/create/handler.js";
|
|
9
|
-
export default {
|
|
10
|
-
desc: "Creates a new proxy configuration for a fleet",
|
|
11
|
-
command: "create",
|
|
12
|
-
builder: (yargs) => {
|
|
13
|
-
return yargs
|
|
14
|
-
.usage("$0 proxies create --fleet <fleet-id> --configuration-file <file> [options]")
|
|
15
|
-
.option("fleet", {
|
|
16
|
-
type: "string",
|
|
17
|
-
describe: "The fleet ID",
|
|
18
|
-
})
|
|
19
|
-
.option("configuration-file", {
|
|
20
|
-
type: "string",
|
|
21
|
-
describe: "Path to JSON configuration file",
|
|
22
|
-
normalize: true,
|
|
23
|
-
})
|
|
24
|
-
.option("api-key", {
|
|
25
|
-
type: "string",
|
|
26
|
-
describe: "The API Key from Zuplo",
|
|
27
|
-
envVar: "API_KEY",
|
|
28
|
-
alias: "apikey",
|
|
29
|
-
})
|
|
30
|
-
.option("account", {
|
|
31
|
-
type: "string",
|
|
32
|
-
describe: "The account name",
|
|
33
|
-
})
|
|
34
|
-
.demandOption(["fleet", "configuration-file"])
|
|
35
|
-
.demandOption("api-key", "You must provide an API key with --api-key")
|
|
36
|
-
.check((argv) => {
|
|
37
|
-
validateFileExists(argv["configuration-file"], "--configuration-file");
|
|
38
|
-
return true;
|
|
39
|
-
})
|
|
40
|
-
.example([
|
|
41
|
-
[
|
|
42
|
-
"$0 proxies create --fleet fleet_abc123 --configuration-file ./proxy-config.json",
|
|
43
|
-
"Create a new proxy configuration for a fleet",
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
"$0 proxies create --fleet fleet_abc123 --configuration-file ./config.json --account my-account",
|
|
47
|
-
"Explicitly specify the account",
|
|
48
|
-
],
|
|
49
|
-
])
|
|
50
|
-
.middleware([
|
|
51
|
-
authenticate,
|
|
52
|
-
configure,
|
|
53
|
-
fetchAccount,
|
|
54
|
-
validateFleet,
|
|
55
|
-
identify,
|
|
56
|
-
]);
|
|
57
|
-
},
|
|
58
|
-
handler: async (argv) => {
|
|
59
|
-
await captureEvent({
|
|
60
|
-
argv,
|
|
61
|
-
event: "zuplo proxies create",
|
|
62
|
-
});
|
|
63
|
-
await create(argv);
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/cmds/proxies/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAa,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEpE,eAAe;IACb,IAAI,EAAE,+CAA+C;IACrD,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CACJ,4EAA4E,CAC7E;aACA,MAAM,CAAC,OAAO,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,cAAc;SACzB,CAAC;aACD,MAAM,CAAC,oBAAoB,EAAE;YAC5B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,iCAAiC;YAC3C,SAAS,EAAE,IAAI;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,YAAY,CAAC,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;aAC7C,YAAY,CAAC,SAAS,EAAE,4CAA4C,CAAC;aACrE,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;YACd,kBAAkB,CAChB,IAAI,CAAC,oBAAoB,CAAW,EACpC,sBAAsB,CACvB,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,OAAO,CAAC;YACP;gBACE,iFAAiF;gBACjF,8CAA8C;aAC/C;YACD;gBACE,gGAAgG;gBAChG,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC;YACV,YAAY;YACZ,SAAS;YACT,YAAY;YACZ,aAAa;YACb,QAAQ;SACT,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC;YACjB,IAAI;YACJ,KAAK,EAAE,sBAAsB;SAC9B,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,IAAiB,CAAC,CAAC;IAClC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\nimport { validateFleet } from \"../../common/middleware/validate-fleet.js\";\nimport { validateFileExists } from \"../../common/validators/argument-validators.js\";\nimport { Arguments, create } from \"../../proxies/create/handler.js\";\n\nexport default {\n desc: \"Creates a new proxy configuration for a fleet\",\n command: \"create\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\n \"$0 proxies create --fleet <fleet-id> --configuration-file <file> [options]\"\n )\n .option(\"fleet\", {\n type: \"string\",\n describe: \"The fleet ID\",\n })\n .option(\"configuration-file\", {\n type: \"string\",\n describe: \"Path to JSON configuration file\",\n normalize: true,\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .demandOption([\"fleet\", \"configuration-file\"])\n .demandOption(\"api-key\", \"You must provide an API key with --api-key\")\n .check((argv) => {\n validateFileExists(\n argv[\"configuration-file\"] as string,\n \"--configuration-file\"\n );\n return true;\n })\n .example([\n [\n \"$0 proxies create --fleet fleet_abc123 --configuration-file ./proxy-config.json\",\n \"Create a new proxy configuration for a fleet\",\n ],\n [\n \"$0 proxies create --fleet fleet_abc123 --configuration-file ./config.json --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([\n authenticate,\n configure,\n fetchAccount,\n validateFleet,\n identify,\n ]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({\n argv,\n event: \"zuplo proxies create\",\n });\n await create(argv as Arguments);\n },\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/cmds/proxies/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAeV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAqCf,OAAO;;AAxC/B,wBA+CE"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { captureEvent } from "../../common/analytics/lib.js";
|
|
2
|
-
import { authenticate } from "../../common/middleware/authentication.js";
|
|
3
|
-
import { fetchAccount } from "../../common/middleware/get-account-param.js";
|
|
4
|
-
import { configure } from "../../common/middleware/user-configuration.js";
|
|
5
|
-
import { identify } from "../../common/middleware/user-identification.js";
|
|
6
|
-
import { validateFleet } from "../../common/middleware/validate-fleet.js";
|
|
7
|
-
import { deleteProxyConfiguration, } from "../../proxies/delete/handler.js";
|
|
8
|
-
export default {
|
|
9
|
-
desc: "Deletes a proxy configuration for a fleet",
|
|
10
|
-
command: "delete",
|
|
11
|
-
builder: (yargs) => {
|
|
12
|
-
return yargs
|
|
13
|
-
.usage("$0 proxies delete --fleet <fleet-id> [options]")
|
|
14
|
-
.option("fleet", {
|
|
15
|
-
type: "string",
|
|
16
|
-
describe: "The fleet ID",
|
|
17
|
-
})
|
|
18
|
-
.option("api-key", {
|
|
19
|
-
type: "string",
|
|
20
|
-
describe: "The API Key from Zuplo",
|
|
21
|
-
envVar: "API_KEY",
|
|
22
|
-
alias: "apikey",
|
|
23
|
-
})
|
|
24
|
-
.option("account", {
|
|
25
|
-
type: "string",
|
|
26
|
-
describe: "The account name",
|
|
27
|
-
})
|
|
28
|
-
.demandOption(["fleet"])
|
|
29
|
-
.demandOption("api-key", "You must provide an API key with --api-key")
|
|
30
|
-
.example([
|
|
31
|
-
[
|
|
32
|
-
"$0 proxies delete --fleet fleet_abc123",
|
|
33
|
-
"Delete a proxy configuration for a fleet",
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"$0 proxies delete --fleet fleet_abc123 --account my-account",
|
|
37
|
-
"Explicitly specify the account",
|
|
38
|
-
],
|
|
39
|
-
])
|
|
40
|
-
.middleware([
|
|
41
|
-
authenticate,
|
|
42
|
-
configure,
|
|
43
|
-
fetchAccount,
|
|
44
|
-
validateFleet,
|
|
45
|
-
identify,
|
|
46
|
-
]);
|
|
47
|
-
},
|
|
48
|
-
handler: async (argv) => {
|
|
49
|
-
await captureEvent({
|
|
50
|
-
argv,
|
|
51
|
-
event: "zuplo proxies delete",
|
|
52
|
-
});
|
|
53
|
-
await deleteProxyConfiguration(argv);
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/cmds/proxies/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAEL,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AAEzC,eAAe;IACb,IAAI,EAAE,2CAA2C;IACjD,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,gDAAgD,CAAC;aACvD,MAAM,CAAC,OAAO,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,cAAc;SACzB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;aACvB,YAAY,CAAC,SAAS,EAAE,4CAA4C,CAAC;aACrE,OAAO,CAAC;YACP;gBACE,wCAAwC;gBACxC,0CAA0C;aAC3C;YACD;gBACE,6DAA6D;gBAC7D,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC;YACV,YAAY;YACZ,SAAS;YACT,YAAY;YACZ,aAAa;YACb,QAAQ;SACT,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC;YACjB,IAAI;YACJ,KAAK,EAAE,sBAAsB;SAC9B,CAAC,CAAC;QACH,MAAM,wBAAwB,CAAC,IAAiB,CAAC,CAAC;IACpD,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\nimport { validateFleet } from \"../../common/middleware/validate-fleet.js\";\nimport {\n Arguments,\n deleteProxyConfiguration,\n} from \"../../proxies/delete/handler.js\";\n\nexport default {\n desc: \"Deletes a proxy configuration for a fleet\",\n command: \"delete\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 proxies delete --fleet <fleet-id> [options]\")\n .option(\"fleet\", {\n type: \"string\",\n describe: \"The fleet ID\",\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .demandOption([\"fleet\"])\n .demandOption(\"api-key\", \"You must provide an API key with --api-key\")\n .example([\n [\n \"$0 proxies delete --fleet fleet_abc123\",\n \"Delete a proxy configuration for a fleet\",\n ],\n [\n \"$0 proxies delete --fleet fleet_abc123 --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([\n authenticate,\n configure,\n fetchAccount,\n validateFleet,\n identify,\n ]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({\n argv,\n event: \"zuplo proxies delete\",\n });\n await deleteProxyConfiguration(argv as Arguments);\n },\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/cmds/proxies/describe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAYV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAqCf,OAAO;;AAxC/B,wBA+CE"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { captureEvent } from "../../common/analytics/lib.js";
|
|
2
|
-
import { authenticate } from "../../common/middleware/authentication.js";
|
|
3
|
-
import { fetchAccount } from "../../common/middleware/get-account-param.js";
|
|
4
|
-
import { configure } from "../../common/middleware/user-configuration.js";
|
|
5
|
-
import { identify } from "../../common/middleware/user-identification.js";
|
|
6
|
-
import { validateFleet } from "../../common/middleware/validate-fleet.js";
|
|
7
|
-
import { describe } from "../../proxies/describe/handler.js";
|
|
8
|
-
export default {
|
|
9
|
-
desc: "Describes a proxy configuration for a fleet",
|
|
10
|
-
command: "describe",
|
|
11
|
-
builder: (yargs) => {
|
|
12
|
-
return yargs
|
|
13
|
-
.usage("$0 proxies describe --fleet <fleet-id> [options]")
|
|
14
|
-
.option("fleet", {
|
|
15
|
-
type: "string",
|
|
16
|
-
describe: "The fleet ID",
|
|
17
|
-
})
|
|
18
|
-
.option("api-key", {
|
|
19
|
-
type: "string",
|
|
20
|
-
describe: "The API Key from Zuplo",
|
|
21
|
-
envVar: "API_KEY",
|
|
22
|
-
alias: "apikey",
|
|
23
|
-
})
|
|
24
|
-
.option("account", {
|
|
25
|
-
type: "string",
|
|
26
|
-
describe: "The account name",
|
|
27
|
-
})
|
|
28
|
-
.demandOption(["fleet"])
|
|
29
|
-
.demandOption("api-key", "You must provide an API key with --api-key")
|
|
30
|
-
.example([
|
|
31
|
-
[
|
|
32
|
-
"$0 proxies describe --fleet fleet_abc123",
|
|
33
|
-
"View the proxy configuration for a fleet",
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"$0 proxies describe --fleet fleet_abc123 --account my-account",
|
|
37
|
-
"Explicitly specify the account",
|
|
38
|
-
],
|
|
39
|
-
])
|
|
40
|
-
.middleware([
|
|
41
|
-
authenticate,
|
|
42
|
-
configure,
|
|
43
|
-
fetchAccount,
|
|
44
|
-
validateFleet,
|
|
45
|
-
identify,
|
|
46
|
-
]);
|
|
47
|
-
},
|
|
48
|
-
handler: async (argv) => {
|
|
49
|
-
await captureEvent({
|
|
50
|
-
argv,
|
|
51
|
-
event: "zuplo proxies describe",
|
|
52
|
-
});
|
|
53
|
-
await describe(argv);
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=describe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/cmds/proxies/describe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAa,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAExE,eAAe;IACb,IAAI,EAAE,6CAA6C;IACnD,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,kDAAkD,CAAC;aACzD,MAAM,CAAC,OAAO,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,cAAc;SACzB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;aACvB,YAAY,CAAC,SAAS,EAAE,4CAA4C,CAAC;aACrE,OAAO,CAAC;YACP;gBACE,0CAA0C;gBAC1C,0CAA0C;aAC3C;YACD;gBACE,+DAA+D;gBAC/D,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC;YACV,YAAY;YACZ,SAAS;YACT,YAAY;YACZ,aAAa;YACb,QAAQ;SACT,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC;YACjB,IAAI;YACJ,KAAK,EAAE,wBAAwB;SAChC,CAAC,CAAC;QACH,MAAM,QAAQ,CAAC,IAAiB,CAAC,CAAC;IACpC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\nimport { validateFleet } from \"../../common/middleware/validate-fleet.js\";\nimport { Arguments, describe } from \"../../proxies/describe/handler.js\";\n\nexport default {\n desc: \"Describes a proxy configuration for a fleet\",\n command: \"describe\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 proxies describe --fleet <fleet-id> [options]\")\n .option(\"fleet\", {\n type: \"string\",\n describe: \"The fleet ID\",\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .demandOption([\"fleet\"])\n .demandOption(\"api-key\", \"You must provide an API key with --api-key\")\n .example([\n [\n \"$0 proxies describe --fleet fleet_abc123\",\n \"View the proxy configuration for a fleet\",\n ],\n [\n \"$0 proxies describe --fleet fleet_abc123 --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([\n authenticate,\n configure,\n fetchAccount,\n validateFleet,\n identify,\n ]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({\n argv,\n event: \"zuplo proxies describe\",\n });\n await describe(argv as Arguments);\n },\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
builder: import("yargs").CommandBuilder<{}, {}>;
|
|
3
|
-
handler: (
|
|
4
|
-
args: import("yargs").ArgumentsCamelCase<{}>
|
|
5
|
-
) => void | Promise<void>;
|
|
6
|
-
desc: boolean;
|
|
7
|
-
command: string;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/proxies/index.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { showHelpOnNoSubcommand } from "../../common/handler.js";
|
|
2
|
-
import create from "./create.js";
|
|
3
|
-
import deleteProxyConfig from "./delete.js";
|
|
4
|
-
import describe from "./describe.js";
|
|
5
|
-
import update from "./update.js";
|
|
6
|
-
export default {
|
|
7
|
-
desc: false,
|
|
8
|
-
command: "proxies",
|
|
9
|
-
...showHelpOnNoSubcommand((yargs) => yargs
|
|
10
|
-
.command(create)
|
|
11
|
-
.command(update)
|
|
12
|
-
.command(describe)
|
|
13
|
-
.command(deleteProxyConfig)),
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cmds/proxies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,iBAAiB,MAAM,aAAa,CAAC;AAC5C,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,eAAe;IACb,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,SAAS;IAClB,GAAG,sBAAsB,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,iBAAiB,CAAC,CAC9B;CACF,CAAC","sourcesContent":["import { showHelpOnNoSubcommand } from \"../../common/handler.js\";\nimport create from \"./create.js\";\nimport deleteProxyConfig from \"./delete.js\";\nimport describe from \"./describe.js\";\nimport update from \"./update.js\";\n\nexport default {\n desc: false,\n command: \"proxies\",\n ...showHelpOnNoSubcommand((yargs) =>\n yargs\n .command(create)\n .command(update)\n .command(describe)\n .command(deleteProxyConfig)\n ),\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/proxies/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAmDf,OAAO;;AAtD/B,wBA6DE"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { captureEvent } from "../../common/analytics/lib.js";
|
|
2
|
-
import { authenticate } from "../../common/middleware/authentication.js";
|
|
3
|
-
import { fetchAccount } from "../../common/middleware/get-account-param.js";
|
|
4
|
-
import { configure } from "../../common/middleware/user-configuration.js";
|
|
5
|
-
import { identify } from "../../common/middleware/user-identification.js";
|
|
6
|
-
import { validateFleet } from "../../common/middleware/validate-fleet.js";
|
|
7
|
-
import { validateFileExists } from "../../common/validators/argument-validators.js";
|
|
8
|
-
import { update } from "../../proxies/update/handler.js";
|
|
9
|
-
export default {
|
|
10
|
-
desc: "Updates an existing proxy configuration for a fleet",
|
|
11
|
-
command: "update",
|
|
12
|
-
builder: (yargs) => {
|
|
13
|
-
return yargs
|
|
14
|
-
.usage("$0 proxies update --fleet <fleet-id> --configuration-file <file> [options]")
|
|
15
|
-
.option("fleet", {
|
|
16
|
-
type: "string",
|
|
17
|
-
describe: "The fleet ID",
|
|
18
|
-
})
|
|
19
|
-
.option("configuration-file", {
|
|
20
|
-
type: "string",
|
|
21
|
-
describe: "Path to JSON configuration file",
|
|
22
|
-
normalize: true,
|
|
23
|
-
})
|
|
24
|
-
.option("api-key", {
|
|
25
|
-
type: "string",
|
|
26
|
-
describe: "The API Key from Zuplo",
|
|
27
|
-
envVar: "API_KEY",
|
|
28
|
-
alias: "apikey",
|
|
29
|
-
})
|
|
30
|
-
.option("account", {
|
|
31
|
-
type: "string",
|
|
32
|
-
describe: "The account name",
|
|
33
|
-
})
|
|
34
|
-
.demandOption(["fleet", "configuration-file"])
|
|
35
|
-
.demandOption("api-key", "You must provide an API key with --api-key")
|
|
36
|
-
.check((argv) => {
|
|
37
|
-
validateFileExists(argv["configuration-file"], "--configuration-file");
|
|
38
|
-
return true;
|
|
39
|
-
})
|
|
40
|
-
.example([
|
|
41
|
-
[
|
|
42
|
-
"$0 proxies update --fleet fleet_abc123 --configuration-file ./proxy-config.json",
|
|
43
|
-
"Update an existing proxy configuration for a fleet",
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
"$0 proxies update --fleet fleet_abc123 --configuration-file ./updated-config.json --account my-account",
|
|
47
|
-
"Explicitly specify the account",
|
|
48
|
-
],
|
|
49
|
-
])
|
|
50
|
-
.middleware([
|
|
51
|
-
authenticate,
|
|
52
|
-
configure,
|
|
53
|
-
fetchAccount,
|
|
54
|
-
validateFleet,
|
|
55
|
-
identify,
|
|
56
|
-
]);
|
|
57
|
-
},
|
|
58
|
-
handler: async (argv) => {
|
|
59
|
-
await captureEvent({
|
|
60
|
-
argv,
|
|
61
|
-
event: "zuplo proxies update",
|
|
62
|
-
});
|
|
63
|
-
await update(argv);
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cmds/proxies/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAa,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEpE,eAAe;IACb,IAAI,EAAE,qDAAqD;IAC3D,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CACJ,4EAA4E,CAC7E;aACA,MAAM,CAAC,OAAO,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,cAAc;SACzB,CAAC;aACD,MAAM,CAAC,oBAAoB,EAAE;YAC5B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,iCAAiC;YAC3C,SAAS,EAAE,IAAI;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,YAAY,CAAC,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;aAC7C,YAAY,CAAC,SAAS,EAAE,4CAA4C,CAAC;aACrE,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;YACd,kBAAkB,CAChB,IAAI,CAAC,oBAAoB,CAAW,EACpC,sBAAsB,CACvB,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,OAAO,CAAC;YACP;gBACE,iFAAiF;gBACjF,oDAAoD;aACrD;YACD;gBACE,wGAAwG;gBACxG,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC;YACV,YAAY;YACZ,SAAS;YACT,YAAY;YACZ,aAAa;YACb,QAAQ;SACT,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC;YACjB,IAAI;YACJ,KAAK,EAAE,sBAAsB;SAC9B,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,IAAiB,CAAC,CAAC;IAClC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\nimport { validateFleet } from \"../../common/middleware/validate-fleet.js\";\nimport { validateFileExists } from \"../../common/validators/argument-validators.js\";\nimport { Arguments, update } from \"../../proxies/update/handler.js\";\n\nexport default {\n desc: \"Updates an existing proxy configuration for a fleet\",\n command: \"update\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\n \"$0 proxies update --fleet <fleet-id> --configuration-file <file> [options]\"\n )\n .option(\"fleet\", {\n type: \"string\",\n describe: \"The fleet ID\",\n })\n .option(\"configuration-file\", {\n type: \"string\",\n describe: \"Path to JSON configuration file\",\n normalize: true,\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .demandOption([\"fleet\", \"configuration-file\"])\n .demandOption(\"api-key\", \"You must provide an API key with --api-key\")\n .check((argv) => {\n validateFileExists(\n argv[\"configuration-file\"] as string,\n \"--configuration-file\"\n );\n return true;\n })\n .example([\n [\n \"$0 proxies update --fleet fleet_abc123 --configuration-file ./proxy-config.json\",\n \"Update an existing proxy configuration for a fleet\",\n ],\n [\n \"$0 proxies update --fleet fleet_abc123 --configuration-file ./updated-config.json --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([\n authenticate,\n configure,\n fetchAccount,\n validateFleet,\n identify,\n ]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({\n argv,\n event: \"zuplo proxies update\",\n });\n await update(argv as Arguments);\n },\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-fleet.d.ts","sourceRoot":"","sources":["../../../src/common/middleware/validate-fleet.ts"],"names":[],"mappings":"AAUA,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,iBAuEnE"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { logger } from "../logger.js";
|
|
2
|
-
import { printDiagnosticsToConsole, textOrJson } from "../output.js";
|
|
3
|
-
import settings from "../settings.js";
|
|
4
|
-
export async function validateFleet(argv) {
|
|
5
|
-
const account = argv.account;
|
|
6
|
-
const fleet = argv.fleet;
|
|
7
|
-
const authToken = argv.authToken;
|
|
8
|
-
if (!account || typeof account !== "string") {
|
|
9
|
-
logger.error("Missing or invalid required parameter: account");
|
|
10
|
-
printDiagnosticsToConsole("Error: Missing required parameter 'account'.");
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
if (!fleet || typeof fleet !== "string") {
|
|
14
|
-
logger.error("Missing or invalid required parameter: fleet");
|
|
15
|
-
printDiagnosticsToConsole("Error: Missing required parameter 'fleet'.");
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const fleetResponse = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/fleets/${fleet}`, {
|
|
20
|
-
method: "GET",
|
|
21
|
-
headers: {
|
|
22
|
-
Authorization: `Bearer ${authToken}`,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
if (fleetResponse.ok) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (fleetResponse.status === 404) {
|
|
29
|
-
const response = textOrJson(await fleetResponse.text());
|
|
30
|
-
logger.error({
|
|
31
|
-
status: fleetResponse.status,
|
|
32
|
-
statusText: fleetResponse.statusText,
|
|
33
|
-
response,
|
|
34
|
-
}, "Fleet does not exist");
|
|
35
|
-
printDiagnosticsToConsole(`Error: Fleet '${fleet}' does not exist for account '${account}'.`);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
const response = textOrJson(await fleetResponse.text());
|
|
39
|
-
logger.error({
|
|
40
|
-
status: fleetResponse.status,
|
|
41
|
-
statusText: fleetResponse.statusText,
|
|
42
|
-
response,
|
|
43
|
-
}, "Failed to validate fleet existence");
|
|
44
|
-
printDiagnosticsToConsole("Error: Failed to validate fleet existence. Check your authentication and permissions.", response);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
logger.error({ error }, "Network error while validating fleet");
|
|
49
|
-
printDiagnosticsToConsole("Error: Network error while validating fleet existence.");
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=validate-fleet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-fleet.js","sourceRoot":"","sources":["../../../src/common/middleware/validate-fleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAgC;IAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;IACnC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAmB,CAAC;IAE3C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,yBAAyB,CAAC,8CAA8C,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC7D,yBAAyB,CAAC,4CAA4C,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,MAAM,KAAK,CAC/B,GAAG,QAAQ,CAAC,4BAA4B,gBAAgB,OAAO,WAAW,KAAK,EAAE,EACjF;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBAEP,aAAa,EAAE,UAAU,SAAS,EAAE;aACrC;SACF,CACF,CAAC;QAEF,IAAI,aAAa,CAAC,EAAE,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,aAAa,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;YACxD,MAAM,CAAC,KAAK,CACV;gBACE,MAAM,EAAE,aAAa,CAAC,MAAM;gBAC5B,UAAU,EAAE,aAAa,CAAC,UAAU;gBACpC,QAAQ;aACT,EACD,sBAAsB,CACvB,CAAC;YACF,yBAAyB,CACvB,iBAAiB,KAAK,iCAAiC,OAAO,IAAI,CACnE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAGD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CACV;YACE,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,UAAU,EAAE,aAAa,CAAC,UAAU;YACpC,QAAQ;SACT,EACD,oCAAoC,CACrC,CAAC;QACF,yBAAyB,CACvB,uFAAuF,EACvF,QAAQ,CACT,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,sCAAsC,CAAC,CAAC;QAChE,yBAAyB,CACvB,wDAAwD,CACzD,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { logger } from \"../logger.js\";\nimport { printDiagnosticsToConsole, textOrJson } from \"../output.js\";\nimport settings from \"../settings.js\";\n\n/**\n * Middleware that validates a fleet exists for the given account.\n *\n * NOTE: This middleware MUST come after the authenticate middleware\n * because it needs the authToken to make API calls.\n */\nexport async function validateFleet(argv: { [key: string]: unknown }) {\n const account = argv.account as string;\n const fleet = argv.fleet as string;\n const authToken = argv.authToken as string;\n\n if (!account || typeof account !== \"string\") {\n logger.error(\"Missing or invalid required parameter: account\");\n printDiagnosticsToConsole(\"Error: Missing required parameter 'account'.\");\n process.exit(1);\n }\n\n if (!fleet || typeof fleet !== \"string\") {\n logger.error(\"Missing or invalid required parameter: fleet\");\n printDiagnosticsToConsole(\"Error: Missing required parameter 'fleet'.\");\n process.exit(1);\n }\n\n try {\n const fleetResponse = await fetch(\n `${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/fleets/${fleet}`,\n {\n method: \"GET\",\n headers: {\n // biome-ignore lint/style/useNamingConvention: External API property\n Authorization: `Bearer ${authToken}`,\n },\n }\n );\n\n if (fleetResponse.ok) {\n return;\n }\n\n if (fleetResponse.status === 404) {\n const response = textOrJson(await fleetResponse.text());\n logger.error(\n {\n status: fleetResponse.status,\n statusText: fleetResponse.statusText,\n response,\n },\n \"Fleet does not exist\"\n );\n printDiagnosticsToConsole(\n `Error: Fleet '${fleet}' does not exist for account '${account}'.`\n );\n process.exit(1);\n }\n\n // Handle other errors (401, 403, 500, etc.)\n const response = textOrJson(await fleetResponse.text());\n logger.error(\n {\n status: fleetResponse.status,\n statusText: fleetResponse.statusText,\n response,\n },\n \"Failed to validate fleet existence\"\n );\n printDiagnosticsToConsole(\n \"Error: Failed to validate fleet existence. Check your authentication and permissions.\",\n response\n );\n process.exit(1);\n } catch (error) {\n logger.error({ error }, \"Network error while validating fleet\");\n printDiagnosticsToConsole(\n \"Error: Network error while validating fleet existence.\"\n );\n process.exit(1);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/proxies/create/handler.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAiC3C"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { createApiClient } from "../../common/api/client.js";
|
|
3
|
-
import { logger } from "../../common/logger.js";
|
|
4
|
-
import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../common/output.js";
|
|
5
|
-
export async function create(argv) {
|
|
6
|
-
const { account, fleet } = argv;
|
|
7
|
-
let configData;
|
|
8
|
-
try {
|
|
9
|
-
const fileContent = readFileSync(argv["configuration-file"], "utf-8");
|
|
10
|
-
configData = JSON.parse(fileContent);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
logger.error({ error }, `Failed to read or parse configuration file: ${argv["configuration-file"]}`);
|
|
14
|
-
printDiagnosticsToConsole(`Error: Failed to read or parse configuration file: ${argv["configuration-file"]}`);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
const client = createApiClient({ authToken: argv.authToken });
|
|
18
|
-
await client.put(`/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`, {
|
|
19
|
-
operation: "Failed to create proxy configuration",
|
|
20
|
-
errorMessage: "Error: Failed to create proxy configuration. Check the arguments and configuration file.",
|
|
21
|
-
body: configData,
|
|
22
|
-
emptyResponse: true,
|
|
23
|
-
});
|
|
24
|
-
await printResultToConsoleAndExitGracefully(`Successfully created proxy configuration for fleet ${fleet}`);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/proxies/create/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAShC,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC,IAAI,UAAmB,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CACV,EAAE,KAAK,EAAE,EACT,+CAA+C,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAC5E,CAAC;QACF,yBAAyB,CACvB,sDAAsD,IAAI,CAAC,oBAAoB,CAAC,EAAE,CACnF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,CAAC,GAAG,CACd,gBAAgB,OAAO,WAAW,KAAK,sBAAsB,EAC7D;QACE,SAAS,EAAE,sCAAsC;QACjD,YAAY,EACV,0FAA0F;QAC5F,IAAI,EAAE,UAAU;QAChB,aAAa,EAAE,IAAI;KACpB,CACF,CAAC;IAEF,MAAM,qCAAqC,CACzC,sDAAsD,KAAK,EAAE,CAC9D,CAAC;AACJ,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { createApiClient } from \"../../common/api/client.js\";\nimport { logger } from \"../../common/logger.js\";\nimport {\n printDiagnosticsToConsole,\n printResultToConsoleAndExitGracefully,\n} from \"../../common/output.js\";\n\nexport interface Arguments {\n account: string;\n fleet: string;\n \"configuration-file\": string;\n authToken: string;\n}\n\nexport async function create(argv: Arguments) {\n const { account, fleet } = argv;\n\n let configData: unknown;\n try {\n const fileContent = readFileSync(argv[\"configuration-file\"], \"utf-8\");\n configData = JSON.parse(fileContent);\n } catch (error) {\n logger.error(\n { error },\n `Failed to read or parse configuration file: ${argv[\"configuration-file\"]}`\n );\n printDiagnosticsToConsole(\n `Error: Failed to read or parse configuration file: ${argv[\"configuration-file\"]}`\n );\n process.exit(1);\n }\n\n const client = createApiClient({ authToken: argv.authToken });\n await client.put(\n `/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`,\n {\n operation: \"Failed to create proxy configuration\",\n errorMessage:\n \"Error: Failed to create proxy configuration. Check the arguments and configuration file.\",\n body: configData,\n emptyResponse: true,\n }\n );\n\n await printResultToConsoleAndExitGracefully(\n `Successfully created proxy configuration for fleet ${fleet}`\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/proxies/delete/handler.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,SAAS,iBAiB7D"}
|