@corsair-dev/cli 0.1.18 → 0.1.20
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 +374 -90
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/commands/http.command.d.ts +9 -0
- package/dist/src/commands/http.command.d.ts.map +1 -0
- package/dist/src/commands/onedrive-subscribe.command.d.ts.map +1 -1
- package/dist/src/commands/setup.command.d.ts.map +1 -1
- package/dist/src/commands/subscribe/onedrive.command.d.ts +1 -1
- package/dist/src/commands/subscribe/onedrive.command.d.ts.map +1 -1
- package/dist/src/commands/subscribe.command.d.ts +1 -1
- package/dist/src/commands/subscribe.command.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/banner.d.ts +3 -0
- package/dist/src/lib/banner.d.ts.map +1 -0
- package/dist/src/lib/google/calendar.d.ts +3 -1
- package/dist/src/lib/google/calendar.d.ts.map +1 -1
- package/dist/src/lib/google/drive.d.ts +3 -1
- package/dist/src/lib/google/drive.d.ts.map +1 -1
- package/dist/src/lib/google/gmail.d.ts +3 -1
- package/dist/src/lib/google/gmail.d.ts.map +1 -1
- package/dist/src/lib/google/index.d.ts.map +1 -1
- package/dist/src/lib/microsoft/credentials.d.ts +10 -1
- package/dist/src/lib/microsoft/credentials.d.ts.map +1 -1
- package/dist/src/lib/microsoft/onedrive.d.ts.map +1 -1
- package/dist/src/lib/microsoft/outlook.d.ts.map +1 -1
- package/dist/src/lib/microsoft/sharepoint.d.ts.map +1 -1
- package/dist/src/lib/microsoft/teams.d.ts.map +1 -1
- package/dist/src/lib/tunnel-setup.d.ts +11 -0
- package/dist/src/lib/tunnel-setup.d.ts.map +1 -0
- package/dist/src/utils/corsair-instance.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -135,37 +135,47 @@ async function getCorsairInstance({
|
|
|
135
135
|
shouldThrowOnError = false
|
|
136
136
|
}) {
|
|
137
137
|
const candidatePaths = configPath ? [existsSync(configPath) ? configPath : path2.join(cwd, configPath)] : [...POSSIBLE_PATHS];
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
138
|
+
const priorTunnelFlag = process.env.CORSAIR_TUNNEL;
|
|
139
|
+
process.env.CORSAIR_TUNNEL = "0";
|
|
140
|
+
try {
|
|
141
|
+
for (const candidatePath of candidatePaths) {
|
|
142
|
+
try {
|
|
143
|
+
const { config } = await loadConfig({
|
|
144
|
+
configFile: candidatePath,
|
|
145
|
+
dotenv: true,
|
|
146
|
+
jitiOptions: jitiOptions(cwd),
|
|
147
|
+
cwd
|
|
148
|
+
});
|
|
149
|
+
if ("corsair" in config && isCorsairInstance(config.corsair)) {
|
|
150
|
+
return config.corsair;
|
|
151
|
+
}
|
|
152
|
+
if ("default" in config && isCorsairInstance(config.default)) {
|
|
153
|
+
return config.default;
|
|
154
|
+
}
|
|
155
|
+
if (Object.keys(config).length > 0) {
|
|
156
|
+
fail(
|
|
157
|
+
`Couldn't read your Corsair instance in ${candidatePath}. Export it as 'corsair' or default.`,
|
|
158
|
+
shouldThrowOnError
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
153
162
|
fail(
|
|
154
|
-
`
|
|
163
|
+
`Error loading ${candidatePath}: ${parseLoadError(error)}`,
|
|
155
164
|
shouldThrowOnError
|
|
156
165
|
);
|
|
157
166
|
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
}
|
|
168
|
+
fail(
|
|
169
|
+
"Couldn't find corsair.ts in your project. Add it in root or src/lib/server/app.",
|
|
170
|
+
shouldThrowOnError
|
|
171
|
+
);
|
|
172
|
+
} finally {
|
|
173
|
+
if (priorTunnelFlag === void 0) {
|
|
174
|
+
delete process.env.CORSAIR_TUNNEL;
|
|
175
|
+
} else {
|
|
176
|
+
process.env.CORSAIR_TUNNEL = priorTunnelFlag;
|
|
163
177
|
}
|
|
164
178
|
}
|
|
165
|
-
fail(
|
|
166
|
-
"Couldn't find corsair.ts in your project. Add it in root or src/lib/server/app.",
|
|
167
|
-
shouldThrowOnError
|
|
168
|
-
);
|
|
169
179
|
}
|
|
170
180
|
function resolveClient(instance, tenant) {
|
|
171
181
|
const obj = instance;
|
|
@@ -328,10 +338,12 @@ var init_prompts = __esm({
|
|
|
328
338
|
|
|
329
339
|
// src/lib/microsoft/credentials.ts
|
|
330
340
|
import * as p3 from "@clack/prompts";
|
|
341
|
+
import { setWebhookTenantLink } from "corsair";
|
|
331
342
|
import {
|
|
332
343
|
createAccountKeyManager,
|
|
333
344
|
createIntegrationKeyManager
|
|
334
345
|
} from "corsair/core";
|
|
346
|
+
import { registerHubWebhookTenantLink } from "corsair/hub";
|
|
335
347
|
async function refreshMicrosoftToken(clientId, clientSecret, refreshToken) {
|
|
336
348
|
const response = await fetch(MICROSOFT_TOKEN_URL, {
|
|
337
349
|
method: "POST",
|
|
@@ -430,11 +442,47 @@ async function resolveAccessToken(integrationName, tenantId, internal) {
|
|
|
430
442
|
credSpin.stop("Credentials loaded.");
|
|
431
443
|
return { accessToken, accountKm };
|
|
432
444
|
}
|
|
433
|
-
async function saveWebhookSignature(accountKm, clientState) {
|
|
445
|
+
async function saveWebhookSignature(accountKm, clientState, options) {
|
|
434
446
|
const saveSpin = p3.spinner();
|
|
435
447
|
saveSpin.start("Saving webhook secret...");
|
|
436
448
|
await accountKm.set_webhook_signature(clientState);
|
|
437
449
|
saveSpin.stop("Webhook secret saved.");
|
|
450
|
+
if (options?.internal.database) {
|
|
451
|
+
const linkSpin = p3.spinner();
|
|
452
|
+
linkSpin.start("Saving webhook tenant link...");
|
|
453
|
+
await setWebhookTenantLink({
|
|
454
|
+
database: options.internal.database,
|
|
455
|
+
kek: options.internal.kek,
|
|
456
|
+
pluginId: options.pluginId,
|
|
457
|
+
tenantId: options.tenantId,
|
|
458
|
+
link: { linkType: "client_state", externalId: clientState },
|
|
459
|
+
authType: "oauth_2"
|
|
460
|
+
});
|
|
461
|
+
linkSpin.stop("Webhook tenant link saved.");
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
async function saveSubscriptionTenantLink(options, subscriptionId) {
|
|
465
|
+
const link = {
|
|
466
|
+
linkType: "subscription_id",
|
|
467
|
+
externalId: subscriptionId
|
|
468
|
+
};
|
|
469
|
+
if (options.internal.hub) {
|
|
470
|
+
await registerHubWebhookTenantLink(options.internal.hub, {
|
|
471
|
+
plugin: options.pluginId,
|
|
472
|
+
tenantId: options.tenantId,
|
|
473
|
+
link
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
if (options.internal.database) {
|
|
477
|
+
await setWebhookTenantLink({
|
|
478
|
+
database: options.internal.database,
|
|
479
|
+
kek: options.internal.kek,
|
|
480
|
+
pluginId: options.pluginId,
|
|
481
|
+
tenantId: options.tenantId,
|
|
482
|
+
link,
|
|
483
|
+
authType: "oauth_2"
|
|
484
|
+
});
|
|
485
|
+
}
|
|
438
486
|
}
|
|
439
487
|
var MICROSOFT_TOKEN_URL;
|
|
440
488
|
var init_credentials = __esm({
|
|
@@ -569,6 +617,10 @@ async function runOnedriveSubscribe({
|
|
|
569
617
|
ID: ${subscription.id}
|
|
570
618
|
Expires: ${subscription.expirationDateTime}`
|
|
571
619
|
);
|
|
620
|
+
await saveSubscriptionTenantLink(
|
|
621
|
+
{ pluginId: "onedrive", tenantId, internal },
|
|
622
|
+
subscription.id
|
|
623
|
+
);
|
|
572
624
|
} catch (error) {
|
|
573
625
|
subSpin.stop(`Failed: ${resourceType}`);
|
|
574
626
|
p4.log.error(error instanceof Error ? error.message : String(error));
|
|
@@ -578,7 +630,11 @@ async function runOnedriveSubscribe({
|
|
|
578
630
|
if (results.length > 0) {
|
|
579
631
|
p4.note(results.join("\n\n"), "Subscriptions created");
|
|
580
632
|
}
|
|
581
|
-
await saveWebhookSignature(accountKm, clientState
|
|
633
|
+
await saveWebhookSignature(accountKm, clientState, {
|
|
634
|
+
pluginId: "onedrive",
|
|
635
|
+
tenantId,
|
|
636
|
+
internal
|
|
637
|
+
});
|
|
582
638
|
if (!hasError) {
|
|
583
639
|
p4.log.success("OneDrive webhook subscriptions set up successfully.");
|
|
584
640
|
} else {
|
|
@@ -675,6 +731,10 @@ async function runOutlookSubscribe({
|
|
|
675
731
|
ID: ${subscription.id}
|
|
676
732
|
Expires: ${subscription.expirationDateTime}`
|
|
677
733
|
);
|
|
734
|
+
await saveSubscriptionTenantLink(
|
|
735
|
+
{ pluginId: "outlook", tenantId, internal },
|
|
736
|
+
subscription.id
|
|
737
|
+
);
|
|
678
738
|
} catch (error) {
|
|
679
739
|
subSpin.stop(`Failed: ${cfg.label}`);
|
|
680
740
|
p5.log.error(error instanceof Error ? error.message : String(error));
|
|
@@ -684,7 +744,11 @@ async function runOutlookSubscribe({
|
|
|
684
744
|
if (results.length > 0) {
|
|
685
745
|
p5.note(results.join("\n\n"), "Subscriptions created");
|
|
686
746
|
}
|
|
687
|
-
await saveWebhookSignature(accountKm, clientState
|
|
747
|
+
await saveWebhookSignature(accountKm, clientState, {
|
|
748
|
+
pluginId: "outlook",
|
|
749
|
+
tenantId,
|
|
750
|
+
internal
|
|
751
|
+
});
|
|
688
752
|
if (!hasError) {
|
|
689
753
|
p5.log.success("Outlook webhook subscriptions set up successfully.");
|
|
690
754
|
} else {
|
|
@@ -880,7 +944,15 @@ async function runSharepointSubscribe({
|
|
|
880
944
|
process.exit(1);
|
|
881
945
|
}
|
|
882
946
|
subSpin.stop("Subscription created.");
|
|
883
|
-
await
|
|
947
|
+
await saveSubscriptionTenantLink(
|
|
948
|
+
{ pluginId: sharepointPlugin.id, tenantId, internal },
|
|
949
|
+
subscription.id
|
|
950
|
+
);
|
|
951
|
+
await saveWebhookSignature(accountKm, clientState, {
|
|
952
|
+
pluginId: sharepointPlugin.id,
|
|
953
|
+
tenantId,
|
|
954
|
+
internal
|
|
955
|
+
});
|
|
884
956
|
p6.note(
|
|
885
957
|
`Subscription ID: ${subscription.id}
|
|
886
958
|
Site ID: ${siteId}
|
|
@@ -1160,6 +1232,10 @@ async function runTeamsSubscribe({
|
|
|
1160
1232
|
ID: ${subscription.id}
|
|
1161
1233
|
Expires: ${subscription.expirationDateTime}`
|
|
1162
1234
|
);
|
|
1235
|
+
await saveSubscriptionTenantLink(
|
|
1236
|
+
{ pluginId: "teams", tenantId, internal },
|
|
1237
|
+
subscription.id
|
|
1238
|
+
);
|
|
1163
1239
|
} catch (error) {
|
|
1164
1240
|
subSpin.stop(`Failed: ${resourceType}`);
|
|
1165
1241
|
p7.log.error(error instanceof Error ? error.message : String(error));
|
|
@@ -1169,7 +1245,11 @@ async function runTeamsSubscribe({
|
|
|
1169
1245
|
if (results.length > 0) {
|
|
1170
1246
|
p7.note(results.join("\n\n"), "Subscriptions created");
|
|
1171
1247
|
}
|
|
1172
|
-
await saveWebhookSignature(accountKm, clientState
|
|
1248
|
+
await saveWebhookSignature(accountKm, clientState, {
|
|
1249
|
+
pluginId: "teams",
|
|
1250
|
+
tenantId,
|
|
1251
|
+
internal
|
|
1252
|
+
});
|
|
1173
1253
|
if (!hasError) {
|
|
1174
1254
|
p7.log.success("Teams webhook subscriptions set up successfully.");
|
|
1175
1255
|
} else {
|
|
@@ -1256,6 +1336,7 @@ Resource ID: ${data.resourceId}
|
|
|
1256
1336
|
Expiration: ${new Date(Number(data.expiration)).toISOString()}`,
|
|
1257
1337
|
"Watch Response"
|
|
1258
1338
|
);
|
|
1339
|
+
return { channelId };
|
|
1259
1340
|
}
|
|
1260
1341
|
var CALENDAR_API_BASE;
|
|
1261
1342
|
var init_calendar = __esm({
|
|
@@ -1318,6 +1399,7 @@ Start Page Token: ${startPageTokenData.startPageToken}
|
|
|
1318
1399
|
Expiration: ${new Date(Number(data.expiration)).toISOString()}`,
|
|
1319
1400
|
"Watch Response"
|
|
1320
1401
|
);
|
|
1402
|
+
return { channelId };
|
|
1321
1403
|
}
|
|
1322
1404
|
var DRIVE_API_BASE;
|
|
1323
1405
|
var init_drive = __esm({
|
|
@@ -1352,11 +1434,17 @@ async function setupGmailWatch(accessToken, topicName) {
|
|
|
1352
1434
|
}
|
|
1353
1435
|
const data = await response.json();
|
|
1354
1436
|
watchSpin.stop("Watch started.");
|
|
1437
|
+
const profileResponse = await fetch(`${GMAIL_API_BASE}/users/me/profile`, {
|
|
1438
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
1439
|
+
});
|
|
1440
|
+
const profile = profileResponse.ok ? await profileResponse.json() : null;
|
|
1355
1441
|
p10.note(
|
|
1356
1442
|
`History ID: ${data.historyId}
|
|
1357
|
-
Expiration: ${new Date(Number(data.expiration)).toISOString()}
|
|
1443
|
+
Expiration: ${new Date(Number(data.expiration)).toISOString()}${profile?.emailAddress ? `
|
|
1444
|
+
Email: ${profile.emailAddress}` : ""}`,
|
|
1358
1445
|
"Watch Response"
|
|
1359
1446
|
);
|
|
1447
|
+
return { emailAddress: profile?.emailAddress ?? null };
|
|
1360
1448
|
}
|
|
1361
1449
|
var GMAIL_API_BASE;
|
|
1362
1450
|
var init_gmail = __esm({
|
|
@@ -1539,11 +1627,13 @@ function removeTriggers() {
|
|
|
1539
1627
|
|
|
1540
1628
|
// src/lib/google/index.ts
|
|
1541
1629
|
import * as p12 from "@clack/prompts";
|
|
1630
|
+
import { setWebhookTenantLink as setWebhookTenantLink2 } from "corsair";
|
|
1542
1631
|
import {
|
|
1543
1632
|
CORSAIR_INTERNAL as CORSAIR_INTERNAL2,
|
|
1544
1633
|
createAccountKeyManager as createAccountKeyManager2,
|
|
1545
1634
|
createIntegrationKeyManager as createIntegrationKeyManager2
|
|
1546
1635
|
} from "corsair/core";
|
|
1636
|
+
import { registerHubWebhookTenantLink as registerHubWebhookTenantLink2 } from "corsair/hub";
|
|
1547
1637
|
async function extractInternalConfig2(cwd) {
|
|
1548
1638
|
const instance = await getCorsairInstance({ cwd, shouldThrowOnError: true });
|
|
1549
1639
|
const internal = instance[CORSAIR_INTERNAL2];
|
|
@@ -1655,6 +1745,26 @@ async function runGoogleSubscribe({
|
|
|
1655
1745
|
refreshToken
|
|
1656
1746
|
);
|
|
1657
1747
|
credSpin.stop("Credentials loaded.");
|
|
1748
|
+
const saveGoogleTenantLink = async (link) => {
|
|
1749
|
+
if (internal.hub) {
|
|
1750
|
+
await registerHubWebhookTenantLink2(internal.hub, {
|
|
1751
|
+
plugin: pluginType,
|
|
1752
|
+
tenantId,
|
|
1753
|
+
link
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
await setWebhookTenantLink2({
|
|
1757
|
+
database,
|
|
1758
|
+
kek,
|
|
1759
|
+
pluginId: pluginType,
|
|
1760
|
+
tenantId,
|
|
1761
|
+
link: {
|
|
1762
|
+
linkType: link.linkType,
|
|
1763
|
+
externalId: link.externalId
|
|
1764
|
+
},
|
|
1765
|
+
authType: "oauth_2"
|
|
1766
|
+
});
|
|
1767
|
+
};
|
|
1658
1768
|
if (pluginType === "gmail") {
|
|
1659
1769
|
const topicName = await p12.text({
|
|
1660
1770
|
message: "Enter Pub/Sub topic name:",
|
|
@@ -1667,7 +1777,16 @@ async function runGoogleSubscribe({
|
|
|
1667
1777
|
p12.cancel("Operation cancelled.");
|
|
1668
1778
|
process.exit(0);
|
|
1669
1779
|
}
|
|
1670
|
-
await setupGmailWatch(
|
|
1780
|
+
const gmailWatch = await setupGmailWatch(
|
|
1781
|
+
accessToken,
|
|
1782
|
+
topicName
|
|
1783
|
+
);
|
|
1784
|
+
if (gmailWatch.emailAddress) {
|
|
1785
|
+
await saveGoogleTenantLink({
|
|
1786
|
+
linkType: "email_address",
|
|
1787
|
+
externalId: gmailWatch.emailAddress
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1671
1790
|
} else if (pluginType === "googledrive") {
|
|
1672
1791
|
const webhookUrl = await p12.text({
|
|
1673
1792
|
message: "Enter webhook URL:",
|
|
@@ -1680,7 +1799,14 @@ async function runGoogleSubscribe({
|
|
|
1680
1799
|
p12.cancel("Operation cancelled.");
|
|
1681
1800
|
process.exit(0);
|
|
1682
1801
|
}
|
|
1683
|
-
await setupDriveWatch(
|
|
1802
|
+
const driveWatch = await setupDriveWatch(
|
|
1803
|
+
accessToken,
|
|
1804
|
+
webhookUrl
|
|
1805
|
+
);
|
|
1806
|
+
await saveGoogleTenantLink({
|
|
1807
|
+
linkType: "channel_id",
|
|
1808
|
+
externalId: driveWatch.channelId
|
|
1809
|
+
});
|
|
1684
1810
|
} else if (pluginType === "googlecalendar") {
|
|
1685
1811
|
const webhookUrl = await p12.text({
|
|
1686
1812
|
message: "Enter webhook URL:",
|
|
@@ -1702,11 +1828,15 @@ async function runGoogleSubscribe({
|
|
|
1702
1828
|
p12.cancel("Operation cancelled.");
|
|
1703
1829
|
process.exit(0);
|
|
1704
1830
|
}
|
|
1705
|
-
await setupCalendarWatch(
|
|
1831
|
+
const calendarWatch = await setupCalendarWatch(
|
|
1706
1832
|
accessToken,
|
|
1707
1833
|
webhookUrl,
|
|
1708
1834
|
calendarId
|
|
1709
1835
|
);
|
|
1836
|
+
await saveGoogleTenantLink({
|
|
1837
|
+
linkType: "channel_id",
|
|
1838
|
+
externalId: calendarWatch.channelId
|
|
1839
|
+
});
|
|
1710
1840
|
} else {
|
|
1711
1841
|
p12.log.error(`Unsupported Google plugin: ${pluginType}`);
|
|
1712
1842
|
process.exit(1);
|
|
@@ -1882,6 +2012,7 @@ async function ensureIntegration(database, pluginId, kek) {
|
|
|
1882
2012
|
const encryptedDek = await encryptDEK(dek, kek);
|
|
1883
2013
|
const row = await orm.integrations.create({
|
|
1884
2014
|
name: pluginId,
|
|
2015
|
+
config: {},
|
|
1885
2016
|
dek: encryptedDek
|
|
1886
2017
|
});
|
|
1887
2018
|
return { id: row.id };
|
|
@@ -1898,6 +2029,7 @@ async function ensureAccount(database, integrationId, tenantId, kek) {
|
|
|
1898
2029
|
await orm.accounts.create({
|
|
1899
2030
|
tenant_id: tenantId,
|
|
1900
2031
|
integration_id: integrationId,
|
|
2032
|
+
config: {},
|
|
1901
2033
|
dek: encryptedDek
|
|
1902
2034
|
});
|
|
1903
2035
|
}
|
|
@@ -2354,7 +2486,7 @@ import { fileURLToPath } from "url";
|
|
|
2354
2486
|
import { Command } from "commander";
|
|
2355
2487
|
|
|
2356
2488
|
// package.json
|
|
2357
|
-
var version = "0.1.
|
|
2489
|
+
var version = "0.1.20";
|
|
2358
2490
|
|
|
2359
2491
|
// src/utils/subscription.ts
|
|
2360
2492
|
async function runWebhookSubscription(cwd, pluginId) {
|
|
@@ -2507,6 +2639,105 @@ var AuthCommand = class extends BaseCommand {
|
|
|
2507
2639
|
}
|
|
2508
2640
|
};
|
|
2509
2641
|
|
|
2642
|
+
// src/commands/http.command.ts
|
|
2643
|
+
import { CORSAIR_TUNNEL_PATH } from "corsair/hub";
|
|
2644
|
+
import { runTunnel } from "corsair/hub/tunnel/run-tunnel";
|
|
2645
|
+
|
|
2646
|
+
// src/lib/banner.ts
|
|
2647
|
+
var CORSAIR = [
|
|
2648
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
|
|
2649
|
+
"\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
|
|
2650
|
+
"\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
2651
|
+
"\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
|
|
2652
|
+
"\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
2653
|
+
" \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D"
|
|
2654
|
+
];
|
|
2655
|
+
function corsairBanner(url) {
|
|
2656
|
+
return [
|
|
2657
|
+
"",
|
|
2658
|
+
...CORSAIR,
|
|
2659
|
+
"",
|
|
2660
|
+
" \u{1F389} Your dev tunnel is live!",
|
|
2661
|
+
"",
|
|
2662
|
+
` \u{1F517} ${url}`,
|
|
2663
|
+
"",
|
|
2664
|
+
" The Hub now delivers straight to your local app.",
|
|
2665
|
+
""
|
|
2666
|
+
].join("\n");
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
// src/commands/http.command.ts
|
|
2670
|
+
init_corsair();
|
|
2671
|
+
var HttpCommand = class extends BaseCommand {
|
|
2672
|
+
getName() {
|
|
2673
|
+
return "http";
|
|
2674
|
+
}
|
|
2675
|
+
getDescription() {
|
|
2676
|
+
return "Open a dev tunnel so the Hub can reach your local app";
|
|
2677
|
+
}
|
|
2678
|
+
getArguments() {
|
|
2679
|
+
return [
|
|
2680
|
+
{
|
|
2681
|
+
name: "[port]",
|
|
2682
|
+
description: "Local port to expose (defaults to $PORT)"
|
|
2683
|
+
}
|
|
2684
|
+
];
|
|
2685
|
+
}
|
|
2686
|
+
async action({ args }) {
|
|
2687
|
+
const raw = args[0] ?? process.env.PORT ?? "";
|
|
2688
|
+
const port = Number(raw);
|
|
2689
|
+
if (!/^\d+$/.test(raw) || port < 1 || port > 65535) {
|
|
2690
|
+
console.error(
|
|
2691
|
+
"[corsair]: No valid port. Usage: corsair http [port] (or set PORT)."
|
|
2692
|
+
);
|
|
2693
|
+
process.exit(1);
|
|
2694
|
+
}
|
|
2695
|
+
const cwd = process.cwd();
|
|
2696
|
+
let internal;
|
|
2697
|
+
try {
|
|
2698
|
+
internal = await extractInternalConfig(cwd);
|
|
2699
|
+
} catch (err) {
|
|
2700
|
+
console.error(
|
|
2701
|
+
`[corsair]: ${err instanceof Error ? err.message : String(err)}`
|
|
2702
|
+
);
|
|
2703
|
+
process.exit(1);
|
|
2704
|
+
}
|
|
2705
|
+
const hub = internal.hub;
|
|
2706
|
+
if (!hub) {
|
|
2707
|
+
console.error(
|
|
2708
|
+
"[corsair]: Hub is not configured. Add hub: { projectApiKey, signingSecret } to createCorsair()."
|
|
2709
|
+
);
|
|
2710
|
+
process.exit(1);
|
|
2711
|
+
}
|
|
2712
|
+
console.log(`[corsair]: Opening dev tunnel \u2192 localhost:${port} ...`);
|
|
2713
|
+
let stop;
|
|
2714
|
+
try {
|
|
2715
|
+
const result = await runTunnel({
|
|
2716
|
+
port,
|
|
2717
|
+
apiUrl: hub.apiUrl,
|
|
2718
|
+
apiKey: hub.projectApiKey,
|
|
2719
|
+
shareHost: process.env.CORSAIR_FRP_HOST
|
|
2720
|
+
});
|
|
2721
|
+
stop = result.stop;
|
|
2722
|
+
console.log(corsairBanner(`${result.url}${CORSAIR_TUNNEL_PATH}`));
|
|
2723
|
+
console.log(" Press Ctrl+C to stop.\n");
|
|
2724
|
+
} catch (err) {
|
|
2725
|
+
console.error(
|
|
2726
|
+
`[corsair]: Tunnel failed \u2014 ${err instanceof Error ? err.message : String(err)}`
|
|
2727
|
+
);
|
|
2728
|
+
process.exit(1);
|
|
2729
|
+
}
|
|
2730
|
+
await new Promise((resolve) => {
|
|
2731
|
+
const shutdown = () => {
|
|
2732
|
+
stop();
|
|
2733
|
+
resolve();
|
|
2734
|
+
};
|
|
2735
|
+
process.once("SIGINT", shutdown);
|
|
2736
|
+
process.once("SIGTERM", shutdown);
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
|
|
2510
2741
|
// src/commands/list.command.ts
|
|
2511
2742
|
init_corsair_instance();
|
|
2512
2743
|
import { listOperations } from "corsair";
|
|
@@ -2547,6 +2778,30 @@ var ListCommand = class extends BaseCommand {
|
|
|
2547
2778
|
}
|
|
2548
2779
|
};
|
|
2549
2780
|
|
|
2781
|
+
// src/commands/subscribe/onedrive.command.ts
|
|
2782
|
+
var OnedriveCommand = class extends BaseCommand {
|
|
2783
|
+
getName() {
|
|
2784
|
+
return "onedrive";
|
|
2785
|
+
}
|
|
2786
|
+
getDescription() {
|
|
2787
|
+
return "Subscribe OneDrive webhooks";
|
|
2788
|
+
}
|
|
2789
|
+
async action({}) {
|
|
2790
|
+
const { runOnedriveSubscribe: runOnedriveSubscribe2 } = await Promise.resolve().then(() => (init_subscribe_microsoft(), subscribe_microsoft_exports));
|
|
2791
|
+
await runOnedriveSubscribe2({ cwd: process.cwd() });
|
|
2792
|
+
}
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2795
|
+
// src/commands/onedrive-subscribe.command.ts
|
|
2796
|
+
var OnedriveSubscribeCommand = class extends OnedriveCommand {
|
|
2797
|
+
getName() {
|
|
2798
|
+
return "onedrive-subscribe";
|
|
2799
|
+
}
|
|
2800
|
+
getDescription() {
|
|
2801
|
+
return "Subscribe OneDrive webhooks";
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
|
|
2550
2805
|
// src/commands/schema.command.ts
|
|
2551
2806
|
init_corsair_instance();
|
|
2552
2807
|
import { getSchema } from "corsair";
|
|
@@ -2693,6 +2948,52 @@ function getSetupRawArgs(argv = process.argv) {
|
|
|
2693
2948
|
return setupIdx >= 0 ? argv.slice(setupIdx + 1) : [];
|
|
2694
2949
|
}
|
|
2695
2950
|
|
|
2951
|
+
// src/lib/tunnel-setup.ts
|
|
2952
|
+
import {
|
|
2953
|
+
CORSAIR_TUNNEL_PATH as CORSAIR_TUNNEL_PATH2,
|
|
2954
|
+
CORSAIR_TUNNEL_ZONE,
|
|
2955
|
+
resolveFrpcBinary
|
|
2956
|
+
} from "corsair/hub";
|
|
2957
|
+
async function enrollDevTunnel(opts) {
|
|
2958
|
+
const { apiUrl, projectApiKey } = opts;
|
|
2959
|
+
if (!projectApiKey.startsWith("ck_dev_")) return;
|
|
2960
|
+
try {
|
|
2961
|
+
resolveFrpcBinary();
|
|
2962
|
+
} catch {
|
|
2963
|
+
console.log(
|
|
2964
|
+
[
|
|
2965
|
+
"[corsair] the bundled frpc tunnel binary is missing \u2014 reinstall corsair:",
|
|
2966
|
+
" macOS / Linux / Windows: npm i corsair (or pnpm add / yarn add)",
|
|
2967
|
+
" pnpm (skips install scripts): pnpm approve-builds corsair, then reinstall",
|
|
2968
|
+
" offline or locked registry: set CORSAIR_FRP_BIN to an frpc path",
|
|
2969
|
+
" frpc binaries (any platform): https://github.com/fatedier/frp/releases"
|
|
2970
|
+
].join("\n")
|
|
2971
|
+
);
|
|
2972
|
+
return;
|
|
2973
|
+
}
|
|
2974
|
+
const res = await fetch(
|
|
2975
|
+
`${apiUrl.replace(/\/$/, "")}/api/dev/tunnel-config`,
|
|
2976
|
+
{
|
|
2977
|
+
headers: { authorization: `Bearer ${projectApiKey}` },
|
|
2978
|
+
signal: AbortSignal.timeout(15e3)
|
|
2979
|
+
}
|
|
2980
|
+
).catch(() => null);
|
|
2981
|
+
if (!res || !res.ok) {
|
|
2982
|
+
console.log(
|
|
2983
|
+
`[corsair] tunnel setup skipped (Hub ${res ? res.status : "unreachable"}).`
|
|
2984
|
+
);
|
|
2985
|
+
return;
|
|
2986
|
+
}
|
|
2987
|
+
const body = await res.json().catch(() => null);
|
|
2988
|
+
const slug = body?.slug;
|
|
2989
|
+
if (!slug || !/^[a-z0-9-]+$/.test(slug)) {
|
|
2990
|
+
console.error("[corsair] Hub returned an invalid tunnel slug.");
|
|
2991
|
+
return;
|
|
2992
|
+
}
|
|
2993
|
+
const zone = process.env.CORSAIR_FRP_HOST ?? CORSAIR_TUNNEL_ZONE;
|
|
2994
|
+
console.log(corsairBanner(`https://${slug}.${zone}${CORSAIR_TUNNEL_PATH2}`));
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2696
2997
|
// src/commands/setup.command.ts
|
|
2697
2998
|
init_corsair();
|
|
2698
2999
|
init_corsair_instance();
|
|
@@ -2749,6 +3050,12 @@ var SetupCommand = class extends BaseCommand {
|
|
|
2749
3050
|
credentials,
|
|
2750
3051
|
caller: "cli"
|
|
2751
3052
|
});
|
|
3053
|
+
if (internal.hub) {
|
|
3054
|
+
await enrollDevTunnel({
|
|
3055
|
+
apiUrl: internal.hub.apiUrl,
|
|
3056
|
+
projectApiKey: internal.hub.projectApiKey
|
|
3057
|
+
});
|
|
3058
|
+
}
|
|
2752
3059
|
}
|
|
2753
3060
|
hasLegacyBackfillFlag() {
|
|
2754
3061
|
const setupIdx = process.argv.indexOf("setup");
|
|
@@ -2757,6 +3064,30 @@ var SetupCommand = class extends BaseCommand {
|
|
|
2757
3064
|
}
|
|
2758
3065
|
};
|
|
2759
3066
|
|
|
3067
|
+
// src/commands/subscribe/sharepoint.command.ts
|
|
3068
|
+
init_sharepoint();
|
|
3069
|
+
var SharepointCommand = class extends BaseCommand {
|
|
3070
|
+
getName() {
|
|
3071
|
+
return "sharepoint";
|
|
3072
|
+
}
|
|
3073
|
+
getDescription() {
|
|
3074
|
+
return "Subscribe SharePoint webhooks";
|
|
3075
|
+
}
|
|
3076
|
+
async action({}) {
|
|
3077
|
+
await runSharepointSubscribe({ cwd: process.cwd() });
|
|
3078
|
+
}
|
|
3079
|
+
};
|
|
3080
|
+
|
|
3081
|
+
// src/commands/sharepoint-subscribe.command.ts
|
|
3082
|
+
var SharepointSubscribeCommand = class extends SharepointCommand {
|
|
3083
|
+
getName() {
|
|
3084
|
+
return "sharepoint-subscribe";
|
|
3085
|
+
}
|
|
3086
|
+
getDescription() {
|
|
3087
|
+
return "Subscribe SharePoint webhooks";
|
|
3088
|
+
}
|
|
3089
|
+
};
|
|
3090
|
+
|
|
2760
3091
|
// src/commands/studio.command.ts
|
|
2761
3092
|
import path4 from "path";
|
|
2762
3093
|
var StudioCommand = class extends BaseCommand {
|
|
@@ -2819,34 +3150,6 @@ var StudioCommand = class extends BaseCommand {
|
|
|
2819
3150
|
}
|
|
2820
3151
|
};
|
|
2821
3152
|
|
|
2822
|
-
// src/commands/subscribe/teams.command.ts
|
|
2823
|
-
var TeamsCommand = class extends BaseCommand {
|
|
2824
|
-
getName() {
|
|
2825
|
-
return "teams";
|
|
2826
|
-
}
|
|
2827
|
-
getDescription() {
|
|
2828
|
-
return "Subscribe Teams webhooks";
|
|
2829
|
-
}
|
|
2830
|
-
async action({}) {
|
|
2831
|
-
const { runTeamsSubscribe: runTeamsSubscribe2 } = await Promise.resolve().then(() => (init_subscribe_microsoft(), subscribe_microsoft_exports));
|
|
2832
|
-
await runTeamsSubscribe2({ cwd: process.cwd() });
|
|
2833
|
-
}
|
|
2834
|
-
};
|
|
2835
|
-
|
|
2836
|
-
// src/commands/subscribe/sharepoint.command.ts
|
|
2837
|
-
init_sharepoint();
|
|
2838
|
-
var SharepointCommand = class extends BaseCommand {
|
|
2839
|
-
getName() {
|
|
2840
|
-
return "sharepoint";
|
|
2841
|
-
}
|
|
2842
|
-
getDescription() {
|
|
2843
|
-
return "Subscribe SharePoint webhooks";
|
|
2844
|
-
}
|
|
2845
|
-
async action({}) {
|
|
2846
|
-
await runSharepointSubscribe({ cwd: process.cwd() });
|
|
2847
|
-
}
|
|
2848
|
-
};
|
|
2849
|
-
|
|
2850
3153
|
// src/commands/subscribe/outlook.command.ts
|
|
2851
3154
|
init_subscribe_microsoft();
|
|
2852
3155
|
var OutlookCommand = class extends BaseCommand {
|
|
@@ -2861,17 +3164,17 @@ var OutlookCommand = class extends BaseCommand {
|
|
|
2861
3164
|
}
|
|
2862
3165
|
};
|
|
2863
3166
|
|
|
2864
|
-
// src/commands/subscribe/
|
|
2865
|
-
var
|
|
3167
|
+
// src/commands/subscribe/teams.command.ts
|
|
3168
|
+
var TeamsCommand = class extends BaseCommand {
|
|
2866
3169
|
getName() {
|
|
2867
|
-
return "
|
|
3170
|
+
return "teams";
|
|
2868
3171
|
}
|
|
2869
3172
|
getDescription() {
|
|
2870
|
-
return "Subscribe
|
|
3173
|
+
return "Subscribe Teams webhooks";
|
|
2871
3174
|
}
|
|
2872
3175
|
async action({}) {
|
|
2873
|
-
const {
|
|
2874
|
-
await
|
|
3176
|
+
const { runTeamsSubscribe: runTeamsSubscribe2 } = await Promise.resolve().then(() => (init_subscribe_microsoft(), subscribe_microsoft_exports));
|
|
3177
|
+
await runTeamsSubscribe2({ cwd: process.cwd() });
|
|
2875
3178
|
}
|
|
2876
3179
|
};
|
|
2877
3180
|
|
|
@@ -2937,16 +3240,6 @@ var SubscribeCommand = class extends BaseCommand {
|
|
|
2937
3240
|
}
|
|
2938
3241
|
};
|
|
2939
3242
|
|
|
2940
|
-
// src/commands/sharepoint-subscribe.command.ts
|
|
2941
|
-
var SharepointSubscribeCommand = class extends SharepointCommand {
|
|
2942
|
-
getName() {
|
|
2943
|
-
return "sharepoint-subscribe";
|
|
2944
|
-
}
|
|
2945
|
-
getDescription() {
|
|
2946
|
-
return "Subscribe SharePoint webhooks";
|
|
2947
|
-
}
|
|
2948
|
-
};
|
|
2949
|
-
|
|
2950
3243
|
// src/commands/teams-subscribe.command.ts
|
|
2951
3244
|
var TeamsSubscribeCommand = class extends TeamsCommand {
|
|
2952
3245
|
getName() {
|
|
@@ -2957,16 +3250,6 @@ var TeamsSubscribeCommand = class extends TeamsCommand {
|
|
|
2957
3250
|
}
|
|
2958
3251
|
};
|
|
2959
3252
|
|
|
2960
|
-
// src/commands/onedrive-subscribe.command.ts
|
|
2961
|
-
var OnedriveSubscribeCommand = class extends OnedriveCommand {
|
|
2962
|
-
getName() {
|
|
2963
|
-
return "onedrive-subscribe";
|
|
2964
|
-
}
|
|
2965
|
-
getDescription() {
|
|
2966
|
-
return "Subscribe OneDrive webhooks";
|
|
2967
|
-
}
|
|
2968
|
-
};
|
|
2969
|
-
|
|
2970
3253
|
// src/commands/watch-renew.command.ts
|
|
2971
3254
|
init_google();
|
|
2972
3255
|
var WatchRenewCommand = class extends BaseCommand {
|
|
@@ -2998,7 +3281,8 @@ function createProgram() {
|
|
|
2998
3281
|
new ListCommand(),
|
|
2999
3282
|
new SchemaCommand(),
|
|
3000
3283
|
new ScriptCommand(),
|
|
3001
|
-
new StudioCommand()
|
|
3284
|
+
new StudioCommand(),
|
|
3285
|
+
new HttpCommand()
|
|
3002
3286
|
];
|
|
3003
3287
|
COMMANDS.forEach((command) => {
|
|
3004
3288
|
command.prepare(program);
|
package/dist/src/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandActionData, CommandArgument } from '../index.types';
|
|
2
|
+
import BaseCommand from './base.command';
|
|
3
|
+
export default class HttpCommand extends BaseCommand {
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDescription(): string;
|
|
6
|
+
getArguments(): CommandArgument[];
|
|
7
|
+
action({ args }: CommandActionData): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=http.command.d.ts.map
|
|
@@ -0,0 +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;CA0DxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onedrive-subscribe.command.d.ts","sourceRoot":"","sources":["../../../src/commands/onedrive-subscribe.command.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"onedrive-subscribe.command.d.ts","sourceRoot":"","sources":["../../../src/commands/onedrive-subscribe.command.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,eAAe;IACpE,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;CAGxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.command.d.ts","sourceRoot":"","sources":["../../../src/commands/setup.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.command.d.ts","sourceRoot":"","sources":["../../../src/commands/setup.command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,MAAM,gBAAgB,CAAC;AAQxB,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACpD,SAAS,CAAC,mBAAmB,IAAI,OAAO;IAIxC,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,UAAU,IAAI,aAAa,EAAE;IAoB7B,YAAY,IAAI,eAAe,EAAE;IAS3B,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB;IA0B3C,OAAO,CAAC,qBAAqB;CAK7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onedrive.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/subscribe/onedrive.command.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"onedrive.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/subscribe/onedrive.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACvD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIlB,MAAM,CAAC,EAAE,EAAE,iBAAiB;CAMlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseCommand from './base.command';
|
|
2
1
|
import type { CommandActionData, CommandOption } from '../index.types';
|
|
2
|
+
import BaseCommand from './base.command';
|
|
3
3
|
export default class SubscribeCommand extends BaseCommand {
|
|
4
4
|
getName(): string;
|
|
5
5
|
getDescription(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe.command.d.ts","sourceRoot":"","sources":["../../../src/commands/subscribe.command.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"subscribe.command.d.ts","sourceRoot":"","sources":["../../../src/commands/subscribe.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAMzC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACxD,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,UAAU,IAAI,aAAa,EAAE;IAU7B,cAAc,IAAI,WAAW,EAAE;IASzB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB;CAgD3C"}
|
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;AAepC,OAAO,EACN,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,0BAA0B,CAAC;AAElC,iBAAS,aAAa,IAAI,OAAO,CA0BhC;AA2BD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/lib/banner.ts"],"names":[],"mappings":"AASA,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYjD"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export declare function setupCalendarWatch(accessToken: string, webhookUrl: string, calendarId: string): Promise<
|
|
1
|
+
export declare function setupCalendarWatch(accessToken: string, webhookUrl: string, calendarId: string): Promise<{
|
|
2
|
+
channelId: string;
|
|
3
|
+
}>;
|
|
2
4
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/calendar.ts"],"names":[],"mappings":"AAKA,wBAAsB,kBAAkB,CACvC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/calendar.ts"],"names":[],"mappings":"AAKA,wBAAsB,kBAAkB,CACvC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA4ChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/drive.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/drive.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAiEhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/gmail.ts"],"names":[],"mappings":"AAIA,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/gmail.ts"],"names":[],"mappings":"AAIA,wBAAsB,eAAe,CACpC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CA4C1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/google/index.ts"],"names":[],"mappings":"AAwCA,wBAAsB,kBAAkB,CAAC,EACxC,GAAG,EACH,QAAQ,EAAE,mBAAmB,GAC7B,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2OhB"}
|
|
@@ -11,5 +11,14 @@ export declare function resolveAccessToken(integrationName: string, tenantId: st
|
|
|
11
11
|
}>;
|
|
12
12
|
export declare function saveWebhookSignature(accountKm: {
|
|
13
13
|
set_webhook_signature(sig: string): Promise<void>;
|
|
14
|
-
}, clientState: string
|
|
14
|
+
}, clientState: string, options?: {
|
|
15
|
+
pluginId: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
internal: CorsairInternalConfig;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
export declare function saveSubscriptionTenantLink(options: {
|
|
20
|
+
pluginId: string;
|
|
21
|
+
tenantId: string;
|
|
22
|
+
internal: CorsairInternalConfig;
|
|
23
|
+
}, subscriptionId: string): Promise<void>;
|
|
15
24
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAY1D,MAAM,MAAM,kBAAkB,GAAG;IAChC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D,CAAC;AAkCF,wBAAsB,kBAAkB,CACvC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA2FjE;AAED,wBAAsB,oBAAoB,CACzC,SAAS,EAAE;IAAE,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAChE,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,qBAAqB,CAAC;CAChC,GACC,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE;IACR,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,qBAAqB,CAAC;CAChC,EACD,cAAc,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onedrive.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/onedrive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"onedrive.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/onedrive.ts"],"names":[],"mappings":"AA0DA,wBAAsB,oBAAoB,CAAC,EAC1C,GAAG,GACH,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,IAAI,CAAC,CA0HhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlook.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/outlook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"outlook.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/outlook.ts"],"names":[],"mappings":"AAyDA,wBAAsB,mBAAmB,CAAC,EACzC,GAAG,GACH,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,IAAI,CAAC,CA0FhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharepoint.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/sharepoint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sharepoint.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/sharepoint.ts"],"names":[],"mappings":"AA+EA,wBAAsB,sBAAsB,CAAC,EAC5C,GAAG,GACH,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,IAAI,CAAC,CA2HhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/teams.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../../../src/lib/microsoft/teams.ts"],"names":[],"mappings":"AAsOA,wBAAsB,iBAAiB,CAAC,EACvC,GAAG,GACH,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,IAAI,CAAC,CA4HhB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Readies the dev tunnel for a `ck_dev_` key. With frp there is no machine
|
|
3
|
+
* enrollment: the frpc binary ships with the SDK, so this just verifies it's
|
|
4
|
+
* present, confirms the Hub is reachable (and owns a slug), and prints the
|
|
5
|
+
* stable tunnel URL. The key is the only thing the developer provides.
|
|
6
|
+
*/
|
|
7
|
+
export declare function enrollDevTunnel(opts: {
|
|
8
|
+
apiUrl: string;
|
|
9
|
+
projectApiKey: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=tunnel-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-setup.d.ts","sourceRoot":"","sources":["../../../src/lib/tunnel-setup.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4ChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corsair-instance.d.ts","sourceRoot":"","sources":["../../../src/utils/corsair-instance.ts"],"names":[],"mappings":"AA+IA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhE;AAED,wBAAsB,kBAAkB,CAAC,EACxC,GAAG,EACH,UAAU,EACV,kBAA0B,GAC1B,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,
|
|
1
|
+
{"version":3,"file":"corsair-instance.d.ts","sourceRoot":"","sources":["../../../src/utils/corsair-instance.ts"],"names":[],"mappings":"AA+IA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhE;AAED,wBAAsB,kBAAkB,CAAC,EACxC,GAAG,EACH,UAAU,EACV,kBAA0B,GAC1B,EAAE;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,oBAsDA;AAED,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corsair-dev/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "",
|
|
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.117"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/jest": "^29.5.14",
|