@corsair-dev/cli 0.1.14 → 0.1.15
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/auth.d.ts.map +1 -1
- package/dist/index.js +18 -5
- package/package.json +2 -2
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AA4pBA,wBAAsB,OAAO,CAAC,EAC7B,GAAG,EACH,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,eAAuB,EACpC,MAAM,EAAE,UAAkB,EAC1B,OAAO,EAAE,WAAmB,EAC5B,SAAS,GACT,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgJhB"}
|
package/dist/index.js
CHANGED
|
@@ -2505,14 +2505,26 @@ function parseAuthArgs(args) {
|
|
|
2505
2505
|
}
|
|
2506
2506
|
function parseSetupArgs(args) {
|
|
2507
2507
|
let backfill = false;
|
|
2508
|
+
let tenantId;
|
|
2508
2509
|
const credentials = {};
|
|
2509
2510
|
let currentPlugin = null;
|
|
2510
|
-
for (
|
|
2511
|
+
for (let i = 0; i < args.length; i++) {
|
|
2512
|
+
const arg = args[i];
|
|
2511
2513
|
if (arg === "--backfill" || arg === "-backfill") {
|
|
2512
2514
|
backfill = true;
|
|
2513
2515
|
currentPlugin = null;
|
|
2514
2516
|
continue;
|
|
2515
2517
|
}
|
|
2518
|
+
if (arg === "--tenant" && args[i + 1]) {
|
|
2519
|
+
tenantId = args[++i];
|
|
2520
|
+
currentPlugin = null;
|
|
2521
|
+
continue;
|
|
2522
|
+
}
|
|
2523
|
+
if (arg.startsWith("--tenant=")) {
|
|
2524
|
+
tenantId = arg.slice("--tenant=".length);
|
|
2525
|
+
currentPlugin = null;
|
|
2526
|
+
continue;
|
|
2527
|
+
}
|
|
2516
2528
|
if (arg.startsWith("--plugin=")) {
|
|
2517
2529
|
currentPlugin = arg.slice("--plugin=".length);
|
|
2518
2530
|
if (!credentials[currentPlugin]) credentials[currentPlugin] = {};
|
|
@@ -2528,7 +2540,7 @@ function parseSetupArgs(args) {
|
|
|
2528
2540
|
credentials[currentPlugin][field] = value;
|
|
2529
2541
|
}
|
|
2530
2542
|
}
|
|
2531
|
-
return { backfill, credentials };
|
|
2543
|
+
return { backfill, tenantId, credentials };
|
|
2532
2544
|
}
|
|
2533
2545
|
function parseRunArgs(args) {
|
|
2534
2546
|
let endpointPath;
|
|
@@ -2600,8 +2612,8 @@ function printHelp() {
|
|
|
2600
2612
|
const lines = [
|
|
2601
2613
|
"Corsair CLI",
|
|
2602
2614
|
"",
|
|
2603
|
-
"pnpm corsair setup
|
|
2604
|
-
"pnpm corsair setup --plugin=<id> <field>=VALUE Set plugin credentials",
|
|
2615
|
+
"pnpm corsair setup [--tenant=<id>] Init (add -backfill to seed data)",
|
|
2616
|
+
"pnpm corsair setup [--tenant=<id>] --plugin=<id> <field>=VALUE Set plugin credentials",
|
|
2605
2617
|
"pnpm corsair auth --plugin=<id> Start OAuth flow",
|
|
2606
2618
|
"pnpm corsair auth --plugin=<id> --code=<code> Exchange OAuth code for tokens",
|
|
2607
2619
|
"pnpm corsair auth --plugin=<id> --credentials Show credential status",
|
|
@@ -2624,11 +2636,12 @@ async function main() {
|
|
|
2624
2636
|
const args = process.argv.slice(2);
|
|
2625
2637
|
const command = args[0];
|
|
2626
2638
|
if (command === "setup") {
|
|
2627
|
-
const { backfill, credentials } = parseSetupArgs(args.slice(1));
|
|
2639
|
+
const { backfill, tenantId, credentials } = parseSetupArgs(args.slice(1));
|
|
2628
2640
|
const { setupCorsair } = await import("corsair/setup");
|
|
2629
2641
|
const instance = await getCorsairInstance({ cwd });
|
|
2630
2642
|
await setupCorsair(instance, {
|
|
2631
2643
|
backfill,
|
|
2644
|
+
tenantId,
|
|
2632
2645
|
credentials,
|
|
2633
2646
|
caller: "cli"
|
|
2634
2647
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsair-dev/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@clack/prompts": "^1.0.0",
|
|
24
24
|
"c12": "^3.3.3",
|
|
25
25
|
"zod": "^3.25.76",
|
|
26
|
-
"corsair": "0.1.
|
|
26
|
+
"corsair": "0.1.67"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/jest": "^29.5.14",
|