@lumerahq/cli 0.24.5 → 0.24.6
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
CHANGED
|
@@ -227,25 +227,25 @@ async function main() {
|
|
|
227
227
|
switch (command) {
|
|
228
228
|
// Resource commands
|
|
229
229
|
case "plan":
|
|
230
|
-
await import("./resources-
|
|
230
|
+
await import("./resources-R53XKJL2.js").then((m) => m.plan(args.slice(1)));
|
|
231
231
|
break;
|
|
232
232
|
case "apply":
|
|
233
|
-
await import("./resources-
|
|
233
|
+
await import("./resources-R53XKJL2.js").then((m) => m.apply(args.slice(1)));
|
|
234
234
|
break;
|
|
235
235
|
case "pull":
|
|
236
|
-
await import("./resources-
|
|
236
|
+
await import("./resources-R53XKJL2.js").then((m) => m.pull(args.slice(1)));
|
|
237
237
|
break;
|
|
238
238
|
case "destroy":
|
|
239
|
-
await import("./resources-
|
|
239
|
+
await import("./resources-R53XKJL2.js").then((m) => m.destroy(args.slice(1)));
|
|
240
240
|
break;
|
|
241
241
|
case "list":
|
|
242
|
-
await import("./resources-
|
|
242
|
+
await import("./resources-R53XKJL2.js").then((m) => m.list(args.slice(1)));
|
|
243
243
|
break;
|
|
244
244
|
case "show":
|
|
245
|
-
await import("./resources-
|
|
245
|
+
await import("./resources-R53XKJL2.js").then((m) => m.show(args.slice(1)));
|
|
246
246
|
break;
|
|
247
247
|
case "diff":
|
|
248
|
-
await import("./resources-
|
|
248
|
+
await import("./resources-R53XKJL2.js").then((m) => m.diff(args.slice(1)));
|
|
249
249
|
break;
|
|
250
250
|
// Development
|
|
251
251
|
case "dev":
|
|
@@ -1667,10 +1667,12 @@ function normalizeCollectionSearch(search) {
|
|
|
1667
1667
|
} : {}
|
|
1668
1668
|
});
|
|
1669
1669
|
}
|
|
1670
|
-
async function planCollections(api, localCollections, appName) {
|
|
1670
|
+
async function planCollections(api, localCollections, appName, projectId) {
|
|
1671
1671
|
const changes = [];
|
|
1672
1672
|
const remoteCollections = await api.listCollections();
|
|
1673
|
-
const remoteById = new Map(
|
|
1673
|
+
const remoteById = new Map(
|
|
1674
|
+
remoteCollections.filter((collection) => !projectId || !collection.project_id || collection.project_id === projectId).map((collection) => [collection.id, collection])
|
|
1675
|
+
);
|
|
1674
1676
|
for (const local of localCollections) {
|
|
1675
1677
|
let remote = remoteById.get(local.id);
|
|
1676
1678
|
if (!remote) {
|
|
@@ -1684,7 +1686,7 @@ async function planCollections(api, localCollections, appName) {
|
|
|
1684
1686
|
break;
|
|
1685
1687
|
}
|
|
1686
1688
|
} catch (error3) {
|
|
1687
|
-
if (!isApiErrorStatus(error3, 404)) throw error3;
|
|
1689
|
+
if (!isApiErrorStatus(error3, 404) && !isApiErrorStatus(error3, 403)) throw error3;
|
|
1688
1690
|
}
|
|
1689
1691
|
}
|
|
1690
1692
|
}
|
|
@@ -3281,7 +3283,7 @@ async function plan(args) {
|
|
|
3281
3283
|
if (!type || type === "collections") {
|
|
3282
3284
|
const localCollections = loadLocalCollections(platformDir, name || void 0);
|
|
3283
3285
|
if (localCollections.length > 0) {
|
|
3284
|
-
const changes = await planCollections(api, localCollections, appName);
|
|
3286
|
+
const changes = await planCollections(api, localCollections, appName, projectId);
|
|
3285
3287
|
allChanges.push(...changes);
|
|
3286
3288
|
}
|
|
3287
3289
|
}
|
|
@@ -3428,7 +3430,7 @@ async function apply(args) {
|
|
|
3428
3430
|
const localHooks = !type || type === "hooks" ? loadLocalHooks(platformDir, name || void 0, appName) : [];
|
|
3429
3431
|
const localAgents = !type || type === "agents" ? loadLocalAgents(platformDir, name || void 0, appName) : [];
|
|
3430
3432
|
const localMailboxes = !type || type === "mailboxes" ? loadLocalMailboxes(platformDir, name || void 0) : [];
|
|
3431
|
-
if (localCollections.length > 0) allChanges.push(...await planCollections(api, localCollections, appName));
|
|
3433
|
+
if (localCollections.length > 0) allChanges.push(...await planCollections(api, localCollections, appName, projectId));
|
|
3432
3434
|
if (localAutomations.length > 0) allChanges.push(...await planAutomations(api, localAutomations, projectId));
|
|
3433
3435
|
if (localHooks.length > 0) allChanges.push(...await planHooks(api, localHooks, collections, projectId));
|
|
3434
3436
|
if (localAgents.length > 0) allChanges.push(...await planAgents(api, localAgents, projectId));
|