@topolo/cli 0.6.1 → 0.6.2
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 +63 -88
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { platform as platform2 } from "os";
|
|
|
9
9
|
import { createInterface } from "readline/promises";
|
|
10
10
|
import { stdin as input } from "process";
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// node_modules/@topolo/sdk/dist/index.js
|
|
13
13
|
function applyAuthHeaders(headers, credential) {
|
|
14
14
|
if (credential.kind === "api_key") {
|
|
15
15
|
headers.set("X-Api-Key", credential.apiKey);
|
|
@@ -137,9 +137,7 @@ var APPLICATIONS = {
|
|
|
137
137
|
"domains": [
|
|
138
138
|
"admin.topolo.app"
|
|
139
139
|
],
|
|
140
|
-
"routes": [
|
|
141
|
-
"admin.topolo.app"
|
|
142
|
-
],
|
|
140
|
+
"routes": [],
|
|
143
141
|
"appId": null
|
|
144
142
|
},
|
|
145
143
|
{
|
|
@@ -187,7 +185,7 @@ var APPLICATIONS = {
|
|
|
187
185
|
"appDir": "TopoloAuth",
|
|
188
186
|
"name": "topolo-auth",
|
|
189
187
|
"packageName": "topolo-auth",
|
|
190
|
-
"productionUrl": "https://auth.topolo.app",
|
|
188
|
+
"productionUrl": "https://auth.topolo.app/login",
|
|
191
189
|
"services": [
|
|
192
190
|
"auth"
|
|
193
191
|
],
|
|
@@ -223,9 +221,7 @@ var APPLICATIONS = {
|
|
|
223
221
|
"domains": [
|
|
224
222
|
"backup.topolo.app"
|
|
225
223
|
],
|
|
226
|
-
"routes": [
|
|
227
|
-
"backup.topolo.app"
|
|
228
|
-
],
|
|
224
|
+
"routes": [],
|
|
229
225
|
"appId": "backup"
|
|
230
226
|
}
|
|
231
227
|
]
|
|
@@ -277,7 +273,9 @@ var APPLICATIONS = {
|
|
|
277
273
|
"domains": [
|
|
278
274
|
"brand.topolo.app"
|
|
279
275
|
],
|
|
280
|
-
"routes": [
|
|
276
|
+
"routes": [
|
|
277
|
+
"brand.topolo.app"
|
|
278
|
+
],
|
|
281
279
|
"appId": "brand"
|
|
282
280
|
},
|
|
283
281
|
{
|
|
@@ -329,9 +327,7 @@ var APPLICATIONS = {
|
|
|
329
327
|
"domains": [
|
|
330
328
|
"bytes.topolo.app"
|
|
331
329
|
],
|
|
332
|
-
"routes": [
|
|
333
|
-
"bytes.topolo.app"
|
|
334
|
-
],
|
|
330
|
+
"routes": [],
|
|
335
331
|
"appId": "bytes"
|
|
336
332
|
},
|
|
337
333
|
{
|
|
@@ -391,7 +387,9 @@ var APPLICATIONS = {
|
|
|
391
387
|
"domains": [
|
|
392
388
|
"campaigns.topolo.app"
|
|
393
389
|
],
|
|
394
|
-
"routes": [
|
|
390
|
+
"routes": [
|
|
391
|
+
"campaigns.topolo.app"
|
|
392
|
+
],
|
|
395
393
|
"appId": "campaigns"
|
|
396
394
|
},
|
|
397
395
|
{
|
|
@@ -481,9 +479,7 @@ var APPLICATIONS = {
|
|
|
481
479
|
"domains": [
|
|
482
480
|
"guest.topolo.app"
|
|
483
481
|
],
|
|
484
|
-
"routes": [
|
|
485
|
-
"guest.topolo.app"
|
|
486
|
-
],
|
|
482
|
+
"routes": [],
|
|
487
483
|
"appId": null
|
|
488
484
|
},
|
|
489
485
|
{
|
|
@@ -493,9 +489,7 @@ var APPLICATIONS = {
|
|
|
493
489
|
"domains": [
|
|
494
490
|
"commerce.topolo.app"
|
|
495
491
|
],
|
|
496
|
-
"routes": [
|
|
497
|
-
"commerce.topolo.app"
|
|
498
|
-
],
|
|
492
|
+
"routes": [],
|
|
499
493
|
"appId": "commerce"
|
|
500
494
|
},
|
|
501
495
|
{
|
|
@@ -505,9 +499,7 @@ var APPLICATIONS = {
|
|
|
505
499
|
"domains": [
|
|
506
500
|
"station-commerce.topolo.app"
|
|
507
501
|
],
|
|
508
|
-
"routes": [
|
|
509
|
-
"station-commerce.topolo.app"
|
|
510
|
-
],
|
|
502
|
+
"routes": [],
|
|
511
503
|
"appId": null
|
|
512
504
|
}
|
|
513
505
|
]
|
|
@@ -685,9 +677,7 @@ var APPLICATIONS = {
|
|
|
685
677
|
"domains": [
|
|
686
678
|
"docs.topolo.app"
|
|
687
679
|
],
|
|
688
|
-
"routes": [
|
|
689
|
-
"docs.topolo.app"
|
|
690
|
-
],
|
|
680
|
+
"routes": [],
|
|
691
681
|
"appId": null
|
|
692
682
|
},
|
|
693
683
|
{
|
|
@@ -717,9 +707,7 @@ var APPLICATIONS = {
|
|
|
717
707
|
"domains": [
|
|
718
708
|
"feed-analytics-api.topolo.app"
|
|
719
709
|
],
|
|
720
|
-
"routes": [
|
|
721
|
-
"feed-analytics-api.topolo.app"
|
|
722
|
-
],
|
|
710
|
+
"routes": [],
|
|
723
711
|
"appId": null
|
|
724
712
|
},
|
|
725
713
|
{
|
|
@@ -729,9 +717,7 @@ var APPLICATIONS = {
|
|
|
729
717
|
"domains": [
|
|
730
718
|
"feed-api.topolo.app"
|
|
731
719
|
],
|
|
732
|
-
"routes": [
|
|
733
|
-
"feed-api.topolo.app"
|
|
734
|
-
],
|
|
720
|
+
"routes": [],
|
|
735
721
|
"appId": null
|
|
736
722
|
},
|
|
737
723
|
{
|
|
@@ -741,9 +727,7 @@ var APPLICATIONS = {
|
|
|
741
727
|
"domains": [
|
|
742
728
|
"feed.topolo.app"
|
|
743
729
|
],
|
|
744
|
-
"routes": [
|
|
745
|
-
"feed.topolo.app"
|
|
746
|
-
],
|
|
730
|
+
"routes": [],
|
|
747
731
|
"appId": "feed"
|
|
748
732
|
}
|
|
749
733
|
]
|
|
@@ -855,9 +839,7 @@ var APPLICATIONS = {
|
|
|
855
839
|
"domains": [
|
|
856
840
|
"home.topolo.app"
|
|
857
841
|
],
|
|
858
|
-
"routes": [
|
|
859
|
-
"home.topolo.app"
|
|
860
|
-
],
|
|
842
|
+
"routes": [],
|
|
861
843
|
"appId": "home"
|
|
862
844
|
},
|
|
863
845
|
{
|
|
@@ -947,9 +929,7 @@ var APPLICATIONS = {
|
|
|
947
929
|
"domains": [
|
|
948
930
|
"learn.topolo.app"
|
|
949
931
|
],
|
|
950
|
-
"routes": [
|
|
951
|
-
"learn.topolo.app"
|
|
952
|
-
],
|
|
932
|
+
"routes": [],
|
|
953
933
|
"appId": "learn"
|
|
954
934
|
},
|
|
955
935
|
{
|
|
@@ -1041,9 +1021,7 @@ var APPLICATIONS = {
|
|
|
1041
1021
|
"domains": [
|
|
1042
1022
|
"mdm.topolo.app"
|
|
1043
1023
|
],
|
|
1044
|
-
"routes": [
|
|
1045
|
-
"mdm.topolo.app"
|
|
1046
|
-
],
|
|
1024
|
+
"routes": [],
|
|
1047
1025
|
"appId": "mdm"
|
|
1048
1026
|
}
|
|
1049
1027
|
]
|
|
@@ -1065,9 +1043,7 @@ var APPLICATIONS = {
|
|
|
1065
1043
|
"domains": [
|
|
1066
1044
|
"messages.topolo.app"
|
|
1067
1045
|
],
|
|
1068
|
-
"routes": [
|
|
1069
|
-
"messages.topolo.app"
|
|
1070
|
-
],
|
|
1046
|
+
"routes": [],
|
|
1071
1047
|
"appId": "messages"
|
|
1072
1048
|
},
|
|
1073
1049
|
{
|
|
@@ -1101,13 +1077,11 @@ var APPLICATIONS = {
|
|
|
1101
1077
|
{
|
|
1102
1078
|
"name": "topolo-nexus-dashboard",
|
|
1103
1079
|
"kind": "worker",
|
|
1104
|
-
"apiUrl":
|
|
1080
|
+
"apiUrl": null,
|
|
1105
1081
|
"domains": [
|
|
1106
1082
|
"nexus.topolo.app"
|
|
1107
1083
|
],
|
|
1108
|
-
"routes": [
|
|
1109
|
-
"nexus.topolo.app"
|
|
1110
|
-
],
|
|
1084
|
+
"routes": [],
|
|
1111
1085
|
"appId": null
|
|
1112
1086
|
},
|
|
1113
1087
|
{
|
|
@@ -1235,9 +1209,7 @@ var APPLICATIONS = {
|
|
|
1235
1209
|
"domains": [
|
|
1236
1210
|
"p2p.topolo.app"
|
|
1237
1211
|
],
|
|
1238
|
-
"routes": [
|
|
1239
|
-
"p2p.topolo.app"
|
|
1240
|
-
],
|
|
1212
|
+
"routes": [],
|
|
1241
1213
|
"appId": "p2p"
|
|
1242
1214
|
},
|
|
1243
1215
|
{
|
|
@@ -1434,9 +1406,7 @@ var APPLICATIONS = {
|
|
|
1434
1406
|
"domains": [
|
|
1435
1407
|
"studio.topolo.app"
|
|
1436
1408
|
],
|
|
1437
|
-
"routes": [
|
|
1438
|
-
"studio.topolo.app"
|
|
1439
|
-
],
|
|
1409
|
+
"routes": [],
|
|
1440
1410
|
"appId": "social_studio"
|
|
1441
1411
|
},
|
|
1442
1412
|
{
|
|
@@ -1474,9 +1444,7 @@ var APPLICATIONS = {
|
|
|
1474
1444
|
"domains": [
|
|
1475
1445
|
"socialize.topolo.app"
|
|
1476
1446
|
],
|
|
1477
|
-
"routes": [
|
|
1478
|
-
"socialize.topolo.app"
|
|
1479
|
-
],
|
|
1447
|
+
"routes": [],
|
|
1480
1448
|
"appId": "socialize"
|
|
1481
1449
|
},
|
|
1482
1450
|
{
|
|
@@ -1486,9 +1454,7 @@ var APPLICATIONS = {
|
|
|
1486
1454
|
"domains": [
|
|
1487
1455
|
"socialize-api.topolo.app"
|
|
1488
1456
|
],
|
|
1489
|
-
"routes": [
|
|
1490
|
-
"socialize-api.topolo.app"
|
|
1491
|
-
],
|
|
1457
|
+
"routes": [],
|
|
1492
1458
|
"appId": null
|
|
1493
1459
|
},
|
|
1494
1460
|
{
|
|
@@ -1548,9 +1514,7 @@ var APPLICATIONS = {
|
|
|
1548
1514
|
"domains": [
|
|
1549
1515
|
"status.topolo.app"
|
|
1550
1516
|
],
|
|
1551
|
-
"routes": [
|
|
1552
|
-
"status.topolo.app"
|
|
1553
|
-
],
|
|
1517
|
+
"routes": [],
|
|
1554
1518
|
"appId": "status"
|
|
1555
1519
|
}
|
|
1556
1520
|
]
|
|
@@ -1666,9 +1630,7 @@ var APPLICATIONS = {
|
|
|
1666
1630
|
"domains": [
|
|
1667
1631
|
"voice.topolo.app"
|
|
1668
1632
|
],
|
|
1669
|
-
"routes": [
|
|
1670
|
-
"voice.topolo.app"
|
|
1671
|
-
],
|
|
1633
|
+
"routes": [],
|
|
1672
1634
|
"appId": "voice"
|
|
1673
1635
|
},
|
|
1674
1636
|
{
|
|
@@ -1719,9 +1681,7 @@ var APPLICATIONS = {
|
|
|
1719
1681
|
"domains": [
|
|
1720
1682
|
"web.topolo.app"
|
|
1721
1683
|
],
|
|
1722
|
-
"routes": [
|
|
1723
|
-
"web.topolo.app"
|
|
1724
|
-
],
|
|
1684
|
+
"routes": [],
|
|
1725
1685
|
"appId": "web"
|
|
1726
1686
|
}
|
|
1727
1687
|
]
|
|
@@ -3403,6 +3363,7 @@ var CrmModule = class {
|
|
|
3403
3363
|
constructor(client) {
|
|
3404
3364
|
this.client = client;
|
|
3405
3365
|
}
|
|
3366
|
+
client;
|
|
3406
3367
|
async listContacts(options = {}) {
|
|
3407
3368
|
const res = await this.client.request({
|
|
3408
3369
|
service: "crm",
|
|
@@ -3448,6 +3409,7 @@ var IdentityModule = class {
|
|
|
3448
3409
|
constructor(client) {
|
|
3449
3410
|
this.client = client;
|
|
3450
3411
|
}
|
|
3412
|
+
client;
|
|
3451
3413
|
/** Returns the resolved user, organization, and permission set for the
|
|
3452
3414
|
* current credential. Equivalent to `TopoloClient.introspect()` — exposed
|
|
3453
3415
|
* on this module for symmetry with the other domain modules. */
|
|
@@ -3542,7 +3504,7 @@ function createTopolo(options) {
|
|
|
3542
3504
|
};
|
|
3543
3505
|
}
|
|
3544
3506
|
|
|
3545
|
-
//
|
|
3507
|
+
// node_modules/@topolo/sdk/dist/node/credential-store.js
|
|
3546
3508
|
import { mkdir, readFile, writeFile, chmod } from "fs/promises";
|
|
3547
3509
|
import { existsSync } from "fs";
|
|
3548
3510
|
import { homedir, platform } from "os";
|
|
@@ -9461,20 +9423,13 @@ function scaffoldFiles(options) {
|
|
|
9461
9423
|
`CREATE TABLE IF NOT EXISTS ${tablePrefix}_workspaces (`,
|
|
9462
9424
|
" id TEXT PRIMARY KEY,",
|
|
9463
9425
|
` ${tenantColumn} TEXT NOT NULL,`,
|
|
9464
|
-
"
|
|
9465
|
-
" slug TEXT NOT NULL,",
|
|
9466
|
-
" created_by_user_id TEXT,",
|
|
9467
|
-
" created_by_email TEXT,",
|
|
9426
|
+
" status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'archived')),",
|
|
9468
9427
|
" created_at TEXT NOT NULL,",
|
|
9469
|
-
" updated_at TEXT NOT NULL
|
|
9470
|
-
` UNIQUE(${tenantColumn}, slug)`,
|
|
9428
|
+
" updated_at TEXT NOT NULL",
|
|
9471
9429
|
");",
|
|
9472
9430
|
"",
|
|
9473
9431
|
`CREATE INDEX IF NOT EXISTS idx_${tablePrefix}_workspaces_${tenantColumn}`,
|
|
9474
9432
|
` ON ${tablePrefix}_workspaces(${tenantColumn});`,
|
|
9475
|
-
"",
|
|
9476
|
-
`CREATE INDEX IF NOT EXISTS idx_${tablePrefix}_workspaces_slug`,
|
|
9477
|
-
` ON ${tablePrefix}_workspaces(${tenantColumn}, slug);`,
|
|
9478
9433
|
""
|
|
9479
9434
|
].join("\n");
|
|
9480
9435
|
const base = target === "platform" ? firstPartyAppPath(application.appDir, options.payload.audience) : application.appDir;
|
|
@@ -10037,10 +9992,10 @@ export default defineConfig({
|
|
|
10037
9992
|
if (options.payload.resources.d1) {
|
|
10038
9993
|
files.push({
|
|
10039
9994
|
path: `${apiBase}/migrations/0001_initial.sql`,
|
|
10040
|
-
purpose: "Canonical multi-tenant baseline: the
|
|
9995
|
+
purpose: "Canonical multi-tenant baseline: the identity-only workspace mirror (platform owns the record).",
|
|
10041
9996
|
requiredSignals: [
|
|
10042
|
-
`${tablePrefix}_workspaces
|
|
10043
|
-
|
|
9997
|
+
`${tablePrefix}_workspaces is an identity-only mirror (id, ${tenantColumn}, status) \u2014 no name/slug/is_default; the workspace record lives in TopoloAuth`,
|
|
9998
|
+
`every domain table added later carries ${tenantColumn} and a workspace_id scope column`
|
|
10044
9999
|
],
|
|
10045
10000
|
content: workspacesMigrationSql
|
|
10046
10001
|
});
|
|
@@ -10332,6 +10287,22 @@ async function reconcileApplicationCapabilitySource(options) {
|
|
|
10332
10287
|
distributionModel: registration.distributionModel === "marketplace" ? "marketplace" : "organization_internal",
|
|
10333
10288
|
requested: [...existing, ...options.additions ?? []]
|
|
10334
10289
|
});
|
|
10290
|
+
const marketplace = record(registration.marketplace);
|
|
10291
|
+
const unlistedNativeArtifact = options.ownerType === "topolo_first_party" && registration.surfaceModel === "mobile_container" && registration.distributionModel === "organization_internal" && marketplace?.intent === "unlisted";
|
|
10292
|
+
if (unlistedNativeArtifact) {
|
|
10293
|
+
return {
|
|
10294
|
+
mode: options.mode,
|
|
10295
|
+
applied: false,
|
|
10296
|
+
status: "in_sync",
|
|
10297
|
+
manifestPath,
|
|
10298
|
+
packagePath,
|
|
10299
|
+
contractPath,
|
|
10300
|
+
capabilities,
|
|
10301
|
+
changes: [],
|
|
10302
|
+
missingResources: [],
|
|
10303
|
+
verticalConfiguration: []
|
|
10304
|
+
};
|
|
10305
|
+
}
|
|
10335
10306
|
const expectedComposition = capabilityCompositionProjection(capabilities);
|
|
10336
10307
|
const expectedNotifications = capabilities.selected.includes("notification_producer") ? { role: "producer", contracts: "topolo.notification-contracts.json" } : capabilities.selected.includes("notifications") ? { role: "consumer_only" } : { role: "internal_non_producer" };
|
|
10337
10308
|
const changes = [];
|
|
@@ -10598,6 +10569,9 @@ function resolveManifestApplicationUrl(manifest, environment) {
|
|
|
10598
10569
|
if (hostOverride) return `https://${hostOverride.replace(/^https?:\/\//, "").replace(/\/+$/, "")}`;
|
|
10599
10570
|
const domain = manifest.environments?.[environment]?.domain;
|
|
10600
10571
|
if (!target.subdomain || !domain) {
|
|
10572
|
+
if (manifest.registration?.productionUrl) {
|
|
10573
|
+
return manifest.registration.productionUrl.replace(/\/+$/, "");
|
|
10574
|
+
}
|
|
10601
10575
|
throw new Error(`Cannot derive the ${environment} application URL from target ${targetName}.`);
|
|
10602
10576
|
}
|
|
10603
10577
|
return `https://${target.subdomain}.${domain}`;
|
|
@@ -10623,10 +10597,11 @@ function assertRegistration(value) {
|
|
|
10623
10597
|
"version",
|
|
10624
10598
|
"pricing",
|
|
10625
10599
|
"supportEmail",
|
|
10626
|
-
"auth",
|
|
10627
10600
|
"capabilities",
|
|
10628
10601
|
"marketplace"
|
|
10629
10602
|
];
|
|
10603
|
+
const marketplace = record2(registration?.marketplace);
|
|
10604
|
+
if (marketplace?.intent !== "unlisted") required.push("auth");
|
|
10630
10605
|
const missing = required.filter((field) => registration?.[field] == null || registration[field] === "");
|
|
10631
10606
|
if (missing.length) {
|
|
10632
10607
|
throw new Error(
|
|
@@ -10730,7 +10705,7 @@ async function loadApplicationReconcileRequest(options) {
|
|
|
10730
10705
|
}
|
|
10731
10706
|
const environment = options.environment || selectedEnvironment();
|
|
10732
10707
|
const productionUrl = resolveManifestApplicationUrl(manifest, environment);
|
|
10733
|
-
const callbackPath = registration.auth.callbackPath.startsWith("/") ? registration.auth.callbackPath : `/${registration.auth.callbackPath}
|
|
10708
|
+
const callbackPath = registration.auth ? registration.auth.callbackPath.startsWith("/") ? registration.auth.callbackPath : `/${registration.auth.callbackPath}` : null;
|
|
10734
10709
|
const appId = String(manifest.appId || manifest.app_id || "").trim();
|
|
10735
10710
|
if (!appId) throw new Error("topolo.app.json must declare the immutable appId.");
|
|
10736
10711
|
return {
|
|
@@ -10760,8 +10735,8 @@ async function loadApplicationReconcileRequest(options) {
|
|
|
10760
10735
|
supportEmail: registration.supportEmail,
|
|
10761
10736
|
tags: registration.tags ?? [],
|
|
10762
10737
|
screenshots: registration.screenshots ?? [],
|
|
10763
|
-
callbackUrls: [`${productionUrl}${callbackPath}`],
|
|
10764
|
-
requestedScopes: registration.auth
|
|
10738
|
+
callbackUrls: callbackPath ? [`${productionUrl}${callbackPath}`] : [],
|
|
10739
|
+
requestedScopes: registration.auth?.requestedScopes ?? [],
|
|
10765
10740
|
capabilities: registration.capabilities,
|
|
10766
10741
|
marketplace: { ...registration.marketplace, appUrl: productionUrl },
|
|
10767
10742
|
notifications: manifest.notifications ?? null
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"topoloPublishedVersion": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"topoloPublishedVersion": "0.6.2",
|
|
5
5
|
"description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"commander": "^12.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@topolo/sdk": "
|
|
32
|
+
"@topolo/sdk": "latest",
|
|
33
33
|
"@types/node": "^20.12.0",
|
|
34
34
|
"@vitest/coverage-v8": "3.2.6",
|
|
35
35
|
"tsup": "^8.0.0",
|