@topolo/cli 0.1.17 → 0.1.19
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 +41 -16
- package/package.json +2 -2
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);
|
|
@@ -78,6 +78,7 @@ var SERVICES = {
|
|
|
78
78
|
consent: "https://consent.topolo.app",
|
|
79
79
|
crm: "https://crm-api.topolo.app",
|
|
80
80
|
customer_success: "https://success.topolo.app",
|
|
81
|
+
developers: "https://developers.topolo.app",
|
|
81
82
|
director: "https://director.topolo.app",
|
|
82
83
|
feed: "https://feed-api.topolo.app",
|
|
83
84
|
flow: "https://flow.topolo.app",
|
|
@@ -117,6 +118,7 @@ var PLATFORM_SERVICE_IDS = {
|
|
|
117
118
|
consent: "srv_topolo_consent",
|
|
118
119
|
crm: "srv_iCwM4jGXcwlj",
|
|
119
120
|
customer_success: "srv_topolo_success",
|
|
121
|
+
developers: "svc_topolo_developers",
|
|
120
122
|
director: "srv_topolo_director",
|
|
121
123
|
flow: "srv_topolo_flow",
|
|
122
124
|
forms: "srv_topolo_forms",
|
|
@@ -557,7 +559,9 @@ var APPLICATIONS = {
|
|
|
557
559
|
"name": "topolo-developers",
|
|
558
560
|
"packageName": "topolo-developers",
|
|
559
561
|
"productionUrl": "https://developers.topolo.app",
|
|
560
|
-
"services": [
|
|
562
|
+
"services": [
|
|
563
|
+
"developers"
|
|
564
|
+
],
|
|
561
565
|
"deployTargets": [
|
|
562
566
|
{
|
|
563
567
|
"name": "topolo-catalog-cron",
|
|
@@ -569,13 +573,13 @@ var APPLICATIONS = {
|
|
|
569
573
|
},
|
|
570
574
|
{
|
|
571
575
|
"name": "topolo-developers",
|
|
572
|
-
"kind": "
|
|
573
|
-
"apiUrl":
|
|
576
|
+
"kind": "worker",
|
|
577
|
+
"apiUrl": "https://developers.topolo.app",
|
|
574
578
|
"domains": [
|
|
575
579
|
"developers.topolo.app"
|
|
576
580
|
],
|
|
577
581
|
"routes": [],
|
|
578
|
-
"serviceId":
|
|
582
|
+
"serviceId": "developers"
|
|
579
583
|
}
|
|
580
584
|
]
|
|
581
585
|
},
|
|
@@ -2695,7 +2699,28 @@ function sleep(ms) {
|
|
|
2695
2699
|
}
|
|
2696
2700
|
|
|
2697
2701
|
// src/version.ts
|
|
2698
|
-
|
|
2702
|
+
import { readFileSync } from "fs";
|
|
2703
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
2704
|
+
import { fileURLToPath } from "url";
|
|
2705
|
+
function readCliVersion() {
|
|
2706
|
+
try {
|
|
2707
|
+
const here = dirname2(fileURLToPath(import.meta.url));
|
|
2708
|
+
const candidates = [
|
|
2709
|
+
join2(here, "package.json"),
|
|
2710
|
+
join2(here, "..", "package.json")
|
|
2711
|
+
];
|
|
2712
|
+
for (const path4 of candidates) {
|
|
2713
|
+
try {
|
|
2714
|
+
const pkg = JSON.parse(readFileSync(path4, "utf8"));
|
|
2715
|
+
if (typeof pkg.version === "string" && pkg.version) return pkg.version;
|
|
2716
|
+
} catch {
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
} catch {
|
|
2720
|
+
}
|
|
2721
|
+
return "0.0.0";
|
|
2722
|
+
}
|
|
2723
|
+
var CLI_VERSION = readCliVersion();
|
|
2699
2724
|
|
|
2700
2725
|
// src/client.ts
|
|
2701
2726
|
async function buildClient(options) {
|
|
@@ -2934,14 +2959,14 @@ function parseQueryPairs(pairs) {
|
|
|
2934
2959
|
|
|
2935
2960
|
// src/commands/apps.ts
|
|
2936
2961
|
import { execSync } from "child_process";
|
|
2937
|
-
import { existsSync as existsSync3, mkdirSync, readFileSync as
|
|
2962
|
+
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
2938
2963
|
import path2 from "path";
|
|
2939
2964
|
|
|
2940
2965
|
// src/commands/app-audit-local.ts
|
|
2941
2966
|
import {
|
|
2942
2967
|
existsSync as existsSync2,
|
|
2943
2968
|
readdirSync,
|
|
2944
|
-
readFileSync,
|
|
2969
|
+
readFileSync as readFileSync2,
|
|
2945
2970
|
statSync
|
|
2946
2971
|
} from "fs";
|
|
2947
2972
|
import path from "path";
|
|
@@ -2950,7 +2975,7 @@ function readEvidenceFile(appRoot) {
|
|
|
2950
2975
|
const candidate = path.join(appRoot, ".topolo", "evidence.json");
|
|
2951
2976
|
if (!isFile(candidate)) return null;
|
|
2952
2977
|
try {
|
|
2953
|
-
const raw = JSON.parse(
|
|
2978
|
+
const raw = JSON.parse(readFileSync2(candidate, "utf8"));
|
|
2954
2979
|
if (raw && typeof raw === "object" && raw.version === 1) {
|
|
2955
2980
|
return raw;
|
|
2956
2981
|
}
|
|
@@ -3733,7 +3758,7 @@ function readSourceIndex(root) {
|
|
|
3733
3758
|
const files = collectSourceFiles(root, 4e3);
|
|
3734
3759
|
const chunks = files.map((file) => {
|
|
3735
3760
|
try {
|
|
3736
|
-
return
|
|
3761
|
+
return readFileSync2(file, "utf8");
|
|
3737
3762
|
} catch {
|
|
3738
3763
|
return "";
|
|
3739
3764
|
}
|
|
@@ -3793,7 +3818,7 @@ function sortedDirEntries(dir) {
|
|
|
3793
3818
|
function readJson(filePath) {
|
|
3794
3819
|
if (!isFile(filePath)) return null;
|
|
3795
3820
|
try {
|
|
3796
|
-
return JSON.parse(
|
|
3821
|
+
return JSON.parse(readFileSync2(filePath, "utf8"));
|
|
3797
3822
|
} catch {
|
|
3798
3823
|
return null;
|
|
3799
3824
|
}
|
|
@@ -3866,7 +3891,7 @@ function isFile(filePath) {
|
|
|
3866
3891
|
// src/commands/app-scaffold.ts
|
|
3867
3892
|
import { constants } from "fs";
|
|
3868
3893
|
import { access, mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
|
|
3869
|
-
import { dirname as
|
|
3894
|
+
import { dirname as dirname3, relative, resolve } from "path";
|
|
3870
3895
|
var CLOUDFLARE_ACCOUNT_ID = "49ef1ba682ad8cfd720c86699ae17521";
|
|
3871
3896
|
var STAGING_CLOUDFLARE_ACCOUNT_ID = "4f4e1c69a3830946f9fea7b1eb7531ac";
|
|
3872
3897
|
var CLOUDFLARE_COMPATIBILITY_DATE = "2026-05-05";
|
|
@@ -3973,7 +3998,7 @@ async function writeApplicationScaffold(payload, options = {}) {
|
|
|
3973
3998
|
const files = [];
|
|
3974
3999
|
for (const planned of plannedFiles) {
|
|
3975
4000
|
const existed = await pathExists(planned.absolutePath);
|
|
3976
|
-
await mkdir2(
|
|
4001
|
+
await mkdir2(dirname3(planned.absolutePath), { recursive: true });
|
|
3977
4002
|
await writeFile2(planned.absolutePath, planned.file.content, "utf8");
|
|
3978
4003
|
files.push({
|
|
3979
4004
|
path: planned.file.path,
|
|
@@ -6219,7 +6244,7 @@ function recordApplicationEvidence(application, options = {}) {
|
|
|
6219
6244
|
let before = null;
|
|
6220
6245
|
if (existsSync3(evidencePath)) {
|
|
6221
6246
|
try {
|
|
6222
|
-
const raw = JSON.parse(
|
|
6247
|
+
const raw = JSON.parse(readFileSync3(evidencePath, "utf8"));
|
|
6223
6248
|
if (raw && typeof raw === "object" && raw.version === 1) {
|
|
6224
6249
|
before = raw;
|
|
6225
6250
|
}
|
|
@@ -6495,7 +6520,7 @@ function statusesAtOrWorse(threshold) {
|
|
|
6495
6520
|
}
|
|
6496
6521
|
|
|
6497
6522
|
// src/commands/platform.ts
|
|
6498
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
6523
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync as statSync2 } from "fs";
|
|
6499
6524
|
import path3 from "path";
|
|
6500
6525
|
function registerPlatformCommand(program2) {
|
|
6501
6526
|
const platform3 = program2.command("platform").description("Internal Topolo first-party platform and personal app commands");
|
|
@@ -6621,7 +6646,7 @@ function scanStagingProductionUrls(rootInput, allowPatterns) {
|
|
|
6621
6646
|
function scanFile(filePath) {
|
|
6622
6647
|
if (shouldSkipFile(filePath)) return;
|
|
6623
6648
|
const relativePath = path3.relative(root, filePath);
|
|
6624
|
-
const content =
|
|
6649
|
+
const content = readFileSync4(filePath, "utf8");
|
|
6625
6650
|
const lines = content.split(/\r?\n/);
|
|
6626
6651
|
lines.forEach((line, index) => {
|
|
6627
6652
|
const matches = [...line.matchAll(PRODUCTION_TOPOLO_URL_PATTERN)].map((match) => match[0]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
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": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"commander": "^12.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@topolo/sdk": "^0.2.
|
|
24
|
+
"@topolo/sdk": "^0.2.11",
|
|
25
25
|
"@types/node": "^20.12.0",
|
|
26
26
|
"tsup": "^8.0.0",
|
|
27
27
|
"typescript": "^5.4.0",
|