@lumerahq/cli 0.24.2 → 0.24.3

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-A5T7SNOH.js").then((m) => m.plan(args.slice(1)));
230
+ await import("./resources-CCVVK3H2.js").then((m) => m.plan(args.slice(1)));
231
231
  break;
232
232
  case "apply":
233
- await import("./resources-A5T7SNOH.js").then((m) => m.apply(args.slice(1)));
233
+ await import("./resources-CCVVK3H2.js").then((m) => m.apply(args.slice(1)));
234
234
  break;
235
235
  case "pull":
236
- await import("./resources-A5T7SNOH.js").then((m) => m.pull(args.slice(1)));
236
+ await import("./resources-CCVVK3H2.js").then((m) => m.pull(args.slice(1)));
237
237
  break;
238
238
  case "destroy":
239
- await import("./resources-A5T7SNOH.js").then((m) => m.destroy(args.slice(1)));
239
+ await import("./resources-CCVVK3H2.js").then((m) => m.destroy(args.slice(1)));
240
240
  break;
241
241
  case "list":
242
- await import("./resources-A5T7SNOH.js").then((m) => m.list(args.slice(1)));
242
+ await import("./resources-CCVVK3H2.js").then((m) => m.list(args.slice(1)));
243
243
  break;
244
244
  case "show":
245
- await import("./resources-A5T7SNOH.js").then((m) => m.show(args.slice(1)));
245
+ await import("./resources-CCVVK3H2.js").then((m) => m.show(args.slice(1)));
246
246
  break;
247
247
  case "diff":
248
- await import("./resources-A5T7SNOH.js").then((m) => m.diff(args.slice(1)));
248
+ await import("./resources-CCVVK3H2.js").then((m) => m.diff(args.slice(1)));
249
249
  break;
250
250
  // Development
251
251
  case "dev":
@@ -10,6 +10,7 @@ import {
10
10
  import {
11
11
  ApiError,
12
12
  createApiClient,
13
+ isApiErrorStatus,
13
14
  validateCollectionNameLength
14
15
  } from "./chunk-FHHWIV4C.js";
15
16
  import {
@@ -1672,7 +1673,22 @@ async function planCollections(api, localCollections) {
1672
1673
  const remoteCollections = await api.listCollections();
1673
1674
  const remoteById = new Map(remoteCollections.map((c) => [c.id, c]));
1674
1675
  for (const local of localCollections) {
1675
- const remote = remoteById.get(local.id);
1676
+ let remote = remoteById.get(local.id);
1677
+ if (!remote) {
1678
+ const refs = [.../* @__PURE__ */ new Set([local.id, local.name])];
1679
+ for (const ref of refs) {
1680
+ try {
1681
+ const candidate = await api.getCollection(ref);
1682
+ const isExactLegacy = !candidate.managed && !candidate.project_id && (candidate.id === local.id || candidate.name === local.name);
1683
+ if (isExactLegacy) {
1684
+ remote = candidate;
1685
+ break;
1686
+ }
1687
+ } catch (error3) {
1688
+ if (!isApiErrorStatus(error3, 404)) throw error3;
1689
+ }
1690
+ }
1691
+ }
1676
1692
  if (!remote) {
1677
1693
  changes.push({
1678
1694
  type: "create",
@@ -1711,6 +1727,7 @@ async function planCollections(api, localCollections) {
1711
1727
  const auditChanged = local.audit !== void 0 && local.audit !== remote.audit;
1712
1728
  if (added.length > 0 || removed.length > 0 || modified.length > 0 || indexesChanged || searchChanged || auditChanged) {
1713
1729
  const details = [];
1730
+ if (!remote.project_id) details.push("legacy unscoped collection");
1714
1731
  if (added.length > 0) details.push(`+${added.length} field${added.length > 1 ? "s" : ""}`);
1715
1732
  if (removed.length > 0) details.push(`-${removed.length} field${removed.length > 1 ? "s" : ""}`);
1716
1733
  if (modified.length > 0) details.push(`~${modified.length} field${modified.length > 1 ? "s" : ""} (${modified.join(", ")})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {