@corsair-dev/cli 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +247 -27
- package/dist/src/commands/cloud/list.command.d.ts +9 -0
- package/dist/src/commands/cloud/list.command.d.ts.map +1 -0
- package/dist/src/commands/cloud/pull.command.d.ts +9 -0
- package/dist/src/commands/cloud/pull.command.d.ts.map +1 -0
- package/dist/src/commands/cloud.command.d.ts +9 -0
- package/dist/src/commands/cloud.command.d.ts.map +1 -0
- package/dist/src/commands/http.command.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/cloud/client.d.ts +13 -0
- package/dist/src/lib/cloud/client.d.ts.map +1 -0
- package/dist/src/lib/cloud/op-tree.d.ts +5 -0
- package/dist/src/lib/cloud/op-tree.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1915,14 +1915,14 @@ function writeAuthState(sessionId, state) {
|
|
|
1915
1915
|
fs3.writeFileSync(authStateFile(sessionId), JSON.stringify(state));
|
|
1916
1916
|
}
|
|
1917
1917
|
function pollAuthState(sessionId, timeoutMs) {
|
|
1918
|
-
return new Promise((
|
|
1918
|
+
return new Promise((resolve2, reject) => {
|
|
1919
1919
|
const file = authStateFile(sessionId);
|
|
1920
1920
|
const start = Date.now();
|
|
1921
1921
|
const interval = setInterval(() => {
|
|
1922
1922
|
try {
|
|
1923
1923
|
const state = JSON.parse(fs3.readFileSync(file, "utf8"));
|
|
1924
1924
|
clearInterval(interval);
|
|
1925
|
-
|
|
1925
|
+
resolve2(state);
|
|
1926
1926
|
} catch {
|
|
1927
1927
|
if (Date.now() - start > timeoutMs) {
|
|
1928
1928
|
clearInterval(interval);
|
|
@@ -1947,21 +1947,21 @@ function getCustomAccountFields(plugin, authType) {
|
|
|
1947
1947
|
return authConfig?.[authType]?.account ?? [];
|
|
1948
1948
|
}
|
|
1949
1949
|
function findFreePort() {
|
|
1950
|
-
return new Promise((
|
|
1950
|
+
return new Promise((resolve2, reject) => {
|
|
1951
1951
|
const server = net.createServer();
|
|
1952
1952
|
server.listen(0, "127.0.0.1", () => {
|
|
1953
1953
|
const address = server.address();
|
|
1954
1954
|
const port = typeof address === "object" && address ? address.port : 0;
|
|
1955
1955
|
server.close((err) => {
|
|
1956
1956
|
if (err) reject(err);
|
|
1957
|
-
else
|
|
1957
|
+
else resolve2(port);
|
|
1958
1958
|
});
|
|
1959
1959
|
});
|
|
1960
1960
|
server.on("error", reject);
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
1963
|
function waitForOAuthCode(port) {
|
|
1964
|
-
return new Promise((
|
|
1964
|
+
return new Promise((resolve2, reject) => {
|
|
1965
1965
|
const server = http.createServer((req, res) => {
|
|
1966
1966
|
const url = new URL(req.url ?? "/", `http://localhost:${port}`);
|
|
1967
1967
|
const code = url.searchParams.get("code");
|
|
@@ -1981,7 +1981,7 @@ function waitForOAuthCode(port) {
|
|
|
1981
1981
|
"<html><body><h2>Authorization successful!</h2><p>You can close this tab and return to the terminal.</p></body></html>"
|
|
1982
1982
|
);
|
|
1983
1983
|
server.close();
|
|
1984
|
-
|
|
1984
|
+
resolve2(code);
|
|
1985
1985
|
} else {
|
|
1986
1986
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
1987
1987
|
res.end(
|
|
@@ -2486,7 +2486,7 @@ import { fileURLToPath } from "url";
|
|
|
2486
2486
|
import { Command } from "commander";
|
|
2487
2487
|
|
|
2488
2488
|
// package.json
|
|
2489
|
-
var version = "0.1.
|
|
2489
|
+
var version = "0.1.24";
|
|
2490
2490
|
|
|
2491
2491
|
// src/utils/subscription.ts
|
|
2492
2492
|
async function runWebhookSubscription(cwd, pluginId) {
|
|
@@ -2639,6 +2639,219 @@ var AuthCommand = class extends BaseCommand {
|
|
|
2639
2639
|
}
|
|
2640
2640
|
};
|
|
2641
2641
|
|
|
2642
|
+
// src/lib/cloud/client.ts
|
|
2643
|
+
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
|
|
2644
|
+
function assertSecureCloudUrl(url) {
|
|
2645
|
+
let parsed;
|
|
2646
|
+
try {
|
|
2647
|
+
parsed = new URL(url);
|
|
2648
|
+
} catch {
|
|
2649
|
+
throw new Error(`Corsair Cloud URL is not a valid URL: "${url}"`);
|
|
2650
|
+
}
|
|
2651
|
+
if (parsed.search || parsed.hash) {
|
|
2652
|
+
throw new Error(
|
|
2653
|
+
`Corsair Cloud URL must not contain a query or fragment (got "${url}").`
|
|
2654
|
+
);
|
|
2655
|
+
}
|
|
2656
|
+
if (parsed.protocol === "https:") return;
|
|
2657
|
+
if (parsed.protocol === "http:" && LOOPBACK_HOSTS.has(parsed.hostname)) {
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
throw new Error(
|
|
2661
|
+
`Corsair Cloud URL must use https:// (got "${url}") \u2014 http:// is only allowed for localhost/127.0.0.1.`
|
|
2662
|
+
);
|
|
2663
|
+
}
|
|
2664
|
+
function cloudUrlFromKey(key) {
|
|
2665
|
+
if (!key.startsWith("ck_cloud_")) return null;
|
|
2666
|
+
const rest = key.slice("ck_cloud_".length);
|
|
2667
|
+
const sep = rest.indexOf(".");
|
|
2668
|
+
if (sep <= 0) return null;
|
|
2669
|
+
const slug = rest.slice(0, sep);
|
|
2670
|
+
if (!/^[a-z0-9]+$/.test(slug)) return null;
|
|
2671
|
+
return `https://api.corsair.cloud/${slug}/api/corsair`;
|
|
2672
|
+
}
|
|
2673
|
+
function resolveCloudConfig(options) {
|
|
2674
|
+
const key = (options.key || process.env.CORSAIR_CLOUD_KEY || "").trim();
|
|
2675
|
+
if (!key) {
|
|
2676
|
+
throw new Error(
|
|
2677
|
+
"Corsair Cloud key required \u2014 pass --key or set CORSAIR_CLOUD_KEY."
|
|
2678
|
+
);
|
|
2679
|
+
}
|
|
2680
|
+
const url = (options.url || process.env.CORSAIR_CLOUD_URL || cloudUrlFromKey(key) || "").trim().replace(/\/+$/, "");
|
|
2681
|
+
if (!url) {
|
|
2682
|
+
throw new Error(
|
|
2683
|
+
"Corsair Cloud URL required \u2014 pass a ck_cloud_<slug>.<secret> key, or --url / CORSAIR_CLOUD_URL."
|
|
2684
|
+
);
|
|
2685
|
+
}
|
|
2686
|
+
assertSecureCloudUrl(url);
|
|
2687
|
+
return { url, key };
|
|
2688
|
+
}
|
|
2689
|
+
async function fetchCloudOpTree(config) {
|
|
2690
|
+
const res = await fetch(`${config.url}/call`, {
|
|
2691
|
+
headers: { authorization: `Bearer ${config.key}` }
|
|
2692
|
+
});
|
|
2693
|
+
if (!res.ok) {
|
|
2694
|
+
throw new Error(
|
|
2695
|
+
`Corsair Cloud discovery failed: ${res.status} ${res.statusText}`
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
const body = await res.json();
|
|
2699
|
+
return body.plugins ?? {};
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
// src/lib/cloud/op-tree.ts
|
|
2703
|
+
function makeNode() {
|
|
2704
|
+
return { call: false, children: /* @__PURE__ */ Object.create(null) };
|
|
2705
|
+
}
|
|
2706
|
+
function insertOp(root, op) {
|
|
2707
|
+
const parts = op.split(".");
|
|
2708
|
+
let children = root;
|
|
2709
|
+
parts.forEach((part, i) => {
|
|
2710
|
+
const node = children[part] ??= makeNode();
|
|
2711
|
+
if (i === parts.length - 1) {
|
|
2712
|
+
node.call = true;
|
|
2713
|
+
} else {
|
|
2714
|
+
children = node.children;
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
}
|
|
2718
|
+
function buildOpTree(ops) {
|
|
2719
|
+
const root = /* @__PURE__ */ Object.create(null);
|
|
2720
|
+
for (const op of ops) insertOp(root, op);
|
|
2721
|
+
return root;
|
|
2722
|
+
}
|
|
2723
|
+
function renderFields(tree, indent) {
|
|
2724
|
+
return Object.entries(tree).map(([key, node]) => {
|
|
2725
|
+
const name = JSON.stringify(key);
|
|
2726
|
+
const hasChildren = Object.keys(node.children).length > 0;
|
|
2727
|
+
if (node.call && !hasChildren) {
|
|
2728
|
+
return `${indent}${name}(args?: any): Promise<any>;`;
|
|
2729
|
+
}
|
|
2730
|
+
const body = `{
|
|
2731
|
+
${renderFields(node.children, `${indent} `)}
|
|
2732
|
+
${indent}}`;
|
|
2733
|
+
if (!node.call) return `${indent}${name}: ${body};`;
|
|
2734
|
+
return `${indent}${name}: ((args?: any) => Promise<any>) & ${body};`;
|
|
2735
|
+
}).join("\n");
|
|
2736
|
+
}
|
|
2737
|
+
function formatOpTree(pluginsOps) {
|
|
2738
|
+
return Object.entries(pluginsOps).map(
|
|
2739
|
+
([plugin, ops]) => `${plugin}
|
|
2740
|
+
${ops.map((op) => ` ${op}`).join("\n")}`
|
|
2741
|
+
).join("\n");
|
|
2742
|
+
}
|
|
2743
|
+
function buildCloudDeclaration(pluginsOps, moduleSpecifier) {
|
|
2744
|
+
const pluginFields = Object.entries(pluginsOps).map(([plugin, ops]) => {
|
|
2745
|
+
const tree = buildOpTree(ops);
|
|
2746
|
+
return ` ${JSON.stringify(plugin)}: {
|
|
2747
|
+
${renderFields(tree, " ")}
|
|
2748
|
+
};`;
|
|
2749
|
+
}).join("\n");
|
|
2750
|
+
return [
|
|
2751
|
+
`import "${moduleSpecifier}";`,
|
|
2752
|
+
`declare module "${moduleSpecifier}" {`,
|
|
2753
|
+
" interface CorsairCloudRegistry {",
|
|
2754
|
+
...pluginFields ? [pluginFields] : [],
|
|
2755
|
+
" }",
|
|
2756
|
+
"}",
|
|
2757
|
+
""
|
|
2758
|
+
].join("\n");
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
// src/commands/cloud/list.command.ts
|
|
2762
|
+
var CloudListCommand = class extends BaseCommand {
|
|
2763
|
+
getName() {
|
|
2764
|
+
return "list";
|
|
2765
|
+
}
|
|
2766
|
+
getDescription() {
|
|
2767
|
+
return "List every op a Corsair Cloud project exposes";
|
|
2768
|
+
}
|
|
2769
|
+
getOptions() {
|
|
2770
|
+
return [
|
|
2771
|
+
{
|
|
2772
|
+
short: "-u",
|
|
2773
|
+
long: "--url <url>",
|
|
2774
|
+
description: "Corsair Cloud base URL"
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
short: "-k",
|
|
2778
|
+
long: "--key <key>",
|
|
2779
|
+
description: "Corsair Cloud project key"
|
|
2780
|
+
}
|
|
2781
|
+
];
|
|
2782
|
+
}
|
|
2783
|
+
async action({ options }) {
|
|
2784
|
+
const config = resolveCloudConfig(options);
|
|
2785
|
+
const tree = await fetchCloudOpTree(config);
|
|
2786
|
+
console.log(formatOpTree(tree));
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
|
|
2790
|
+
// src/commands/cloud/pull.command.ts
|
|
2791
|
+
import { writeFileSync as writeFileSync2 } from "fs";
|
|
2792
|
+
import { resolve } from "path";
|
|
2793
|
+
var REGISTRY_MODULE_SPECIFIER = "corsair";
|
|
2794
|
+
var CloudPullCommand = class extends BaseCommand {
|
|
2795
|
+
getName() {
|
|
2796
|
+
return "pull";
|
|
2797
|
+
}
|
|
2798
|
+
getDescription() {
|
|
2799
|
+
return "Generate corsair-env.d.ts typing CorsairCloudRegistry from a Corsair Cloud project";
|
|
2800
|
+
}
|
|
2801
|
+
getOptions() {
|
|
2802
|
+
return [
|
|
2803
|
+
{
|
|
2804
|
+
short: "-u",
|
|
2805
|
+
long: "--url <url>",
|
|
2806
|
+
description: "Corsair Cloud base URL"
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
short: "-k",
|
|
2810
|
+
long: "--key <key>",
|
|
2811
|
+
description: "Corsair Cloud project key"
|
|
2812
|
+
},
|
|
2813
|
+
{
|
|
2814
|
+
short: "-o",
|
|
2815
|
+
long: "--out <path>",
|
|
2816
|
+
description: "Output path",
|
|
2817
|
+
defaultValue: "corsair-env.d.ts"
|
|
2818
|
+
}
|
|
2819
|
+
];
|
|
2820
|
+
}
|
|
2821
|
+
async action({ options }) {
|
|
2822
|
+
const config = resolveCloudConfig(options);
|
|
2823
|
+
const tree = await fetchCloudOpTree(config);
|
|
2824
|
+
const declaration = buildCloudDeclaration(tree, REGISTRY_MODULE_SPECIFIER);
|
|
2825
|
+
const outPath = resolve(process.cwd(), options.out ?? "corsair-env.d.ts");
|
|
2826
|
+
writeFileSync2(outPath, declaration);
|
|
2827
|
+
const pluginCount = Object.keys(tree).length;
|
|
2828
|
+
const opCount = Object.values(tree).reduce(
|
|
2829
|
+
(sum, ops) => sum + ops.length,
|
|
2830
|
+
0
|
|
2831
|
+
);
|
|
2832
|
+
console.log(
|
|
2833
|
+
`[#corsair]: Wrote ${outPath} (${pluginCount} plugins, ${opCount} ops).`
|
|
2834
|
+
);
|
|
2835
|
+
}
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
// src/commands/cloud.command.ts
|
|
2839
|
+
var CloudCommand = class extends BaseCommand {
|
|
2840
|
+
getName() {
|
|
2841
|
+
return "cloud";
|
|
2842
|
+
}
|
|
2843
|
+
getDescription() {
|
|
2844
|
+
return "Corsair Cloud: discover and type a hosted project (list, pull)";
|
|
2845
|
+
}
|
|
2846
|
+
getSubCommands() {
|
|
2847
|
+
return [new CloudListCommand(), new CloudPullCommand()];
|
|
2848
|
+
}
|
|
2849
|
+
async action({}) {
|
|
2850
|
+
console.error("[#corsair]: Usage: corsair cloud <list|pull>");
|
|
2851
|
+
process.exit(1);
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2854
|
+
|
|
2642
2855
|
// src/commands/http.command.ts
|
|
2643
2856
|
import { CORSAIR_TUNNEL_PATH } from "corsair/hub";
|
|
2644
2857
|
import { runTunnel } from "corsair/hub/tunnel/run-tunnel";
|
|
@@ -2711,26 +2924,32 @@ var HttpCommand = class extends BaseCommand {
|
|
|
2711
2924
|
}
|
|
2712
2925
|
console.log(`[corsair]: Opening dev tunnel \u2192 localhost:${port} ...`);
|
|
2713
2926
|
let stop;
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2927
|
+
for (let attempt = 1; ; attempt++) {
|
|
2928
|
+
try {
|
|
2929
|
+
const result = await runTunnel({
|
|
2930
|
+
port,
|
|
2931
|
+
apiUrl: hub.apiUrl,
|
|
2932
|
+
apiKey: hub.projectApiKey,
|
|
2933
|
+
shareHost: process.env.CORSAIR_FRP_HOST
|
|
2934
|
+
});
|
|
2935
|
+
stop = result.stop;
|
|
2936
|
+
console.log(corsairBanner(`${result.url}${CORSAIR_TUNNEL_PATH}`));
|
|
2937
|
+
console.log(" Press Ctrl+C to stop.\n");
|
|
2938
|
+
break;
|
|
2939
|
+
} catch (err) {
|
|
2940
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2941
|
+
if (/already exists|still held/i.test(message) && attempt < 3) {
|
|
2942
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
2943
|
+
continue;
|
|
2944
|
+
}
|
|
2945
|
+
console.error(`[corsair]: Tunnel failed \u2014 ${message}`);
|
|
2946
|
+
process.exit(1);
|
|
2947
|
+
}
|
|
2729
2948
|
}
|
|
2730
|
-
await new Promise((
|
|
2949
|
+
await new Promise((resolve2) => {
|
|
2731
2950
|
const shutdown = () => {
|
|
2732
2951
|
stop();
|
|
2733
|
-
|
|
2952
|
+
resolve2();
|
|
2734
2953
|
};
|
|
2735
2954
|
process.once("SIGINT", shutdown);
|
|
2736
2955
|
process.once("SIGTERM", shutdown);
|
|
@@ -3142,8 +3361,8 @@ var StudioCommand = class extends BaseCommand {
|
|
|
3142
3361
|
throw error;
|
|
3143
3362
|
}
|
|
3144
3363
|
await startStudio({ cwd, port, open: options.open });
|
|
3145
|
-
await new Promise((
|
|
3146
|
-
const shutdown = () =>
|
|
3364
|
+
await new Promise((resolve2) => {
|
|
3365
|
+
const shutdown = () => resolve2();
|
|
3147
3366
|
process.once("SIGINT", shutdown);
|
|
3148
3367
|
process.once("SIGTERM", shutdown);
|
|
3149
3368
|
});
|
|
@@ -3303,7 +3522,8 @@ function createProgram() {
|
|
|
3303
3522
|
new SchemaCommand(),
|
|
3304
3523
|
new ScriptCommand(),
|
|
3305
3524
|
new StudioCommand(),
|
|
3306
|
-
new HttpCommand()
|
|
3525
|
+
new HttpCommand(),
|
|
3526
|
+
new CloudCommand()
|
|
3307
3527
|
];
|
|
3308
3528
|
COMMANDS.forEach((command) => {
|
|
3309
3529
|
command.prepare(program);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandActionData, CommandOption } from '../../index.types';
|
|
2
|
+
import BaseCommand from '../base.command';
|
|
3
|
+
export default class CloudListCommand extends BaseCommand {
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDescription(): string;
|
|
6
|
+
getOptions(): CommandOption[];
|
|
7
|
+
action({ options }: CommandActionData): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=list.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/cloud/list.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACxD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,UAAU,IAAI,aAAa,EAAE;IAevB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB;CAK3C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandActionData, CommandOption } from '../../index.types';
|
|
2
|
+
import BaseCommand from '../base.command';
|
|
3
|
+
export default class CloudPullCommand extends BaseCommand {
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDescription(): string;
|
|
6
|
+
getOptions(): CommandOption[];
|
|
7
|
+
action({ options }: CommandActionData): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=pull.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/cloud/pull.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACxD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,UAAU,IAAI,aAAa,EAAE;IAqBvB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB;CAiB3C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandActionData } from '../index.types';
|
|
2
|
+
import BaseCommand from './base.command';
|
|
3
|
+
export default class CloudCommand extends BaseCommand {
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDescription(): string;
|
|
6
|
+
getSubCommands(): BaseCommand[];
|
|
7
|
+
action({}: CommandActionData): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=cloud.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud.command.d.ts","sourceRoot":"","sources":["../../../src/commands/cloud.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAIzC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACpD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,cAAc,IAAI,WAAW,EAAE;IAIzB,MAAM,CAAC,EAAE,EAAE,iBAAiB;CAIlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.command.d.ts","sourceRoot":"","sources":["../../../src/commands/http.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IACnD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,YAAY,IAAI,eAAe,EAAE;IAS3B,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"http.command.d.ts","sourceRoot":"","sources":["../../../src/commands/http.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IACnD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,YAAY,IAAI,eAAe,EAAE;IAS3B,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAoExD"}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,OAAO,EACN,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,0BAA0B,CAAC;AAGlC,iBAAS,aAAa,IAAI,OAAO,CA2BhC;AA8BD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CloudConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
key: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CloudOpTree {
|
|
6
|
+
[plugin: string]: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveCloudConfig(options: {
|
|
9
|
+
url?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
}): CloudConfig;
|
|
12
|
+
export declare function fetchCloudOpTree(config: CloudConfig): Promise<CloudOpTree>;
|
|
13
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/cloud/client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,WAAW;IAC3B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AA0CD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GAAG,WAAW,CAsBd;AAED,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,WAAW,GACjB,OAAO,CAAC,WAAW,CAAC,CAWtB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Op-tree → a human-readable listing: plugin, then its ops indented. */
|
|
2
|
+
export declare function formatOpTree(pluginsOps: Record<string, string[]>): string;
|
|
3
|
+
/** Op-tree → `.d.ts` text merging CorsairCloudRegistry via declaration merging. */
|
|
4
|
+
export declare function buildCloudDeclaration(pluginsOps: Record<string, string[]>, moduleSpecifier: string): string;
|
|
5
|
+
//# sourceMappingURL=op-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-tree.d.ts","sourceRoot":"","sources":["../../../../src/lib/cloud/op-tree.ts"],"names":[],"mappings":"AA8CA,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAMzE;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACpC,eAAe,EAAE,MAAM,GACrB,MAAM,CAgBR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsair-dev/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "Command-line tool for Corsair, the open-source integration layer. Scaffold a project, add integrations, and run your app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"c12": "^3.3.3",
|
|
25
25
|
"commander": "^14.0.3",
|
|
26
26
|
"zod": "^4.1.13",
|
|
27
|
-
"corsair": "0.1.
|
|
27
|
+
"corsair": "0.1.137"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/jest": "^29.5.14",
|