@topolo/cli 0.1.28 → 0.1.29
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 +15 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,7 +89,7 @@ var SERVICES = {
|
|
|
89
89
|
inventory: "https://inventory.topolo.app",
|
|
90
90
|
learn: "https://learn-api.topolo.app",
|
|
91
91
|
localize: "https://localize.topolo.app",
|
|
92
|
-
mail: "https://mail.topolo.app",
|
|
92
|
+
mail: "https://mail-api.topolo.app",
|
|
93
93
|
mdm: "https://mdm-api.topolo.app",
|
|
94
94
|
messages: "https://messages.topolo.app",
|
|
95
95
|
nexus: "https://nexus-api.topolo.app",
|
|
@@ -925,15 +925,17 @@ var APPLICATIONS = {
|
|
|
925
925
|
"mail.topolo.app"
|
|
926
926
|
],
|
|
927
927
|
"routes": [],
|
|
928
|
-
"serviceId":
|
|
928
|
+
"serviceId": null
|
|
929
929
|
},
|
|
930
930
|
{
|
|
931
931
|
"name": "topolo-mail-api",
|
|
932
932
|
"kind": "worker",
|
|
933
|
-
"apiUrl":
|
|
934
|
-
"domains": [
|
|
933
|
+
"apiUrl": "https://mail-api.topolo.app",
|
|
934
|
+
"domains": [
|
|
935
|
+
"mail-api.topolo.app"
|
|
936
|
+
],
|
|
935
937
|
"routes": [],
|
|
936
|
-
"serviceId":
|
|
938
|
+
"serviceId": "mail"
|
|
937
939
|
}
|
|
938
940
|
]
|
|
939
941
|
},
|
|
@@ -2052,10 +2054,7 @@ function resolveCatalogServiceUrl(entry, options = {}) {
|
|
|
2052
2054
|
if (override) return override;
|
|
2053
2055
|
const apiBaseUrl = firstString(entry.apiBaseUrl, entry.api_base_url);
|
|
2054
2056
|
if (apiBaseUrl) return apiBaseUrl;
|
|
2055
|
-
|
|
2056
|
-
const liveUrl = firstString(entry.baseUrl);
|
|
2057
|
-
if (bundledUrl && (!liveUrl || sameUrlEnvironment(bundledUrl, liveUrl))) return bundledUrl;
|
|
2058
|
-
return liveUrl ?? bundledUrl ?? null;
|
|
2057
|
+
return null;
|
|
2059
2058
|
}
|
|
2060
2059
|
function resolveServiceUrl(service, overrides) {
|
|
2061
2060
|
const override = resolveServiceUrlOverride([service], overrides);
|
|
@@ -2097,34 +2096,12 @@ function resolveServiceUrlOverride(keys, overrides) {
|
|
|
2097
2096
|
}
|
|
2098
2097
|
return null;
|
|
2099
2098
|
}
|
|
2100
|
-
function firstBundledServiceUrl(keys) {
|
|
2101
|
-
for (const key of keys) {
|
|
2102
|
-
const url = DEFAULT_SERVICE_URLS[key];
|
|
2103
|
-
if (url) return url;
|
|
2104
|
-
}
|
|
2105
|
-
return null;
|
|
2106
|
-
}
|
|
2107
2099
|
function firstString(...values) {
|
|
2108
2100
|
for (const value of values) {
|
|
2109
2101
|
if (typeof value === "string" && value.trim()) return value.trim();
|
|
2110
2102
|
}
|
|
2111
2103
|
return null;
|
|
2112
2104
|
}
|
|
2113
|
-
function sameUrlEnvironment(left, right) {
|
|
2114
|
-
return urlEnvironment(left) === urlEnvironment(right);
|
|
2115
|
-
}
|
|
2116
|
-
function urlEnvironment(value) {
|
|
2117
|
-
try {
|
|
2118
|
-
const url = new URL(value);
|
|
2119
|
-
const host = url.hostname.toLowerCase();
|
|
2120
|
-
if (host === "localhost" || host === "127.0.0.1") return "local";
|
|
2121
|
-
if (host.endsWith(".stg.topolo.us") || host.includes("topolo-staging")) return "staging";
|
|
2122
|
-
if (host.endsWith(".topolo.app") || host.endsWith(".topolo.us")) return "production";
|
|
2123
|
-
return "external";
|
|
2124
|
-
} catch {
|
|
2125
|
-
return "external";
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
2105
|
var WRITE_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
2129
2106
|
var TOPOLO_ACTION_ID_HEADER = "X-Topolo-Action-Id";
|
|
2130
2107
|
var TOPOLO_ACTION_NAME_HEADER = "X-Topolo-Action-Name";
|
|
@@ -2295,7 +2272,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2295
2272
|
async resolveLiveCallableService(serviceKey) {
|
|
2296
2273
|
const catalog = await this.listServices();
|
|
2297
2274
|
const match = catalog.find((entry) => catalogEntryMatches(entry, serviceKey));
|
|
2298
|
-
if (!match
|
|
2275
|
+
if (!match) return null;
|
|
2299
2276
|
const baseUrl = resolveCatalogServiceUrl(match, {
|
|
2300
2277
|
serviceKey,
|
|
2301
2278
|
overrides: this.serviceUrls
|
|
@@ -2393,7 +2370,6 @@ var TopoloClient = class _TopoloClient {
|
|
|
2393
2370
|
slug: typeof s.app_slug === "string" ? s.app_slug : null,
|
|
2394
2371
|
name: typeof s.name === "string" ? s.name : null,
|
|
2395
2372
|
description: typeof s.description === "string" ? s.description : null,
|
|
2396
|
-
baseUrl: typeof s.base_url === "string" ? s.base_url : null,
|
|
2397
2373
|
apiBaseUrl: typeof s.api_base_url === "string" ? s.api_base_url : typeof s.apiBaseUrl === "string" ? s.apiBaseUrl : null,
|
|
2398
2374
|
launchUrl: typeof s.launch_url === "string" ? s.launch_url : typeof s.launchUrl === "string" ? s.launchUrl : null,
|
|
2399
2375
|
status: typeof s.status === "string" ? s.status : null,
|
|
@@ -2480,7 +2456,6 @@ var TopoloClient = class _TopoloClient {
|
|
|
2480
2456
|
slug: app.id,
|
|
2481
2457
|
name: app.name ?? app.id,
|
|
2482
2458
|
description: null,
|
|
2483
|
-
baseUrl: app.productionUrl ?? null,
|
|
2484
2459
|
apiBaseUrl: null,
|
|
2485
2460
|
launchUrl: app.productionUrl ?? null,
|
|
2486
2461
|
status: "bundled",
|
|
@@ -2573,13 +2548,6 @@ function catalogEntryLookupKeys(entry) {
|
|
|
2573
2548
|
}
|
|
2574
2549
|
return [...keys];
|
|
2575
2550
|
}
|
|
2576
|
-
function isCallableCatalogEntry(entry) {
|
|
2577
|
-
const kind = normalizeLookupKey(entry.surfaceKind || "");
|
|
2578
|
-
if (kind === "api" || kind === "technical_service" || kind === "service") return true;
|
|
2579
|
-
return Boolean(
|
|
2580
|
-
(entry.baseUrl || entry.apiBaseUrl) && catalogEntryLookupKeys(entry).some((key) => Object.prototype.hasOwnProperty.call(DEFAULT_SERVICE_URLS, key))
|
|
2581
|
-
);
|
|
2582
|
-
}
|
|
2583
2551
|
function normalizeActionCatalogEntry(item) {
|
|
2584
2552
|
if (!item || typeof item !== "object" || Array.isArray(item)) return null;
|
|
2585
2553
|
const a = item;
|
|
@@ -8252,7 +8220,7 @@ function applicationRowsFromCatalog(catalog) {
|
|
|
8252
8220
|
name: entry.name ?? entry.slug ?? entry.serviceId,
|
|
8253
8221
|
appDir: "-",
|
|
8254
8222
|
packageName: null,
|
|
8255
|
-
productionUrl: entry.
|
|
8223
|
+
productionUrl: entry.launchUrl ?? null,
|
|
8256
8224
|
services: [displayCatalogId(entry)],
|
|
8257
8225
|
deployTargets: 0
|
|
8258
8226
|
})).sort((left, right) => left.id.localeCompare(right.id));
|
|
@@ -8849,22 +8817,23 @@ function buildRows(catalog, overrides, environment = selectedEnvironment()) {
|
|
|
8849
8817
|
defaultUrl,
|
|
8850
8818
|
effectiveUrl,
|
|
8851
8819
|
overridden: Boolean(configuredUrl && configuredUrl !== defaultUrl),
|
|
8852
|
-
environmentSafe: environment !== "staging" || isStagingUrl(effectiveUrl),
|
|
8820
|
+
environmentSafe: environment !== "staging" || !effectiveUrl || isStagingUrl(effectiveUrl),
|
|
8853
8821
|
permissions: [...entry.permissions]
|
|
8854
8822
|
};
|
|
8855
8823
|
}).sort((left, right) => left.id.localeCompare(right.id));
|
|
8856
8824
|
}
|
|
8857
8825
|
function formatRows2(rows, environment = selectedEnvironment()) {
|
|
8858
8826
|
const idWidth = Math.max(3, ...rows.map((r) => r.id.length));
|
|
8859
|
-
const urlWidth = Math.max(7, ...rows.map((r) => r.effectiveUrl.length));
|
|
8827
|
+
const urlWidth = Math.max(7, ...rows.map((r) => (r.effectiveUrl ?? "-").length));
|
|
8860
8828
|
const lines = [];
|
|
8861
8829
|
lines.push(`Environment: ${environment}`);
|
|
8862
8830
|
lines.push("");
|
|
8863
8831
|
lines.push(`${"ID".padEnd(idWidth)} ${"URL".padEnd(urlWidth)} OVERRIDE READY`);
|
|
8864
8832
|
lines.push(`${"-".repeat(idWidth)} ${"-".repeat(urlWidth)} -------- -----`);
|
|
8865
8833
|
for (const r of rows) {
|
|
8834
|
+
const effectiveUrl = r.effectiveUrl ?? "-";
|
|
8866
8835
|
lines.push(
|
|
8867
|
-
`${r.id.padEnd(idWidth)} ${
|
|
8836
|
+
`${r.id.padEnd(idWidth)} ${effectiveUrl.padEnd(urlWidth)} ${r.overridden ? "yes" : "".padEnd(8)} ${r.environmentSafe ? "yes" : "no"}`
|
|
8868
8837
|
);
|
|
8869
8838
|
}
|
|
8870
8839
|
return lines.join("\n");
|
|
@@ -8885,7 +8854,7 @@ function displayServiceId(entry) {
|
|
|
8885
8854
|
return serviceIdCandidates(entry.slug || entry.serviceId)[0] || entry.serviceId;
|
|
8886
8855
|
}
|
|
8887
8856
|
function defaultServiceUrl(id, entry) {
|
|
8888
|
-
return resolveCatalogServiceUrl(entry, { serviceKey: id })
|
|
8857
|
+
return resolveCatalogServiceUrl(entry, { serviceKey: id });
|
|
8889
8858
|
}
|
|
8890
8859
|
function configuredServiceUrl(id, overrides) {
|
|
8891
8860
|
if (!overrides) return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|