@lumerahq/cli 0.24.2-dev.0 → 0.24.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/{auth-NI7JTMJM.js → auth-MJO5DFOF.js} +1 -1
- package/dist/{chunk-3ESHIPZH.js → chunk-7ZTCXKII.js} +2 -2
- package/dist/{chunk-HTPNRY3F.js → chunk-FHHWIV4C.js} +1 -1
- package/dist/{chunk-ZH3NVYEQ.js → chunk-JLVVHTBY.js} +27 -0
- package/dist/{chunk-I7QEYKS7.js → chunk-KBNM6R5X.js} +1 -1
- package/dist/{chunk-HU7RYLUF.js → chunk-VL5GDJKU.js} +1 -1
- package/dist/{deps-HWO6X5WM.js → deps-IYUORT55.js} +3 -3
- package/dist/{dev-VWHFYKGC.js → dev-N5CEEMFC.js} +4 -4
- package/dist/{flags-UZW4D2SO.js → flags-3KYOBHVA.js} +1 -1
- package/dist/index.js +25 -24
- package/dist/{init-RPJHBBWD.js → init-B4DXTC7L.js} +3 -3
- package/dist/{migrate-NCZKP7FM.js → migrate-NEG3HKH4.js} +1 -1
- package/dist/{register-OOU477QY.js → register-HRLBT4FI.js} +2 -2
- package/dist/{resources-7VQAR6F4.js → resources-A5T7SNOH.js} +33 -34
- package/dist/{run-DJXAXDD2.js → run-WHVUVIYB.js} +2 -2
- package/dist/{skills-REOKLNEF.js → skills-PXZHERAS.js} +2 -2
- package/dist/{status-X7WQYX2L.js → status-NPNIY3QP.js} +1 -1
- package/package.json +1 -1
- package/templates/default/_gitignore +0 -1
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createApiClient,
|
|
6
6
|
isApiErrorStatus
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FHHWIV4C.js";
|
|
8
8
|
import {
|
|
9
9
|
findProjectRoot,
|
|
10
10
|
getAppName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JLVVHTBY.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/deps.ts
|
|
14
14
|
import pc from "picocolors";
|
|
@@ -14,6 +14,9 @@ __export(auth_exports, {
|
|
|
14
14
|
import { existsSync, readFileSync } from "fs";
|
|
15
15
|
import { homedir } from "os";
|
|
16
16
|
import { join } from "path";
|
|
17
|
+
function getRuntimeCredsPath() {
|
|
18
|
+
return process.env.LUMERA_CREDENTIALS_PATH?.trim() || null;
|
|
19
|
+
}
|
|
17
20
|
function getLocalCredsPath(cwd = process.cwd()) {
|
|
18
21
|
return join(cwd, ".lumera", "credentials.json");
|
|
19
22
|
}
|
|
@@ -21,6 +24,14 @@ function getToken(cwd = process.cwd()) {
|
|
|
21
24
|
if (process.env.LUMERA_TOKEN) {
|
|
22
25
|
return process.env.LUMERA_TOKEN;
|
|
23
26
|
}
|
|
27
|
+
const runtimeCredsPath = getRuntimeCredsPath();
|
|
28
|
+
if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
|
|
29
|
+
try {
|
|
30
|
+
const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
|
|
31
|
+
if (creds.token) return creds.token;
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
24
35
|
const localCredsPath = getLocalCredsPath(cwd);
|
|
25
36
|
if (existsSync(localCredsPath)) {
|
|
26
37
|
try {
|
|
@@ -44,6 +55,14 @@ function getTokenSource(cwd = process.cwd()) {
|
|
|
44
55
|
if (process.env.LUMERA_TOKEN) {
|
|
45
56
|
return "environment (LUMERA_TOKEN)";
|
|
46
57
|
}
|
|
58
|
+
const runtimeCredsPath = getRuntimeCredsPath();
|
|
59
|
+
if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
|
|
60
|
+
try {
|
|
61
|
+
const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
|
|
62
|
+
if (creds.token) return `runtime (${runtimeCredsPath})`;
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
47
66
|
const localCredsPath = getLocalCredsPath(cwd);
|
|
48
67
|
if (existsSync(localCredsPath)) {
|
|
49
68
|
try {
|
|
@@ -62,6 +81,14 @@ function getTokenSource(cwd = process.cwd()) {
|
|
|
62
81
|
return null;
|
|
63
82
|
}
|
|
64
83
|
function getCredentials(cwd = process.cwd()) {
|
|
84
|
+
const runtimeCredsPath = getRuntimeCredsPath();
|
|
85
|
+
if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
|
|
86
|
+
try {
|
|
87
|
+
const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
|
|
88
|
+
if (creds.token) return creds;
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
65
92
|
const localCredsPath = getLocalCredsPath(cwd);
|
|
66
93
|
if (existsSync(localCredsPath)) {
|
|
67
94
|
try {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deps,
|
|
3
3
|
syncDeps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7ZTCXKII.js";
|
|
5
5
|
import "./chunk-2CR762KB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FHHWIV4C.js";
|
|
7
|
+
import "./chunk-JLVVHTBY.js";
|
|
8
8
|
import "./chunk-FJFIWC7G.js";
|
|
9
9
|
import "./chunk-PNKVD2UK.js";
|
|
10
10
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dev
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KBNM6R5X.js";
|
|
4
4
|
import {
|
|
5
5
|
syncDeps
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7ZTCXKII.js";
|
|
7
7
|
import {
|
|
8
8
|
loadEnv
|
|
9
9
|
} from "./chunk-2CR762KB.js";
|
|
10
10
|
import {
|
|
11
11
|
createApiClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FHHWIV4C.js";
|
|
13
13
|
import {
|
|
14
14
|
findProjectRoot,
|
|
15
15
|
getApiUrl,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
getAppTitle,
|
|
18
18
|
getToken,
|
|
19
19
|
init_auth
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JLVVHTBY.js";
|
|
21
21
|
import "./chunk-FJFIWC7G.js";
|
|
22
22
|
import "./chunk-PNKVD2UK.js";
|
|
23
23
|
|
|
@@ -6,7 +6,7 @@ import pc from "picocolors";
|
|
|
6
6
|
// src/lib/flags.ts
|
|
7
7
|
import { readFileSync, statSync } from "fs";
|
|
8
8
|
var ENV_PATH = "LUMERA_FEATURE_FLAGS_PATH";
|
|
9
|
-
var DEFAULT_PATH = "/
|
|
9
|
+
var DEFAULT_PATH = "/lumera_state/feature-flags/flags.json";
|
|
10
10
|
function flagsPath() {
|
|
11
11
|
return process.env[ENV_PATH] || DEFAULT_PATH;
|
|
12
12
|
}
|
package/dist/index.js
CHANGED
|
@@ -6,17 +6,18 @@ import "./chunk-PNKVD2UK.js";
|
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { readFileSync as readFileSync2 } from "fs";
|
|
9
|
-
import { dirname, join as join2 } from "path";
|
|
9
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
11
|
import pc from "picocolors";
|
|
12
12
|
|
|
13
13
|
// src/lib/update-check.ts
|
|
14
14
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
15
15
|
import { homedir } from "os";
|
|
16
|
-
import { join } from "path";
|
|
16
|
+
import { dirname, join } from "path";
|
|
17
17
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
18
18
|
function getCachePath() {
|
|
19
|
-
|
|
19
|
+
const stateRoot = process.env.LUMERA_STATE_DIR?.trim();
|
|
20
|
+
return stateRoot ? join(stateRoot, "cli", "update-check.json") : join(homedir(), ".lumera", "update-check.json");
|
|
20
21
|
}
|
|
21
22
|
function readCache() {
|
|
22
23
|
const cachePath = getCachePath();
|
|
@@ -28,7 +29,7 @@ function readCache() {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
function writeCache(data) {
|
|
31
|
-
const dir =
|
|
32
|
+
const dir = dirname(getCachePath());
|
|
32
33
|
mkdirSync(dir, { recursive: true });
|
|
33
34
|
writeFileSync(getCachePath(), JSON.stringify(data));
|
|
34
35
|
}
|
|
@@ -69,7 +70,7 @@ async function checkForUpdate(currentVersion) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
// src/index.ts
|
|
72
|
-
var __dirname =
|
|
73
|
+
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
73
74
|
var pkg = JSON.parse(readFileSync2(join2(__dirname, "..", "package.json"), "utf-8"));
|
|
74
75
|
var VERSION = pkg.version;
|
|
75
76
|
var rawArgs = process.argv.slice(2);
|
|
@@ -226,70 +227,70 @@ async function main() {
|
|
|
226
227
|
switch (command) {
|
|
227
228
|
// Resource commands
|
|
228
229
|
case "plan":
|
|
229
|
-
await import("./resources-
|
|
230
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.plan(args.slice(1)));
|
|
230
231
|
break;
|
|
231
232
|
case "apply":
|
|
232
|
-
await import("./resources-
|
|
233
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.apply(args.slice(1)));
|
|
233
234
|
break;
|
|
234
235
|
case "pull":
|
|
235
|
-
await import("./resources-
|
|
236
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.pull(args.slice(1)));
|
|
236
237
|
break;
|
|
237
238
|
case "destroy":
|
|
238
|
-
await import("./resources-
|
|
239
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.destroy(args.slice(1)));
|
|
239
240
|
break;
|
|
240
241
|
case "list":
|
|
241
|
-
await import("./resources-
|
|
242
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.list(args.slice(1)));
|
|
242
243
|
break;
|
|
243
244
|
case "show":
|
|
244
|
-
await import("./resources-
|
|
245
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.show(args.slice(1)));
|
|
245
246
|
break;
|
|
246
247
|
case "diff":
|
|
247
|
-
await import("./resources-
|
|
248
|
+
await import("./resources-A5T7SNOH.js").then((m) => m.diff(args.slice(1)));
|
|
248
249
|
break;
|
|
249
250
|
// Development
|
|
250
251
|
case "dev":
|
|
251
|
-
await import("./dev-
|
|
252
|
+
await import("./dev-N5CEEMFC.js").then((m) => m.dev(args.slice(1)));
|
|
252
253
|
break;
|
|
253
254
|
case "run":
|
|
254
|
-
await import("./run-
|
|
255
|
+
await import("./run-WHVUVIYB.js").then((m) => m.run(args.slice(1)));
|
|
255
256
|
break;
|
|
256
257
|
// Project
|
|
257
258
|
case "init":
|
|
258
|
-
await import("./init-
|
|
259
|
+
await import("./init-B4DXTC7L.js").then((m) => m.init(args.slice(1)));
|
|
259
260
|
break;
|
|
260
261
|
case "register":
|
|
261
|
-
await import("./register-
|
|
262
|
+
await import("./register-HRLBT4FI.js").then((m) => m.register(args.slice(1)));
|
|
262
263
|
break;
|
|
263
264
|
case "templates":
|
|
264
265
|
await import("./templates-LNUOTNLN.js").then((m) => m.templates(subcommand, args.slice(2)));
|
|
265
266
|
break;
|
|
266
267
|
case "status":
|
|
267
|
-
await import("./status-
|
|
268
|
+
await import("./status-NPNIY3QP.js").then((m) => m.status(args.slice(1)));
|
|
268
269
|
break;
|
|
269
270
|
case "migrate":
|
|
270
|
-
await import("./migrate-
|
|
271
|
+
await import("./migrate-NEG3HKH4.js").then((m) => m.migrate(args.slice(1)));
|
|
271
272
|
break;
|
|
272
273
|
// Skills
|
|
273
274
|
case "skills":
|
|
274
|
-
await import("./skills-
|
|
275
|
+
await import("./skills-PXZHERAS.js").then((m) => m.skills(subcommand, args.slice(2)));
|
|
275
276
|
break;
|
|
276
277
|
// Dependencies
|
|
277
278
|
case "deps":
|
|
278
|
-
await import("./deps-
|
|
279
|
+
await import("./deps-IYUORT55.js").then((m) => m.deps(args.slice(1)));
|
|
279
280
|
break;
|
|
280
281
|
// Feature flags (read the in-sandbox snapshot)
|
|
281
282
|
case "flags":
|
|
282
|
-
await import("./flags-
|
|
283
|
+
await import("./flags-3KYOBHVA.js").then((m) => m.flags(subcommand, args.slice(2)));
|
|
283
284
|
break;
|
|
284
285
|
// Auth
|
|
285
286
|
case "login":
|
|
286
|
-
await import("./auth-
|
|
287
|
+
await import("./auth-MJO5DFOF.js").then((m) => m.login(args.slice(1)));
|
|
287
288
|
break;
|
|
288
289
|
case "logout":
|
|
289
|
-
await import("./auth-
|
|
290
|
+
await import("./auth-MJO5DFOF.js").then((m) => m.logout(args.slice(1)));
|
|
290
291
|
break;
|
|
291
292
|
case "whoami":
|
|
292
|
-
await import("./auth-
|
|
293
|
+
await import("./auth-MJO5DFOF.js").then((m) => m.whoami());
|
|
293
294
|
break;
|
|
294
295
|
// Convenience aliases
|
|
295
296
|
case "help":
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installAllSkills,
|
|
3
3
|
syncClaudeMd
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VL5GDJKU.js";
|
|
5
5
|
import {
|
|
6
6
|
spinner
|
|
7
7
|
} from "./chunk-BHYDYR75.js";
|
|
8
8
|
import {
|
|
9
9
|
createApiClient,
|
|
10
10
|
validateProjectNameLength
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FHHWIV4C.js";
|
|
12
12
|
import {
|
|
13
13
|
getToken,
|
|
14
14
|
init_auth,
|
|
15
15
|
setProjectId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JLVVHTBY.js";
|
|
17
17
|
import "./chunk-FJFIWC7G.js";
|
|
18
18
|
import {
|
|
19
19
|
listAllTemplates,
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
createApiClient,
|
|
9
9
|
validateProjectExternalId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FHHWIV4C.js";
|
|
11
11
|
import {
|
|
12
12
|
findProjectRoot,
|
|
13
13
|
getAppName,
|
|
14
14
|
getProjectId,
|
|
15
15
|
setProjectId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JLVVHTBY.js";
|
|
17
17
|
import "./chunk-FJFIWC7G.js";
|
|
18
18
|
import "./chunk-PNKVD2UK.js";
|
|
19
19
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deploy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KBNM6R5X.js";
|
|
4
4
|
import {
|
|
5
5
|
syncDeps
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7ZTCXKII.js";
|
|
7
7
|
import {
|
|
8
8
|
loadEnv
|
|
9
9
|
} from "./chunk-2CR762KB.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ApiError,
|
|
12
12
|
createApiClient,
|
|
13
13
|
validateCollectionNameLength
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FHHWIV4C.js";
|
|
15
15
|
import {
|
|
16
16
|
findProjectRoot,
|
|
17
17
|
getApiUrl,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getProjectId,
|
|
21
21
|
getToken,
|
|
22
22
|
init_auth
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JLVVHTBY.js";
|
|
24
24
|
import {
|
|
25
25
|
fetchWithRetry
|
|
26
26
|
} from "./chunk-FJFIWC7G.js";
|
|
@@ -182,14 +182,6 @@ var collectionSchemaRule = {
|
|
|
182
182
|
}
|
|
183
183
|
if (!Array.isArray(index.fields) || !index.fields.every((field) => typeof field === "string" && field.trim() !== "")) {
|
|
184
184
|
issues.push(error(target, `Index at index ${i} must include a non-empty string array "fields".`));
|
|
185
|
-
} else if (index.fields.length === 1) {
|
|
186
|
-
const fieldName = index.fields[0].trim().toLowerCase();
|
|
187
|
-
if (fieldName === "updated" || fieldName === "external_id") {
|
|
188
|
-
issues.push(error(
|
|
189
|
-
target,
|
|
190
|
-
`Index at index ${i} declares system field "${fieldName}" by itself; Lumera already manages that index. Remove the redundant declaration.`
|
|
191
|
-
));
|
|
192
|
-
}
|
|
193
185
|
}
|
|
194
186
|
}
|
|
195
187
|
}
|
|
@@ -905,13 +897,6 @@ function stripNamespacePrefix(name, appName) {
|
|
|
905
897
|
}
|
|
906
898
|
return name;
|
|
907
899
|
}
|
|
908
|
-
function buildIndexSql(local, idx, appName) {
|
|
909
|
-
const fields = idx.fields.join(", ");
|
|
910
|
-
const unique = idx.unique ? "UNIQUE " : "";
|
|
911
|
-
const physicalId = appName ? sanitizeSlugForCollectionName(appName) + NAMESPACE_SEPARATOR + local.id : local.id;
|
|
912
|
-
const indexName = `idx_${physicalId}_${idx.fields.join("_")}`;
|
|
913
|
-
return `CREATE ${unique}INDEX ${indexName} ON ${local.name} (${fields})`;
|
|
914
|
-
}
|
|
915
900
|
var AGENT_IDLE_REAP_TIMEOUT_MIN_SECONDS = 10;
|
|
916
901
|
var AGENT_IDLE_REAP_TIMEOUT_MAX_SECONDS = 900;
|
|
917
902
|
function buildCollectionIdMap(collections, appName) {
|
|
@@ -1530,7 +1515,7 @@ function loadLocalHooks(platformDir, filterName, appName) {
|
|
|
1530
1515
|
}
|
|
1531
1516
|
return hooks;
|
|
1532
1517
|
}
|
|
1533
|
-
function convertCollectionToApiFormat(local
|
|
1518
|
+
function convertCollectionToApiFormat(local) {
|
|
1534
1519
|
const schema = local.fields.map((field) => {
|
|
1535
1520
|
const apiField = {
|
|
1536
1521
|
name: field.name,
|
|
@@ -1559,7 +1544,12 @@ function convertCollectionToApiFormat(local, appName) {
|
|
|
1559
1544
|
}
|
|
1560
1545
|
return apiField;
|
|
1561
1546
|
});
|
|
1562
|
-
const indexes = local.indexes?.map((idx) =>
|
|
1547
|
+
const indexes = local.indexes?.map((idx) => {
|
|
1548
|
+
const fields = idx.fields.join(", ");
|
|
1549
|
+
const unique = idx.unique ? "UNIQUE " : "";
|
|
1550
|
+
const indexName = `idx_${local.id}_${idx.fields.join("_")}`;
|
|
1551
|
+
return `CREATE ${unique}INDEX ${indexName} ON ${local.name} (${fields})`;
|
|
1552
|
+
});
|
|
1563
1553
|
return {
|
|
1564
1554
|
id: local.id,
|
|
1565
1555
|
name: local.name,
|
|
@@ -1632,15 +1622,24 @@ function fieldsDiffer(local, remote) {
|
|
|
1632
1622
|
if (localMax !== remoteMax) return true;
|
|
1633
1623
|
return false;
|
|
1634
1624
|
}
|
|
1635
|
-
function localIndexesToSql(local
|
|
1625
|
+
function localIndexesToSql(local) {
|
|
1636
1626
|
if (!local.indexes || local.indexes.length === 0) return [];
|
|
1637
|
-
return local.indexes.map((idx) =>
|
|
1627
|
+
return local.indexes.map((idx) => {
|
|
1628
|
+
const fields = idx.fields.join(", ");
|
|
1629
|
+
const unique = idx.unique ? "UNIQUE " : "";
|
|
1630
|
+
const indexName = `idx_${local.id}_${idx.fields.join("_")}`;
|
|
1631
|
+
return `CREATE ${unique}INDEX ${indexName} ON ${local.name} (${fields})`;
|
|
1632
|
+
}).sort();
|
|
1638
1633
|
}
|
|
1639
1634
|
function normalizeRemoteIndexes(remoteIndexes) {
|
|
1640
|
-
return
|
|
1635
|
+
return remoteIndexes.filter((idx) => {
|
|
1636
|
+
const lower = idx.toLowerCase();
|
|
1637
|
+
if (lower.includes("external_id") || lower.includes("updated")) return false;
|
|
1638
|
+
return true;
|
|
1639
|
+
}).sort();
|
|
1641
1640
|
}
|
|
1642
|
-
function indexesDiffer(local, remoteIndexes
|
|
1643
|
-
const localSql = localIndexesToSql(local
|
|
1641
|
+
function indexesDiffer(local, remoteIndexes) {
|
|
1642
|
+
const localSql = localIndexesToSql(local);
|
|
1644
1643
|
const remoteSql = normalizeRemoteIndexes(remoteIndexes);
|
|
1645
1644
|
if (localSql.length !== remoteSql.length) return true;
|
|
1646
1645
|
for (let i = 0; i < localSql.length; i++) {
|
|
@@ -1668,7 +1667,7 @@ function normalizeCollectionSearch(search) {
|
|
|
1668
1667
|
} : {}
|
|
1669
1668
|
});
|
|
1670
1669
|
}
|
|
1671
|
-
async function planCollections(api, localCollections
|
|
1670
|
+
async function planCollections(api, localCollections) {
|
|
1672
1671
|
const changes = [];
|
|
1673
1672
|
const remoteCollections = await api.listCollections();
|
|
1674
1673
|
const remoteById = new Map(remoteCollections.map((c) => [c.id, c]));
|
|
@@ -1707,7 +1706,7 @@ async function planCollections(api, localCollections, appName) {
|
|
|
1707
1706
|
modified.push(name);
|
|
1708
1707
|
}
|
|
1709
1708
|
}
|
|
1710
|
-
const indexesChanged = indexesDiffer(local, remote.indexes || []
|
|
1709
|
+
const indexesChanged = indexesDiffer(local, remote.indexes || []);
|
|
1711
1710
|
const searchChanged = normalizeCollectionSearch(local.search) !== normalizeCollectionSearch(remote.search);
|
|
1712
1711
|
const auditChanged = local.audit !== void 0 && local.audit !== remote.audit;
|
|
1713
1712
|
if (added.length > 0 || removed.length > 0 || modified.length > 0 || indexesChanged || searchChanged || auditChanged) {
|
|
@@ -1976,7 +1975,7 @@ async function planHooks(api, localHooks, collections, projectId) {
|
|
|
1976
1975
|
}
|
|
1977
1976
|
return changes;
|
|
1978
1977
|
}
|
|
1979
|
-
async function applyCollections(api, localCollections
|
|
1978
|
+
async function applyCollections(api, localCollections) {
|
|
1980
1979
|
let errors = 0;
|
|
1981
1980
|
const hasRelations = localCollections.some((c) => c.fields.some((f) => f.type === "relation"));
|
|
1982
1981
|
if (hasRelations) {
|
|
@@ -1993,7 +1992,7 @@ async function applyCollections(api, localCollections, appName) {
|
|
|
1993
1992
|
}
|
|
1994
1993
|
for (const local of localCollections) {
|
|
1995
1994
|
if (pass1Failed.has(local.name)) continue;
|
|
1996
|
-
const apiFormat = convertCollectionToApiFormat(local
|
|
1995
|
+
const apiFormat = convertCollectionToApiFormat(local);
|
|
1997
1996
|
try {
|
|
1998
1997
|
await api.ensureCollection(local.name, apiFormat);
|
|
1999
1998
|
console.log(pc2.green(" \u2713"), `${local.name} (schema)`);
|
|
@@ -2004,7 +2003,7 @@ async function applyCollections(api, localCollections, appName) {
|
|
|
2004
2003
|
}
|
|
2005
2004
|
} else {
|
|
2006
2005
|
for (const local of localCollections) {
|
|
2007
|
-
const apiFormat = convertCollectionToApiFormat(local
|
|
2006
|
+
const apiFormat = convertCollectionToApiFormat(local);
|
|
2008
2007
|
try {
|
|
2009
2008
|
await api.ensureCollection(local.name, apiFormat);
|
|
2010
2009
|
console.log(pc2.green(" \u2713"), `${local.name}`);
|
|
@@ -3266,7 +3265,7 @@ async function plan(args) {
|
|
|
3266
3265
|
if (!type || type === "collections") {
|
|
3267
3266
|
const localCollections = loadLocalCollections(platformDir, name || void 0);
|
|
3268
3267
|
if (localCollections.length > 0) {
|
|
3269
|
-
const changes = await planCollections(api, localCollections
|
|
3268
|
+
const changes = await planCollections(api, localCollections);
|
|
3270
3269
|
allChanges.push(...changes);
|
|
3271
3270
|
}
|
|
3272
3271
|
}
|
|
@@ -3413,7 +3412,7 @@ async function apply(args) {
|
|
|
3413
3412
|
const localHooks = !type || type === "hooks" ? loadLocalHooks(platformDir, name || void 0, appName) : [];
|
|
3414
3413
|
const localAgents = !type || type === "agents" ? loadLocalAgents(platformDir, name || void 0, appName) : [];
|
|
3415
3414
|
const localMailboxes = !type || type === "mailboxes" ? loadLocalMailboxes(platformDir, name || void 0) : [];
|
|
3416
|
-
if (localCollections.length > 0) allChanges.push(...await planCollections(api, localCollections
|
|
3415
|
+
if (localCollections.length > 0) allChanges.push(...await planCollections(api, localCollections));
|
|
3417
3416
|
if (localAutomations.length > 0) allChanges.push(...await planAutomations(api, localAutomations, projectId));
|
|
3418
3417
|
if (localHooks.length > 0) allChanges.push(...await planHooks(api, localHooks, collections, projectId));
|
|
3419
3418
|
if (localAgents.length > 0) allChanges.push(...await planAgents(api, localAgents, projectId));
|
|
@@ -3488,7 +3487,7 @@ async function apply(args) {
|
|
|
3488
3487
|
let totalSkipped = 0;
|
|
3489
3488
|
if (localCollections.length > 0) {
|
|
3490
3489
|
console.log(pc2.bold(" Collections:"));
|
|
3491
|
-
totalErrors += await applyCollections(api, localCollections
|
|
3490
|
+
totalErrors += await applyCollections(api, localCollections);
|
|
3492
3491
|
console.log();
|
|
3493
3492
|
}
|
|
3494
3493
|
try {
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-2CR762KB.js";
|
|
4
4
|
import {
|
|
5
5
|
createApiClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHHWIV4C.js";
|
|
7
7
|
import {
|
|
8
8
|
findProjectRoot,
|
|
9
9
|
getApiUrl,
|
|
10
10
|
getAppName,
|
|
11
11
|
getToken,
|
|
12
12
|
init_auth
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JLVVHTBY.js";
|
|
14
14
|
import {
|
|
15
15
|
fetchWithRetry
|
|
16
16
|
} from "./chunk-FJFIWC7G.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
slugToDirName,
|
|
9
9
|
slugToFilename,
|
|
10
10
|
syncClaudeMd
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VL5GDJKU.js";
|
|
12
|
+
import "./chunk-JLVVHTBY.js";
|
|
13
13
|
import "./chunk-FJFIWC7G.js";
|
|
14
14
|
import "./chunk-PNKVD2UK.js";
|
|
15
15
|
|
package/package.json
CHANGED