@zuplo/cli 6.69.5 → 6.69.6
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/__tests__/integration/custom-domain.integration.test.js +4 -4
- package/dist/__tests__/integration/custom-domain.integration.test.js.map +1 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +1 -0
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/__tests__/integration/list.integration.test.js +2 -2
- package/dist/__tests__/integration/list.integration.test.js.map +1 -1
- package/dist/__tests__/integration/tunnel.integration.test.js +14 -14
- package/dist/__tests__/integration/tunnel.integration.test.js.map +1 -1
- package/dist/__tests__/integration/variable.integration.test.js +4 -4
- package/dist/__tests__/integration/variable.integration.test.js.map +1 -1
- package/dist/__tests__/integration/whoami.integration.test.js +2 -5
- package/dist/__tests__/integration/whoami.integration.test.js.map +1 -1
- package/dist/cli.js +12 -6
- package/dist/cli.js.map +1 -1
- package/dist/common/api/client.d.ts +40 -0
- package/dist/common/api/client.d.ts.map +1 -0
- package/dist/common/api/client.js +92 -0
- package/dist/common/api/client.js.map +1 -0
- package/dist/common/output.d.ts +4 -0
- package/dist/common/output.d.ts.map +1 -1
- package/dist/common/output.js +4 -1
- package/dist/common/output.js.map +1 -1
- package/dist/custom-domain/create/handler.d.ts.map +1 -1
- package/dist/custom-domain/create/handler.js +12 -27
- package/dist/custom-domain/create/handler.js.map +1 -1
- package/dist/custom-domain/delete/handler.d.ts.map +1 -1
- package/dist/custom-domain/delete/handler.js +25 -54
- package/dist/custom-domain/delete/handler.js.map +1 -1
- package/dist/custom-domain/list/handler.d.ts.map +1 -1
- package/dist/custom-domain/list/handler.js +15 -29
- package/dist/custom-domain/list/handler.js.map +1 -1
- package/dist/custom-domain/update/handler.d.ts.map +1 -1
- package/dist/custom-domain/update/handler.js +12 -27
- package/dist/custom-domain/update/handler.js.map +1 -1
- package/dist/list/handler.d.ts.map +1 -1
- package/dist/list/handler.js +41 -59
- package/dist/list/handler.js.map +1 -1
- package/dist/mtls-certificates/create/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/create/handler.js +9 -23
- package/dist/mtls-certificates/create/handler.js.map +1 -1
- package/dist/mtls-certificates/delete/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/delete/handler.js +8 -20
- package/dist/mtls-certificates/delete/handler.js.map +1 -1
- package/dist/mtls-certificates/describe/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/describe/handler.js +17 -31
- package/dist/mtls-certificates/describe/handler.js.map +1 -1
- package/dist/mtls-certificates/disable/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/disable/handler.js +9 -26
- package/dist/mtls-certificates/disable/handler.js.map +1 -1
- package/dist/mtls-certificates/list/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/list/handler.js +22 -36
- package/dist/mtls-certificates/list/handler.js.map +1 -1
- package/dist/mtls-certificates/update/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/update/handler.js +14 -29
- package/dist/mtls-certificates/update/handler.js.map +1 -1
- package/dist/proxies/create/handler.d.ts.map +1 -1
- package/dist/proxies/create/handler.js +9 -22
- package/dist/proxies/create/handler.js.map +1 -1
- package/dist/proxies/delete/handler.d.ts.map +1 -1
- package/dist/proxies/delete/handler.js +8 -21
- package/dist/proxies/delete/handler.js.map +1 -1
- package/dist/proxies/describe/handler.d.ts.map +1 -1
- package/dist/proxies/describe/handler.js +7 -22
- package/dist/proxies/describe/handler.js.map +1 -1
- package/dist/proxies/update/handler.d.ts.map +1 -1
- package/dist/proxies/update/handler.js +9 -22
- package/dist/proxies/update/handler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tunnel/create/handler.d.ts.map +1 -1
- package/dist/tunnel/create/handler.js +8 -22
- package/dist/tunnel/create/handler.js.map +1 -1
- package/dist/tunnel/delete/handler.d.ts.map +1 -1
- package/dist/tunnel/delete/handler.js +16 -30
- package/dist/tunnel/delete/handler.js.map +1 -1
- package/dist/tunnel/describe/handler.d.ts.map +1 -1
- package/dist/tunnel/describe/handler.js +7 -21
- package/dist/tunnel/describe/handler.js.map +1 -1
- package/dist/tunnel/list/handler.d.ts.map +1 -1
- package/dist/tunnel/list/handler.js +13 -28
- package/dist/tunnel/list/handler.js.map +1 -1
- package/dist/tunnel/rotate-token/handler.d.ts.map +1 -1
- package/dist/tunnel/rotate-token/handler.js +7 -21
- package/dist/tunnel/rotate-token/handler.js.map +1 -1
- package/dist/tunnel/services/describe/handler.d.ts.map +1 -1
- package/dist/tunnel/services/describe/handler.js +7 -21
- package/dist/tunnel/services/describe/handler.js.map +1 -1
- package/dist/tunnel/services/update/handler.d.ts.map +1 -1
- package/dist/tunnel/services/update/handler.js +18 -32
- package/dist/tunnel/services/update/handler.js.map +1 -1
- package/dist/variable/create/handler.d.ts.map +1 -1
- package/dist/variable/create/handler.js +9 -24
- package/dist/variable/create/handler.js.map +1 -1
- package/dist/variable/update/handler.d.ts.map +1 -1
- package/dist/variable/update/handler.js +9 -24
- package/dist/variable/update/handler.js.map +1 -1
- package/dist/whoami/handler.d.ts.map +1 -1
- package/dist/whoami/handler.js +6 -18
- package/dist/whoami/handler.js.map +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/package.json +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAe;IAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,EAAE,EACtD;QACE,SAAS,EAAE,uCAAuC;QAClD,YAAY,EACV,yEAAyE;KAC5E,CACF,CAAC;IAEF,MAAM,oCAAoC,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printTableToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { Tunnel } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function describe(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.get<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}`,\n {\n operation: \"Failed to describe tunnel for account\",\n errorMessage:\n \"Error: Failed to describe tunnel for your account. Check the arguments.\",\n }\n );\n\n await printTableToConsoleAndExitGracefully(tunnel);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,iBAoBzC"}
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
|
|
4
3
|
export async function list(argv) {
|
|
5
|
-
const { account } =
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
4
|
+
const { account } = argv;
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnels = await client.get(`/v1/accounts/${account}/tunnels`, {
|
|
7
|
+
operation: "Failed to list tunnels for account",
|
|
8
|
+
errorMessage: "Error: Failed to list tunnels for your account. Try again later.",
|
|
11
9
|
});
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
if (tunnels.data.length === 0) {
|
|
15
|
-
const output = "No tunnels found";
|
|
16
|
-
await printResultToConsoleAndExitGracefully(output);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const table = tunnels.data.map((tunnel) => {
|
|
20
|
-
return { "tunnel-id": tunnel.id, name: tunnel.name };
|
|
21
|
-
});
|
|
22
|
-
await printTableToConsoleAndExitGracefully(table);
|
|
23
|
-
}
|
|
10
|
+
if (tunnels.data.length === 0) {
|
|
11
|
+
await printResultToConsoleAndExitGracefully("No tunnels found");
|
|
24
12
|
}
|
|
25
13
|
else {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
response,
|
|
31
|
-
}, "Failed to list tunnels for account");
|
|
32
|
-
printDiagnosticsToConsole("Error: Failed to list tunnels for your account. Try again later.", response);
|
|
14
|
+
const table = tunnels.data.map((tunnel) => {
|
|
15
|
+
return { "tunnel-id": tunnel.id, name: tunnel.name };
|
|
16
|
+
});
|
|
17
|
+
await printTableToConsoleAndExitGracefully(table);
|
|
33
18
|
}
|
|
34
19
|
}
|
|
35
20
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,wBAAwB,CAAC;AAQhC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAe;IACxC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,CAC9B,gBAAgB,OAAO,UAAU,EACjC;QACE,SAAS,EAAE,oCAAoC;QAC/C,YAAY,EACV,kEAAkE;KACrE,CACF,CAAC;IAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,qCAAqC,CAAC,kBAAkB,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACxC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,MAAM,oCAAoC,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport {\n printResultToConsoleAndExitGracefully,\n printTableToConsoleAndExitGracefully,\n} from \"../../common/output.js\";\nimport { TunnelList } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n authToken: string;\n}\n\nexport async function list(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnels = await client.get<TunnelList>(\n `/v1/accounts/${account}/tunnels`,\n {\n operation: \"Failed to list tunnels for account\",\n errorMessage:\n \"Error: Failed to list tunnels for your account. Try again later.\",\n }\n );\n\n if (tunnels.data.length === 0) {\n await printResultToConsoleAndExitGracefully(\"No tunnels found\");\n } else {\n const table = tunnels.data.map((tunnel) => {\n return { \"tunnel-id\": tunnel.id, name: tunnel.name };\n });\n await printTableToConsoleAndExitGracefully(table);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,iBAahD"}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printTableToConsoleAndExitGracefully } from "../../common/output.js";
|
|
4
3
|
export async function rotateToken(argv) {
|
|
5
4
|
const { account } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnel = await client.post(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/$rotate-token`, {
|
|
7
|
+
operation: "Failed to rotate token for tunnel",
|
|
8
|
+
errorMessage: "Error: Failed to rotate token for tunnel. Check the arguments.",
|
|
11
9
|
});
|
|
12
|
-
|
|
13
|
-
const tunnel = await rotateResponse.json();
|
|
14
|
-
await printTableToConsoleAndExitGracefully(tunnel);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const response = textOrJson(await rotateResponse.text());
|
|
18
|
-
logger.error({
|
|
19
|
-
status: rotateResponse.status,
|
|
20
|
-
statusText: rotateResponse.statusText,
|
|
21
|
-
response,
|
|
22
|
-
}, "Failed to rotate token for tunnel");
|
|
23
|
-
printDiagnosticsToConsole("Error: Failed to rotate token for tunnel. Check the arguments.", response);
|
|
24
|
-
}
|
|
10
|
+
await printTableToConsoleAndExitGracefully(tunnel);
|
|
25
11
|
}
|
|
26
12
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAe;IAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAC9B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,gBAAgB,EACpE;QACE,SAAS,EAAE,mCAAmC;QAC9C,YAAY,EACV,gEAAgE;KACnE,CACF,CAAC;IAEF,MAAM,oCAAoC,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printTableToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { Tunnel } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function rotateToken(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.post<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/$rotate-token`,\n {\n operation: \"Failed to rotate token for tunnel\",\n errorMessage:\n \"Error: Failed to rotate token for tunnel. Check the arguments.\",\n }\n );\n\n await printTableToConsoleAndExitGracefully(tunnel);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,iBAa7C"}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully } from "../../../common/output.js";
|
|
4
3
|
export async function describe(argv) {
|
|
5
4
|
const { account } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnel = await client.get(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/services-configuration`, {
|
|
7
|
+
operation: "Failed to describe services for tunnel",
|
|
8
|
+
errorMessage: "Error: Failed to describe the services for your tunnel. Check the arguments.",
|
|
11
9
|
});
|
|
12
|
-
|
|
13
|
-
const tunnel = await describeResponse.json();
|
|
14
|
-
await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const response = textOrJson(await describeResponse.text());
|
|
18
|
-
logger.error({
|
|
19
|
-
status: describeResponse.status,
|
|
20
|
-
statusText: describeResponse.statusText,
|
|
21
|
-
response,
|
|
22
|
-
}, "Failed to describe services for tunnel");
|
|
23
|
-
printDiagnosticsToConsole("Error: Failed to describe the services for your tunnel. Check the arguments.", response);
|
|
24
|
-
}
|
|
10
|
+
await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
|
|
25
11
|
}
|
|
26
12
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AASlF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAe;IAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAC7E;QACE,SAAS,EAAE,wCAAwC;QACnD,YAAY,EACV,8EAA8E;KACjF,CACF,CAAC;IAEF,MAAM,qCAAqC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { createApiClient } from \"../../../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../../../common/output.js\";\nimport { Tunnel } from \"../../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function describe(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.get<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/services-configuration`,\n {\n operation: \"Failed to describe services for tunnel\",\n errorMessage:\n \"Error: Failed to describe the services for your tunnel. Check the arguments.\",\n }\n );\n\n await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,iBA8CnD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import {
|
|
3
|
-
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully,
|
|
4
|
-
import settings from "../../../common/settings.js";
|
|
2
|
+
import { createApiClient } from "../../../common/api/client.js";
|
|
3
|
+
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../../common/output.js";
|
|
5
4
|
import { pollProvisioningOperation } from "./poll-provisioning-operations.js";
|
|
6
5
|
export async function updateServices(argv) {
|
|
7
6
|
let contents;
|
|
@@ -9,41 +8,28 @@ export async function updateServices(argv) {
|
|
|
9
8
|
contents = await readFile(argv["configuration-file"], "utf-8");
|
|
10
9
|
}
|
|
11
10
|
catch (err) {
|
|
12
|
-
await printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}
|
|
11
|
+
await printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}`);
|
|
12
|
+
return;
|
|
13
13
|
}
|
|
14
14
|
const { account } = argv;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"Content-Type": "application/json",
|
|
20
|
-
},
|
|
15
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
16
|
+
const provisioningOperation = await client.put(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/services-configuration`, {
|
|
17
|
+
operation: "Failed to update tunnel for account",
|
|
18
|
+
errorMessage: "Error: Failed to update the tunnel for your account. Check the arguments.",
|
|
21
19
|
body: contents,
|
|
22
20
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
if (polledProvisioningOperation.status === "success") {
|
|
32
|
-
await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
printDiagnosticsToConsole(polledProvisioningOperation.details);
|
|
36
|
-
await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
|
|
37
|
-
}
|
|
21
|
+
printDiagnosticsToConsole(`Updating services on tunnel ${argv["tunnel-id"]} on account ${account}...`);
|
|
22
|
+
const polledProvisioningOperation = await pollProvisioningOperation({
|
|
23
|
+
argv,
|
|
24
|
+
account,
|
|
25
|
+
provisioningOperationId: provisioningOperation.id,
|
|
26
|
+
});
|
|
27
|
+
if (polledProvisioningOperation.status === "success") {
|
|
28
|
+
await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
|
|
38
29
|
}
|
|
39
30
|
else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
status: deleteResponse.status,
|
|
43
|
-
statusText: deleteResponse.statusText,
|
|
44
|
-
response,
|
|
45
|
-
}, "Failed to update tunnel for account");
|
|
46
|
-
printDiagnosticsToConsole("Error: Failed to update the tunnel for your account. Check the arguments.", response);
|
|
31
|
+
printDiagnosticsToConsole(polledProvisioningOperation.details);
|
|
32
|
+
await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
|
|
47
33
|
}
|
|
48
34
|
}
|
|
49
35
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,oCAAoC,EACpC,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAe;IAElD,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,oCAAoC,CACxC,2CAA2C,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CACxF,CAAC;QACF,OAAO;IACT,CAAC;IAGD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,qBAAqB,GAAG,MAAM,MAAM,CAAC,GAAG,CAC5C,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAC7E;QACE,SAAS,EAAE,qCAAqC;QAChD,YAAY,EACV,2EAA2E;QAC7E,IAAI,EAAE,QAAQ;KACf,CACF,CAAC;IAEF,yBAAyB,CACvB,+BAA+B,IAAI,CAAC,WAAW,CAAC,eAAe,OAAO,KAAK,CAC5E,CAAC;IAGF,MAAM,2BAA2B,GAAG,MAAM,yBAAyB,CAAC;QAClE,IAAI;QACJ,OAAO;QACP,uBAAuB,EAAE,qBAAqB,CAAC,EAAE;KAClD,CAAC,CAAC;IAEH,IAAI,2BAA2B,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,qCAAqC,CACzC,UAAU,IAAI,CAAC,WAAW,CAAC,wBAAwB,CACpD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yBAAyB,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,oCAAoC,CACxC,UAAU,IAAI,CAAC,WAAW,CAAC,wCAAwC,2BAA2B,CAAC,OAAO,EAAE,CACzG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { createApiClient } from \"../../../common/api/client.js\";\nimport {\n printCriticalFailureToConsoleAndExit,\n printDiagnosticsToConsole,\n printResultToConsoleAndExitGracefully,\n} from \"../../../common/output.js\";\nimport { ProvisioningOperation } from \"../../models.js\";\nimport { pollProvisioningOperation } from \"./poll-provisioning-operations.js\";\n\nexport interface Arguments {\n account: string;\n \"configuration-file\": string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function updateServices(argv: Arguments) {\n // 2. Read the configuration file\n let contents: string;\n try {\n contents = await readFile(argv[\"configuration-file\"], \"utf-8\");\n } catch (err) {\n await printCriticalFailureToConsoleAndExit(\n `Error reading the configuration file at ${argv[\"configuration-file\"]}: ${err.message}`\n );\n return;\n }\n\n // 3. Initiate an update for the tunnel\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const provisioningOperation = await client.put<ProvisioningOperation>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/services-configuration`,\n {\n operation: \"Failed to update tunnel for account\",\n errorMessage:\n \"Error: Failed to update the tunnel for your account. Check the arguments.\",\n body: contents,\n }\n );\n\n printDiagnosticsToConsole(\n `Updating services on tunnel ${argv[\"tunnel-id\"]} on account ${account}...`\n );\n\n // 3. Poll for status\n const polledProvisioningOperation = await pollProvisioningOperation({\n argv,\n account,\n provisioningOperationId: provisioningOperation.id,\n });\n\n if (polledProvisioningOperation.status === \"success\") {\n await printResultToConsoleAndExitGracefully(\n `Tunnel ${argv[\"tunnel-id\"]} updated successfully.`\n );\n } else {\n printDiagnosticsToConsole(polledProvisioningOperation.details);\n await printCriticalFailureToConsoleAndExit(\n `Tunnel ${argv[\"tunnel-id\"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAEnD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAmB3C"}
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsole } from "../../common/output.js";
|
|
4
3
|
export async function create(argv) {
|
|
5
4
|
const { account, project } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
body: JSON.stringify({
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const variable = await client.post(`/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(argv["branch"])}/variables`, {
|
|
7
|
+
operation: "Failed to create variable",
|
|
8
|
+
errorMessage: "Error: Failed to create variable. Check the arguments.",
|
|
9
|
+
body: {
|
|
13
10
|
name: argv["name"],
|
|
14
11
|
isSecret: argv["is-secret"],
|
|
15
12
|
value: argv["value"],
|
|
16
|
-
}
|
|
13
|
+
},
|
|
17
14
|
});
|
|
18
|
-
|
|
19
|
-
const variable = await createResponse.json();
|
|
20
|
-
printResultToConsole(`${variable.name} created successfully`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const problem = textOrJson(await createResponse.text());
|
|
24
|
-
logger.error({
|
|
25
|
-
status: createResponse.status,
|
|
26
|
-
statusText: createResponse.statusText,
|
|
27
|
-
response: problem,
|
|
28
|
-
}, "Failed to create variable");
|
|
29
|
-
printDiagnosticsToConsole("Error: Failed to create variable. Check the arguments.", problem);
|
|
30
|
-
}
|
|
15
|
+
printResultToConsole(`${variable.name} created successfully`);
|
|
31
16
|
}
|
|
32
17
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAChC,gBAAgB,OAAO,aAAa,OAAO,aAAa,kBAAkB,CACxE,IAAI,CAAC,QAAQ,CAAC,CACf,YAAY,EACb;QACE,SAAS,EAAE,2BAA2B;QACtC,YAAY,EAAE,wDAAwD;QACtE,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;YAC3B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACrB;KACF,CACF,CAAC;IAEF,oBAAoB,CAAC,GAAG,QAAQ,CAAC,IAAI,uBAAuB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsole } from \"../../common/output.js\";\nimport { Arguments, Variable } from \"../models.js\";\n\nexport async function create(argv: Arguments) {\n const { account, project } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const variable = await client.post<Variable>(\n `/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(\n argv[\"branch\"]\n )}/variables`,\n {\n operation: \"Failed to create variable\",\n errorMessage: \"Error: Failed to create variable. Check the arguments.\",\n body: {\n name: argv[\"name\"],\n isSecret: argv[\"is-secret\"],\n value: argv[\"value\"],\n },\n }\n );\n\n printResultToConsole(`${variable.name} created successfully`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAEnD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAiB3C"}
|
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsole } from "../../common/output.js";
|
|
4
3
|
export async function update(argv) {
|
|
5
4
|
const { account, project } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
body: JSON.stringify({
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const variable = await client.patch(`/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(argv["branch"])}/variables/${encodeURIComponent(argv["name"])}`, {
|
|
7
|
+
operation: "Failed to update variable",
|
|
8
|
+
errorMessage: "Error: Failed to update variable. Check the arguments.",
|
|
9
|
+
body: {
|
|
13
10
|
value: argv["value"],
|
|
14
|
-
}
|
|
11
|
+
},
|
|
15
12
|
});
|
|
16
|
-
|
|
17
|
-
const variable = await updateResponse.json();
|
|
18
|
-
printResultToConsole(`${variable.name} updated successfully`);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const problem = textOrJson(await updateResponse.text());
|
|
22
|
-
logger.error({
|
|
23
|
-
status: updateResponse.status,
|
|
24
|
-
statusText: updateResponse.statusText,
|
|
25
|
-
response: problem,
|
|
26
|
-
}, "Failed to update variable");
|
|
27
|
-
printDiagnosticsToConsole("Error: Failed to update variable. Check the arguments.", problem);
|
|
28
|
-
}
|
|
13
|
+
printResultToConsole(`${variable.name} updated successfully`);
|
|
29
14
|
}
|
|
30
15
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CACjC,gBAAgB,OAAO,aAAa,OAAO,aAAa,kBAAkB,CACxE,IAAI,CAAC,QAAQ,CAAC,CACf,cAAc,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EACjD;QACE,SAAS,EAAE,2BAA2B;QACtC,YAAY,EAAE,wDAAwD;QACtE,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACrB;KACF,CACF,CAAC;IAEF,oBAAoB,CAAC,GAAG,QAAQ,CAAC,IAAI,uBAAuB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsole } from \"../../common/output.js\";\nimport { Arguments, Variable } from \"../models.js\";\n\nexport async function update(argv: Arguments) {\n const { account, project } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const variable = await client.patch<Variable>(\n `/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(\n argv[\"branch\"]\n )}/variables/${encodeURIComponent(argv[\"name\"])}`,\n {\n operation: \"Failed to update variable\",\n errorMessage: \"Error: Failed to update variable. Check the arguments.\",\n body: {\n value: argv[\"value\"],\n },\n }\n );\n\n printResultToConsole(`${variable.name} updated successfully`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAe3C"}
|
package/dist/whoami/handler.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully } from "../common/output.js";
|
|
4
3
|
export async function whoami(argv) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
4
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
5
|
+
const data = await client.get("/v1/who-am-i", {
|
|
6
|
+
operation: "Failed to determine current user",
|
|
7
|
+
errorMessage: "Error: Failed to determine current user. Check your credentials.",
|
|
10
8
|
});
|
|
11
|
-
if (!response.ok) {
|
|
12
|
-
logger.error({
|
|
13
|
-
status: response.status,
|
|
14
|
-
statusText: response.statusText,
|
|
15
|
-
response: textOrJson(await response.text()),
|
|
16
|
-
}, "Failed to determine current user");
|
|
17
|
-
await printCriticalFailureToConsoleAndExit("Error: Failed to determine current user. Check your credentials.");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const data = (await response.json());
|
|
21
9
|
const identity = data.email ? `${data.email} (${data.sub})` : data.sub;
|
|
22
10
|
const lines = [`Authenticated as ${identity}`];
|
|
23
11
|
if (data.account) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAY5E,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAiB,cAAc,EAAE;QAC5D,SAAS,EAAE,kCAAkC;QAC7C,YAAY,EACV,kEAAkE;KACrE,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IACvE,MAAM,KAAK,GAAG,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAC;IAC/C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,qCAAqC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../common/output.js\";\n\nexport interface Arguments {\n authToken: string;\n}\n\ninterface WhoAmIResponse {\n sub: string;\n account?: string;\n email?: string;\n}\n\nexport async function whoami(argv: Arguments) {\n const client = createApiClient({ authToken: argv.authToken });\n const data = await client.get<WhoAmIResponse>(\"/v1/who-am-i\", {\n operation: \"Failed to determine current user\",\n errorMessage:\n \"Error: Failed to determine current user. Check your credentials.\",\n });\n\n const identity = data.email ? `${data.email} (${data.sub})` : data.sub;\n const lines = [`Authenticated as ${identity}`];\n if (data.account) {\n lines.push(`Account: ${data.account}`);\n }\n\n await printResultToConsoleAndExitGracefully(lines.join(\"\\n\"));\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "6.69.
|
|
3
|
+
"version": "6.69.6",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@opentelemetry/api": "1.9.0",
|
|
30
30
|
"@sentry/node": "9.22.0",
|
|
31
31
|
"@swc/core": "1.10.18",
|
|
32
|
-
"@zuplo/core": "6.69.
|
|
32
|
+
"@zuplo/core": "6.69.6",
|
|
33
33
|
"@zuplo/editor": "1.0.20821740935",
|
|
34
|
-
"@zuplo/openapi-tools": "6.69.
|
|
35
|
-
"@zuplo/runtime": "6.69.
|
|
34
|
+
"@zuplo/openapi-tools": "6.69.6",
|
|
35
|
+
"@zuplo/runtime": "6.69.6",
|
|
36
36
|
"chalk": "5.4.1",
|
|
37
37
|
"chokidar": "3.5.3",
|
|
38
38
|
"cookie": "1.0.2",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"workerd": "1.20241230.0",
|
|
67
67
|
"yargs": "17.7.2",
|
|
68
68
|
"zod": "^3.24.1",
|
|
69
|
-
"@zuplo/graphql": "6.69.
|
|
70
|
-
"@zuplo/otel": "6.69.
|
|
69
|
+
"@zuplo/graphql": "6.69.6",
|
|
70
|
+
"@zuplo/otel": "6.69.6"
|
|
71
71
|
},
|
|
72
72
|
"bundleDependencies": [
|
|
73
73
|
"@fastify/cors",
|