@camstack/core 0.1.32 → 0.1.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"auth-schema.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/auth-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,eAAO,MAAM,gBAAgB,UAAU,CAAA;AACvC,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAC7C,eAAO,MAAM,wBAAwB,kBAAkB,CAAA;AAqCvD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjF"}
1
+ {"version":3,"file":"auth-schema.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/auth-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,eAAO,MAAM,gBAAgB,UAAU,CAAA;AACvC,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAC7C,eAAO,MAAM,wBAAwB,kBAAkB,CAAA;AA4CvD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjF"}
@@ -12,12 +12,6 @@ export declare class LocalAuthAddon extends BaseAddon<LocalAuthConfig> {
12
12
  constructor();
13
13
  protected onInitialize(): Promise<ProviderRegistration[]>;
14
14
  protected onShutdown(): Promise<void>;
15
- /**
16
- * Caps-only auth migration — rewrites legacy `super_admin` rows to
17
- * `admin` and backfills the missing `scopes` field with `[]`. Idempotent;
18
- * a re-run sees no rows needing changes.
19
- */
20
- private migrateLegacyUserRecords;
21
15
  }
22
16
  export default LocalAuthAddon;
23
17
  //# sourceMappingURL=local-auth.addon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-auth.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/local-auth.addon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAA2B,oBAAoB,EAAuB,MAAM,iBAAiB,CAAA;AACzG,OAAO,EAAE,SAAS,EAAoD,MAAM,iBAAiB,CAAA;AA4B7F,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,kBAAkB,CAAkC;;cAI5C,YAAY,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;cA8O/C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3C;;;;OAIG;YACW,wBAAwB;CAwBvC;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"local-auth.addon.d.ts","sourceRoot":"","sources":["../../../src/builtins/local-auth/local-auth.addon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,SAAS,EAAoD,MAAM,iBAAiB,CAAA;AA4B7F,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,kBAAkB,CAAkC;;cAI5C,YAAY,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;cAoO/C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5C;AAED,eAAe,cAAc,CAAA"}
@@ -6598,6 +6598,10 @@ var USERS_COLUMNS = [
6598
6598
  name: "allowedDevices",
6599
6599
  type: "JSON"
6600
6600
  },
6601
+ {
6602
+ name: "scopes",
6603
+ type: "JSON"
6604
+ },
6601
6605
  {
6602
6606
  name: "createdAt",
6603
6607
  type: "INTEGER",
@@ -6777,11 +6781,6 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
6777
6781
  this.apiKeyManager = new ApiKeyManager(storageAccess, this.authManager);
6778
6782
  this.scopedTokenManager = new ScopedTokenManager(store);
6779
6783
  try {
6780
- try {
6781
- await this.migrateLegacyUserRecords(store);
6782
- } catch (err) {
6783
- this.ctx.logger.warn("caps-only migration pass failed; legacy super_admin rows may still exist", { meta: { error: err instanceof Error ? err.message : String(err) } });
6784
- }
6785
6784
  await this.userManager.ensureAdminExists();
6786
6785
  const liveUsers = await this.userManager.listAll();
6787
6786
  const liveIds = new Set(liveUsers.map((u) => u.id));
@@ -6913,32 +6912,6 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
6913
6912
  this.apiKeyManager = null;
6914
6913
  this.scopedTokenManager = null;
6915
6914
  }
6916
- /**
6917
- * Caps-only auth migration — rewrites legacy `super_admin` rows to
6918
- * `admin` and backfills the missing `scopes` field with `[]`. Idempotent;
6919
- * a re-run sees no rows needing changes.
6920
- */
6921
- async migrateLegacyUserRecords(store) {
6922
- const results = await store.query.query({ collection: "users" });
6923
- let migrated = 0;
6924
- for (const row of results) {
6925
- const data = row.data;
6926
- const needsRoleRewrite = (typeof data["role"] === "string" ? data["role"] : null) === "super_admin";
6927
- const needsScopesBackfill = !("scopes" in data);
6928
- if (!needsRoleRewrite && !needsScopesBackfill) continue;
6929
- const next = { ...data };
6930
- if (needsRoleRewrite) next["role"] = "admin";
6931
- if (needsScopesBackfill) next["scopes"] = [];
6932
- next["updatedAt"] = Date.now();
6933
- await store.update.mutate({
6934
- collection: "users",
6935
- id: row.id,
6936
- data: next
6937
- });
6938
- migrated++;
6939
- }
6940
- if (migrated > 0) this.ctx.logger.info("caps-only auth migration: rewrote legacy user records", { meta: { count: migrated } });
6941
- }
6942
6915
  };
6943
6916
  //#endregion
6944
6917
  exports.ApiKeyManager = ApiKeyManager;