@topolo/cli 0.1.14 → 0.1.15
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 +16 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80,7 +80,7 @@ var SERVICES = {
|
|
|
80
80
|
mdm: "https://topolo-mdm-api.topolo.app",
|
|
81
81
|
messaging: "https://messages.topolo.app",
|
|
82
82
|
nexus: "https://topolo-nexus-gateway.topolo.workers.dev",
|
|
83
|
-
one: "https://
|
|
83
|
+
one: "https://one.topolo.app",
|
|
84
84
|
pay: "https://topolo-pay.topolo.workers.dev",
|
|
85
85
|
"quro.api": "https://api.ol0.me",
|
|
86
86
|
"quro.redirect": "https://ol0.me",
|
|
@@ -677,7 +677,7 @@ var APPLICATIONS = {
|
|
|
677
677
|
{
|
|
678
678
|
"name": "topoloone-worker",
|
|
679
679
|
"kind": "worker",
|
|
680
|
-
"apiUrl": "https://
|
|
680
|
+
"apiUrl": "https://one.topolo.app",
|
|
681
681
|
"domains": [],
|
|
682
682
|
"routes": [
|
|
683
683
|
"one.topolo.app/*"
|
|
@@ -1083,8 +1083,9 @@ var APPLICATION_REQUIREMENTS = [
|
|
|
1083
1083
|
];
|
|
1084
1084
|
function applicationRequirementScopes(application) {
|
|
1085
1085
|
const scopes = /* @__PURE__ */ new Set(["all"]);
|
|
1086
|
-
const
|
|
1087
|
-
const
|
|
1086
|
+
const deployTargets = application.deployTargets;
|
|
1087
|
+
const hasBrowserSurface = Boolean(application.productionUrl) || deployTargets.some((target) => target.kind === "pages");
|
|
1088
|
+
const hasApiSurface = application.services.length > 0 || deployTargets.some((target) => Boolean(target.apiUrl));
|
|
1088
1089
|
if (hasBrowserSurface) scopes.add("browser");
|
|
1089
1090
|
if (hasApiSurface) scopes.add("api");
|
|
1090
1091
|
if (application.id === "cli" || application.id === "mcp" || application.id === "cloudcontrol") {
|
|
@@ -1270,10 +1271,11 @@ function statusRank(status) {
|
|
|
1270
1271
|
}
|
|
1271
1272
|
var DEFAULT_SERVICE_URLS = SERVICES;
|
|
1272
1273
|
function resolveServiceUrl(service, overrides) {
|
|
1273
|
-
|
|
1274
|
+
var _a;
|
|
1275
|
+
const override = overrides == null ? void 0 : overrides[service];
|
|
1274
1276
|
if (override) return override;
|
|
1275
1277
|
const envKey = `TOPOLO_SERVICE_URL_${service.replace(/\./g, "_").toUpperCase()}`;
|
|
1276
|
-
const envValue = typeof process !== "undefined" ? process.env
|
|
1278
|
+
const envValue = typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a[envKey] : void 0;
|
|
1277
1279
|
if (envValue) return envValue;
|
|
1278
1280
|
return DEFAULT_SERVICE_URLS[service];
|
|
1279
1281
|
}
|
|
@@ -1287,8 +1289,9 @@ var TopoloClient = class {
|
|
|
1287
1289
|
fetchImpl;
|
|
1288
1290
|
debug;
|
|
1289
1291
|
constructor(options) {
|
|
1292
|
+
var _a;
|
|
1290
1293
|
if (!options.credential) throw new TopoloAuthError("credential is required");
|
|
1291
|
-
if (!options.agent
|
|
1294
|
+
if (!((_a = options.agent) == null ? void 0 : _a.clientName)) throw new TopoloAuthError("agent.clientName is required");
|
|
1292
1295
|
this.credential = options.credential;
|
|
1293
1296
|
this.agent = options.agent;
|
|
1294
1297
|
this.serviceUrls = options.serviceUrls;
|
|
@@ -1476,6 +1479,7 @@ var CrmModule = class {
|
|
|
1476
1479
|
}
|
|
1477
1480
|
client;
|
|
1478
1481
|
async listContacts(options = {}) {
|
|
1482
|
+
var _a, _b, _c;
|
|
1479
1483
|
const res = await this.client.request({
|
|
1480
1484
|
service: "crm",
|
|
1481
1485
|
path: "/api/contacts",
|
|
@@ -1485,12 +1489,12 @@ var CrmModule = class {
|
|
|
1485
1489
|
pageSize: options.pageSize
|
|
1486
1490
|
}
|
|
1487
1491
|
});
|
|
1488
|
-
const rows = Array.isArray(res
|
|
1492
|
+
const rows = Array.isArray(res == null ? void 0 : res.contacts) ? res.contacts : Array.isArray(res == null ? void 0 : res.data) ? res.data : [];
|
|
1489
1493
|
return {
|
|
1490
1494
|
contacts: rows.map(toSummary),
|
|
1491
|
-
total: res
|
|
1492
|
-
page: res
|
|
1493
|
-
pageSize: res
|
|
1495
|
+
total: (res == null ? void 0 : res.total) ?? ((_a = res == null ? void 0 : res.pagination) == null ? void 0 : _a.total) ?? rows.length,
|
|
1496
|
+
page: (res == null ? void 0 : res.page) ?? ((_b = res == null ? void 0 : res.pagination) == null ? void 0 : _b.page) ?? options.page ?? 1,
|
|
1497
|
+
pageSize: (res == null ? void 0 : res.pageSize) ?? ((_c = res == null ? void 0 : res.pagination) == null ? void 0 : _c.pageSize) ?? options.pageSize ?? rows.length
|
|
1494
1498
|
};
|
|
1495
1499
|
}
|
|
1496
1500
|
async getContact(contactId) {
|
|
@@ -1620,9 +1624,6 @@ import { mkdir, readFile, writeFile, chmod } from "fs/promises";
|
|
|
1620
1624
|
import { existsSync } from "fs";
|
|
1621
1625
|
import { homedir, platform } from "os";
|
|
1622
1626
|
import { dirname, join } from "path";
|
|
1623
|
-
var BUILTIN_SERVICE_URL_OVERRIDES = {
|
|
1624
|
-
one: "https://one.topolo.app"
|
|
1625
|
-
};
|
|
1626
1627
|
function configPath() {
|
|
1627
1628
|
const override = process.env.TOPOLO_CONFIG_PATH;
|
|
1628
1629
|
if (override) return override;
|
|
@@ -1694,7 +1695,6 @@ function resolveAgentName(configAgentName) {
|
|
|
1694
1695
|
}
|
|
1695
1696
|
function resolveServiceUrls(configUrls) {
|
|
1696
1697
|
const merged = {
|
|
1697
|
-
...BUILTIN_SERVICE_URL_OVERRIDES,
|
|
1698
1698
|
...configUrls ?? {}
|
|
1699
1699
|
};
|
|
1700
1700
|
for (const [k, v] of Object.entries(process.env)) {
|
|
@@ -1948,7 +1948,7 @@ function sleep(ms) {
|
|
|
1948
1948
|
}
|
|
1949
1949
|
|
|
1950
1950
|
// src/version.ts
|
|
1951
|
-
var CLI_VERSION = "0.1.
|
|
1951
|
+
var CLI_VERSION = "0.1.15";
|
|
1952
1952
|
|
|
1953
1953
|
// src/client.ts
|
|
1954
1954
|
async function buildClient(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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": {
|