@zuplo/cli 7.15.30 → 7.15.33
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/@hono/node-server/dist/index.cjs +5 -2
- package/node_modules/@hono/node-server/dist/index.mjs +5 -2
- package/node_modules/@hono/node-server/package.json +1 -1
- 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/out/esm/{chunk-C4ZTXG6P.js → chunk-552QIZSP.js} +86 -86
- package/node_modules/@zuplo/runtime/out/esm/chunk-552QIZSP.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +15 -3
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +13 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/fast-copy/README.md +34 -34
- package/node_modules/fast-copy/dist/cjs/index.cjs +72 -24
- package/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -1
- package/node_modules/fast-copy/dist/es/index.mjs +72 -24
- package/node_modules/fast-copy/dist/es/index.mjs.map +1 -1
- package/node_modules/fast-copy/dist/umd/index.js +72 -24
- package/node_modules/fast-copy/dist/umd/index.js.map +1 -1
- package/node_modules/fast-copy/package.json +13 -13
- 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/node_modules/@zuplo/runtime/out/esm/chunk-C4ZTXG6P.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-C4ZTXG6P.js.LEGAL.txt → chunk-552QIZSP.js.LEGAL.txt} +0 -0
|
@@ -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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
-
import { printResultToConsoleAndExitGracefully } from "../../common/output.js";
|
|
3
|
-
export async function deleteProxyConfiguration(argv) {
|
|
4
|
-
const { account, fleet } = argv;
|
|
5
|
-
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
-
await client.delete(`/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`, {
|
|
7
|
-
operation: "Failed to delete proxy configuration",
|
|
8
|
-
errorMessage: "Error: Failed to delete proxy configuration. Check the arguments.",
|
|
9
|
-
emptyResponse: true,
|
|
10
|
-
});
|
|
11
|
-
await printResultToConsoleAndExitGracefully(`Proxy configuration for fleet ${fleet} deleted successfully.`);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/proxies/delete/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAQ/E,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAe;IAC5D,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,CAAC,MAAM,CACjB,gBAAgB,OAAO,WAAW,KAAK,sBAAsB,EAC7D;QACE,SAAS,EAAE,sCAAsC;QACjD,YAAY,EACV,mEAAmE;QACrE,aAAa,EAAE,IAAI;KACpB,CACF,CAAC;IAEF,MAAM,qCAAqC,CACzC,iCAAiC,KAAK,wBAAwB,CAC/D,CAAC;AACJ,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../../common/output.js\";\n\nexport interface Arguments {\n account: string;\n fleet: string;\n authToken: string;\n}\n\nexport async function deleteProxyConfiguration(argv: Arguments) {\n const { account, fleet } = argv;\n\n const client = createApiClient({ authToken: argv.authToken });\n await client.delete(\n `/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`,\n {\n operation: \"Failed to delete proxy configuration\",\n errorMessage:\n \"Error: Failed to delete proxy configuration. Check the arguments.\",\n emptyResponse: true,\n }\n );\n\n await printResultToConsoleAndExitGracefully(\n `Proxy configuration for fleet ${fleet} deleted successfully.`\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/proxies/describe/handler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,iBAgB7C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
-
import { printResultToConsoleAndExitGracefully } from "../../common/output.js";
|
|
3
|
-
export async function describe(argv) {
|
|
4
|
-
const { account, fleet } = argv;
|
|
5
|
-
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
-
const proxyConfig = await client.get(`/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`, {
|
|
7
|
-
operation: "Failed to describe proxy configuration",
|
|
8
|
-
errorMessage: "Error: Failed to describe proxy configuration. Check the arguments.",
|
|
9
|
-
});
|
|
10
|
-
await printResultToConsoleAndExitGracefully(JSON.stringify(proxyConfig, null, 2));
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/proxies/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAS/E,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAe;IAC5C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,GAAG,CAClC,gBAAgB,OAAO,WAAW,KAAK,sBAAsB,EAC7D;QACE,SAAS,EAAE,wCAAwC;QACnD,YAAY,EACV,qEAAqE;KACxE,CACF,CAAC;IAEF,MAAM,qCAAqC,CACzC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CACrC,CAAC;AACJ,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { ProxyConfigurationResponse } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n fleet: string;\n authToken: string;\n}\n\nexport async function describe(argv: Arguments) {\n const { account, fleet } = argv;\n\n const client = createApiClient({ authToken: argv.authToken });\n const proxyConfig = await client.get<ProxyConfigurationResponse>(\n `/v1/accounts/${account}/fleets/${fleet}/proxy-configuration`,\n {\n operation: \"Failed to describe proxy configuration\",\n errorMessage:\n \"Error: Failed to describe proxy configuration. Check the arguments.\",\n }\n );\n\n await printResultToConsoleAndExitGracefully(\n JSON.stringify(proxyConfig, null, 2)\n );\n}\n"]}
|
package/dist/proxies/models.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/proxies/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE5D,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,CAAC"}
|
package/dist/proxies/models.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/proxies/models.ts"],"names":[],"mappings":"","sourcesContent":["export type ProxyConfiguration = Record<string, unknown>;\n\nexport type ProxyConfigurationResponse = ProxyConfiguration;\n\nexport type ProxyConfigurationRequest = ProxyConfiguration;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/proxies/update/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 update(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 update proxy configuration",
|
|
20
|
-
errorMessage: "Error: Failed to update proxy configuration. Check the arguments and configuration file.",
|
|
21
|
-
body: configData,
|
|
22
|
-
emptyResponse: true,
|
|
23
|
-
});
|
|
24
|
-
await printResultToConsoleAndExitGracefully(`Successfully updated proxy configuration for fleet ${fleet}`);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/proxies/update/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 update(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 update proxy configuration\",\n errorMessage:\n \"Error: Failed to update proxy configuration. Check the arguments and configuration file.\",\n body: configData,\n emptyResponse: true,\n }\n );\n\n await printResultToConsoleAndExitGracefully(\n `Successfully updated proxy configuration for fleet ${fleet}`\n );\n}\n"]}
|