@dosu/cli 0.33.2 → 0.34.0
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/bin/dosu.js +49 -47
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4748,7 +4748,7 @@ var init_dist4 = __esm(() => {
|
|
|
4748
4748
|
function getVersionString() {
|
|
4749
4749
|
return `v${VERSION}`;
|
|
4750
4750
|
}
|
|
4751
|
-
var VERSION = "0.
|
|
4751
|
+
var VERSION = "0.34.0", INSTALL_CHANNEL = "npm";
|
|
4752
4752
|
|
|
4753
4753
|
// src/debug/logger.ts
|
|
4754
4754
|
import {
|
|
@@ -15242,46 +15242,62 @@ function requireConfig6() {
|
|
|
15242
15242
|
}
|
|
15243
15243
|
return cfg;
|
|
15244
15244
|
}
|
|
15245
|
-
var
|
|
15246
|
-
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
"gitlab-pat",
|
|
15251
|
-
|
|
15252
|
-
|
|
15245
|
+
var NANGO_PROBES = {
|
|
15246
|
+
gitlab: [
|
|
15247
|
+
{ provider: "gitlab", providerConfigKey: "gitlab" },
|
|
15248
|
+
{ provider: "gitlab", providerConfigKey: "gitlab-pat" }
|
|
15249
|
+
],
|
|
15250
|
+
"gitlab-pat": [{ provider: "gitlab", providerConfigKey: "gitlab-pat" }],
|
|
15251
|
+
confluence: [
|
|
15252
|
+
{ provider: "confluence", providerConfigKey: "confluence" },
|
|
15253
|
+
{ provider: "confluence", providerConfigKey: "confluence-basic" }
|
|
15254
|
+
],
|
|
15255
|
+
"confluence-basic": [{ provider: "confluence", providerConfigKey: "confluence-basic" }],
|
|
15256
|
+
notion: [{ provider: "notion", providerConfigKey: "notion" }],
|
|
15257
|
+
coda: [{ provider: "coda", providerConfigKey: "coda" }],
|
|
15258
|
+
azure_devops: [
|
|
15259
|
+
{ provider: "microsoft-entra-id", providerConfigKey: "microsoft-entra-id" },
|
|
15260
|
+
{ provider: "azure_devops", providerConfigKey: "azure-devops" }
|
|
15261
|
+
]
|
|
15262
|
+
};
|
|
15253
15263
|
var DISPLAY_PLATFORMS = [
|
|
15254
15264
|
"github",
|
|
15255
15265
|
"gitlab",
|
|
15266
|
+
"azure_devops",
|
|
15256
15267
|
"slack",
|
|
15257
15268
|
"confluence",
|
|
15258
15269
|
"notion",
|
|
15259
15270
|
"coda",
|
|
15260
15271
|
"teams"
|
|
15261
15272
|
];
|
|
15273
|
+
async function probeConnection(client, orgId, platform4) {
|
|
15274
|
+
const probes = NANGO_PROBES[platform4];
|
|
15275
|
+
if (!probes) {
|
|
15276
|
+
return { queryable: false, connected: false, connection: null };
|
|
15277
|
+
}
|
|
15278
|
+
for (const probe of probes) {
|
|
15279
|
+
try {
|
|
15280
|
+
const conn = await client.nango.getConnection.query({
|
|
15281
|
+
provider: probe.provider,
|
|
15282
|
+
providerConfigKey: probe.providerConfigKey,
|
|
15283
|
+
orgId
|
|
15284
|
+
});
|
|
15285
|
+
if (conn != null) {
|
|
15286
|
+
return { queryable: true, connected: true, connection: conn };
|
|
15287
|
+
}
|
|
15288
|
+
} catch {}
|
|
15289
|
+
}
|
|
15290
|
+
return { queryable: true, connected: false, connection: null };
|
|
15291
|
+
}
|
|
15262
15292
|
function integrationsCommand() {
|
|
15263
15293
|
const cmd = new Command("integrations").description("Manage integrations");
|
|
15264
15294
|
cmd.command("list").description("List all integrations and their connection status").option("--json", "Output as JSON").action(async (opts) => {
|
|
15265
15295
|
const cfg = requireConfig6();
|
|
15266
15296
|
const client = createTypedClient(cfg);
|
|
15267
|
-
const results =
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
try {
|
|
15272
|
-
const conn = await client.nango.getConnection.query({
|
|
15273
|
-
provider: nangoProvider,
|
|
15274
|
-
providerConfigKey: nangoProvider,
|
|
15275
|
-
orgId: cfg.active_account.target.org_id
|
|
15276
|
-
});
|
|
15277
|
-
results.push({ platform: platform4, connected: conn !== null });
|
|
15278
|
-
} catch {
|
|
15279
|
-
results.push({ platform: platform4, connected: false });
|
|
15280
|
-
}
|
|
15281
|
-
} else {
|
|
15282
|
-
results.push({ platform: platform4, connected: false });
|
|
15283
|
-
}
|
|
15284
|
-
}
|
|
15297
|
+
const results = await Promise.all(DISPLAY_PLATFORMS.map(async (platform4) => {
|
|
15298
|
+
const { connected } = await probeConnection(client, cfg.active_account.target.org_id, platform4);
|
|
15299
|
+
return { platform: platform4, connected };
|
|
15300
|
+
}));
|
|
15285
15301
|
if (opts.json) {
|
|
15286
15302
|
printResult(results, opts);
|
|
15287
15303
|
return;
|
|
@@ -15294,8 +15310,8 @@ function integrationsCommand() {
|
|
|
15294
15310
|
cmd.command("status").description("Check connection status of a specific platform").argument("<platform>", `Platform: ${DISPLAY_PLATFORMS.join(", ")}`).option("--json", "Output as JSON").action(async (platform4, opts) => {
|
|
15295
15311
|
const cfg = requireConfig6();
|
|
15296
15312
|
const client = createTypedClient(cfg);
|
|
15297
|
-
const
|
|
15298
|
-
if (!
|
|
15313
|
+
const { queryable, connected, connection } = await probeConnection(client, cfg.active_account.target.org_id, platform4);
|
|
15314
|
+
if (!queryable) {
|
|
15299
15315
|
if (opts.json) {
|
|
15300
15316
|
printResult({ platform: platform4, connected: false, note: "not queryable via nango" }, opts);
|
|
15301
15317
|
return;
|
|
@@ -15303,25 +15319,11 @@ function integrationsCommand() {
|
|
|
15303
15319
|
console.log(`${platform4}: ${import_picocolors15.default.dim("not connected (not queryable)")}`);
|
|
15304
15320
|
return;
|
|
15305
15321
|
}
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
providerConfigKey: nangoProvider,
|
|
15310
|
-
orgId: cfg.active_account.target.org_id
|
|
15311
|
-
});
|
|
15312
|
-
const connected = conn !== null;
|
|
15313
|
-
if (opts.json) {
|
|
15314
|
-
printResult({ platform: platform4, connected, connection: conn }, opts);
|
|
15315
|
-
return;
|
|
15316
|
-
}
|
|
15317
|
-
console.log(`${platform4}: ${connected ? import_picocolors15.default.green("connected") : import_picocolors15.default.dim("not connected")}`);
|
|
15318
|
-
} catch {
|
|
15319
|
-
if (opts.json) {
|
|
15320
|
-
printResult({ platform: platform4, connected: false }, opts);
|
|
15321
|
-
return;
|
|
15322
|
-
}
|
|
15323
|
-
console.log(`${platform4}: ${import_picocolors15.default.dim("not connected")}`);
|
|
15322
|
+
if (opts.json) {
|
|
15323
|
+
printResult({ platform: platform4, connected, connection }, opts);
|
|
15324
|
+
return;
|
|
15324
15325
|
}
|
|
15326
|
+
console.log(`${platform4}: ${connected ? import_picocolors15.default.green("connected") : import_picocolors15.default.dim("not connected")}`);
|
|
15325
15327
|
});
|
|
15326
15328
|
cmd.command("slack-channels").description("List Slack channels").option("--json", "Output as JSON").action(async (opts) => {
|
|
15327
15329
|
const cfg = requireConfig6();
|