@camstack/addon-auth 1.2.155 → 1.2.157

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.
@@ -5546,7 +5546,7 @@ var ZodIssueCode = {
5546
5546
  var ZodFirstPartyTypeKind;
5547
5547
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5548
5548
  //#endregion
5549
- //#region ../types/dist/sleep-BSuCCFjf.mjs
5549
+ //#region ../types/dist/sleep-CSuN0thG.mjs
5550
5550
  /**
5551
5551
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5552
5552
  * window to float samples (D455).
@@ -8164,7 +8164,13 @@ var RecordKindDeclarationSchema = object({
8164
8164
  secretPaths: array(string().min(1)).default([]),
8165
8165
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8166
8166
  secretArrayKeys: record(string(), string()).default({}),
8167
- /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
8167
+ /**
8168
+ * RETIRED (D900): the legacy table a kind adopted from during the records
8169
+ * migration. Nothing declares it any more and nothing reads it; the schema
8170
+ * still ACCEPTS it because the catalog rows the migration wrote carry it
8171
+ * (an orphaned kind is never redeclared) and an addon built before the
8172
+ * removal still sends it. Never set it.
8173
+ */
8168
8174
  adoptsFrom: string().min(1).optional(),
8169
8175
  /** Kinds that must agree through `transact` sit in one file under one family name. */
8170
8176
  transactFamily: string().min(1).optional(),
@@ -8239,7 +8245,6 @@ function defineRecordKinds(specs) {
8239
8245
  maxDataBytes: spec.maxDataBytes,
8240
8246
  secretPaths: [...secretPaths],
8241
8247
  secretArrayKeys: spec.secretArrayKeys === void 0 ? void 0 : { ...spec.secretArrayKeys },
8242
- adoptsFrom: spec.adoptsFrom,
8243
8248
  transactFamily: spec.transactFamily,
8244
8249
  entry: spec.entry === void 0 ? void 0 : {
8245
8250
  title: spec.entry.title,
@@ -8269,7 +8274,6 @@ function defineEntryKind(name, spec) {
8269
8274
  ...spec.database === void 0 ? {} : { database: spec.database },
8270
8275
  ...spec.indexes === void 0 ? {} : { indexes: spec.indexes },
8271
8276
  ...spec.secretArrayKeys === void 0 ? {} : { secretArrayKeys: spec.secretArrayKeys },
8272
- ...spec.adoptsFrom === void 0 ? {} : { adoptsFrom: spec.adoptsFrom },
8273
8277
  entry: {
8274
8278
  title: spec.title,
8275
8279
  ...spec.nameField === void 0 ? {} : { nameField: spec.nameField }
@@ -8278,15 +8282,6 @@ function defineEntryKind(name, spec) {
8278
8282
  if (defined === void 0) throw new DeclarationRefusedError(`entry kind "${name}" was not built`);
8279
8283
  return defined;
8280
8284
  }
8281
- /**
8282
- * Legacy source for entry adoption (B3): a list stored under addon-settings
8283
- * `<addonId>.<key>` until records-adopt copies rows into the entry kind.
8284
- */
8285
- var SETTINGS_ARRAY_ADOPTS_PREFIX = "@settings-array/";
8286
- /** The `adoptsFrom` value for an addon-settings array field. */
8287
- function settingsArrayAdoptsFrom(addonId, settingsKey) {
8288
- return `${SETTINGS_ARRAY_ADOPTS_PREFIX}${addonId}/${settingsKey}`;
8289
- }
8290
8285
  /** Shared Zod schemas used across streaming capabilities. */
8291
8286
  var CamProfileSchema = _enum([
8292
8287
  "high",
@@ -17217,11 +17212,12 @@ var DeclareKindResultSchema = object({
17217
17212
  kindId: number().int(),
17218
17213
  state: RecordKindStateSchema,
17219
17214
  createdIndexes: array(string()),
17220
- /** The boot guard: the kind is empty while its legacy table still holds rows. */
17221
- adoptionPending: object({
17222
- legacyTable: string(),
17223
- legacyRows: number().int()
17224
- }).nullable()
17215
+ /**
17216
+ * RETIRED (D900): always `null`. It carried the records-migration boot guard;
17217
+ * it stays on the wire, null, because an addon built before the removal reads
17218
+ * an ABSENT field as "adoption pending" and refuses to start.
17219
+ */
17220
+ adoptionPending: _null()
17225
17221
  });
17226
17222
  /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
17227
17223
  var SecretRefsList = array(string());
@@ -17394,26 +17390,7 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
17394
17390
  }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
17395
17391
  owner: string().min(1),
17396
17392
  kind: RecordKindNameSchema
17397
- }), RecordQueryResultSchema, { auth: "admin" }), method(object({
17398
- owner: string().min(1),
17399
- kind: RecordKindNameSchema,
17400
- records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
17401
- /** The LAST batch: the copy is complete, the boot guard stops asking. */
17402
- complete: boolean().optional()
17403
- }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
17404
- kind: "mutation",
17405
- auth: "admin"
17406
- }), method(object({
17407
- collection: string().min(1),
17408
- cursor: string().optional(),
17409
- limit: number().int().min(1).max(1e3).optional()
17410
- }), object({
17411
- rows: array(object({
17412
- id: string(),
17413
- data: record(string(), unknown())
17414
- })),
17415
- nextCursor: string().nullable()
17416
- }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
17393
+ }), RecordQueryResultSchema, { auth: "admin" });
17417
17394
  /**
17418
17395
  * record-entries - the ONE admin surface for every list of user-created entries
17419
17396
  * (D881): notification targets, brokers, LLM profiles, anything an addon
@@ -64669,6 +64646,12 @@ Object.freeze({
64669
64646
  addonId: null,
64670
64647
  access: "view"
64671
64648
  },
64649
+ "deviceHistory.queryMany": {
64650
+ capName: "device-history",
64651
+ capScope: "system",
64652
+ addonId: null,
64653
+ access: "view"
64654
+ },
64672
64655
  "deviceHistory.queryNode": {
64673
64656
  capName: "device-history",
64674
64657
  capScope: "system",
@@ -69889,24 +69872,12 @@ Object.freeze({
69889
69872
  addonId: null,
69890
69873
  access: "create"
69891
69874
  },
69892
- "storageAdmin.adoptRecords": {
69893
- capName: "storage-admin",
69894
- capScope: "system",
69895
- addonId: null,
69896
- access: "create"
69897
- },
69898
69875
  "storageAdmin.dropCollection": {
69899
69876
  capName: "storage-admin",
69900
69877
  capScope: "system",
69901
69878
  addonId: null,
69902
69879
  access: "delete"
69903
69880
  },
69904
- "storageAdmin.isAdoptedLegacyTable": {
69905
- capName: "storage-admin",
69906
- capScope: "system",
69907
- addonId: null,
69908
- access: "view"
69909
- },
69910
69881
  "storageAdmin.listKinds": {
69911
69882
  capName: "storage-admin",
69912
69883
  capScope: "system",
@@ -69919,12 +69890,6 @@ Object.freeze({
69919
69890
  addonId: null,
69920
69891
  access: "view"
69921
69892
  },
69922
- "storageAdmin.readLegacyCollection": {
69923
- capName: "storage-admin",
69924
- capScope: "system",
69925
- addonId: null,
69926
- access: "view"
69927
- },
69928
69893
  "storageAdmin.readRecords": {
69929
69894
  capName: "storage-admin",
69930
69895
  capScope: "system",
@@ -73739,12 +73704,6 @@ Object.freeze({
73739
73704
  form: "single",
73740
73705
  optional: false
73741
73706
  }],
73742
- "storageAdmin.adoptRecords": [{
73743
- name: "records",
73744
- form: "object-array",
73745
- optional: false,
73746
- itemField: "deviceId"
73747
- }],
73748
73707
  "storageAdmin.readRecords": [{
73749
73708
  name: "deviceId",
73750
73709
  form: "single",
@@ -75237,4 +75196,4 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
75237
75196
  var MB = 1024 * 1024;
75238
75197
  1024 * MB, 3072 * MB;
75239
75198
  //#endregion
75240
- export { settingsArrayAdoptsFrom as A, SECRET_CLEAR as C, globalSecretScope as D, defineRecordKinds as E, number as F, object as I, string as L, _enum as M, array as N, isSecretClear as O, boolean as P, RecordSecretUnavailableError as S, defineEntryKind as T, requestMountPrefix as _, addonWidgetsSourceCapability as a, errMsg as b, authProviderCapability as c, loginMethodCapability as d, normalizeOrigin as f, pickRequestOrigin as g, parseAppPageLang as h, addonRoutesCapability as i, toSecretFieldView as j, isSecretMarker as k, buildAddonRouteProvider as l, parseAppFlowRequest as m, APP_REFUSED_PATH as n, advertisedHubOrigins as o, oidcConnectionsCapability as p, SSO_STATE_COOKIE as r, appFlowLocation as s, APP_FLOW_DEFAULT_REDIRECT as t, claimedRequestOrigins as u, resolveIconKey as v, arrayItemFieldPath as w, BaseAddon as x, userPasskeysCapability as y };
75199
+ export { toSecretFieldView as A, SECRET_CLEAR as C, globalSecretScope as D, defineRecordKinds as E, object as F, string as I, array as M, boolean as N, isSecretClear as O, number as P, RecordSecretUnavailableError as S, defineEntryKind as T, requestMountPrefix as _, addonWidgetsSourceCapability as a, errMsg as b, authProviderCapability as c, loginMethodCapability as d, normalizeOrigin as f, pickRequestOrigin as g, parseAppPageLang as h, addonRoutesCapability as i, _enum as j, isSecretMarker as k, buildAddonRouteProvider as l, parseAppFlowRequest as m, APP_REFUSED_PATH as n, advertisedHubOrigins as o, oidcConnectionsCapability as p, SSO_STATE_COOKIE as r, appFlowLocation as s, APP_FLOW_DEFAULT_REDIRECT as t, claimedRequestOrigins as u, resolveIconKey as v, arrayItemFieldPath as w, BaseAddon as x, userPasskeysCapability as y };
@@ -5580,7 +5580,7 @@ var ZodIssueCode = {
5580
5580
  var ZodFirstPartyTypeKind;
5581
5581
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5582
5582
  //#endregion
5583
- //#region ../types/dist/sleep-BSuCCFjf.mjs
5583
+ //#region ../types/dist/sleep-CSuN0thG.mjs
5584
5584
  /**
5585
5585
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5586
5586
  * window to float samples (D455).
@@ -8198,7 +8198,13 @@ var RecordKindDeclarationSchema = object({
8198
8198
  secretPaths: array(string().min(1)).default([]),
8199
8199
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8200
8200
  secretArrayKeys: record(string(), string()).default({}),
8201
- /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
8201
+ /**
8202
+ * RETIRED (D900): the legacy table a kind adopted from during the records
8203
+ * migration. Nothing declares it any more and nothing reads it; the schema
8204
+ * still ACCEPTS it because the catalog rows the migration wrote carry it
8205
+ * (an orphaned kind is never redeclared) and an addon built before the
8206
+ * removal still sends it. Never set it.
8207
+ */
8202
8208
  adoptsFrom: string().min(1).optional(),
8203
8209
  /** Kinds that must agree through `transact` sit in one file under one family name. */
8204
8210
  transactFamily: string().min(1).optional(),
@@ -8273,7 +8279,6 @@ function defineRecordKinds(specs) {
8273
8279
  maxDataBytes: spec.maxDataBytes,
8274
8280
  secretPaths: [...secretPaths],
8275
8281
  secretArrayKeys: spec.secretArrayKeys === void 0 ? void 0 : { ...spec.secretArrayKeys },
8276
- adoptsFrom: spec.adoptsFrom,
8277
8282
  transactFamily: spec.transactFamily,
8278
8283
  entry: spec.entry === void 0 ? void 0 : {
8279
8284
  title: spec.entry.title,
@@ -8303,7 +8308,6 @@ function defineEntryKind(name, spec) {
8303
8308
  ...spec.database === void 0 ? {} : { database: spec.database },
8304
8309
  ...spec.indexes === void 0 ? {} : { indexes: spec.indexes },
8305
8310
  ...spec.secretArrayKeys === void 0 ? {} : { secretArrayKeys: spec.secretArrayKeys },
8306
- ...spec.adoptsFrom === void 0 ? {} : { adoptsFrom: spec.adoptsFrom },
8307
8311
  entry: {
8308
8312
  title: spec.title,
8309
8313
  ...spec.nameField === void 0 ? {} : { nameField: spec.nameField }
@@ -8312,15 +8316,6 @@ function defineEntryKind(name, spec) {
8312
8316
  if (defined === void 0) throw new DeclarationRefusedError(`entry kind "${name}" was not built`);
8313
8317
  return defined;
8314
8318
  }
8315
- /**
8316
- * Legacy source for entry adoption (B3): a list stored under addon-settings
8317
- * `<addonId>.<key>` until records-adopt copies rows into the entry kind.
8318
- */
8319
- var SETTINGS_ARRAY_ADOPTS_PREFIX = "@settings-array/";
8320
- /** The `adoptsFrom` value for an addon-settings array field. */
8321
- function settingsArrayAdoptsFrom(addonId, settingsKey) {
8322
- return `${SETTINGS_ARRAY_ADOPTS_PREFIX}${addonId}/${settingsKey}`;
8323
- }
8324
8319
  /** Shared Zod schemas used across streaming capabilities. */
8325
8320
  var CamProfileSchema = _enum([
8326
8321
  "high",
@@ -17251,11 +17246,12 @@ var DeclareKindResultSchema = object({
17251
17246
  kindId: number().int(),
17252
17247
  state: RecordKindStateSchema,
17253
17248
  createdIndexes: array(string()),
17254
- /** The boot guard: the kind is empty while its legacy table still holds rows. */
17255
- adoptionPending: object({
17256
- legacyTable: string(),
17257
- legacyRows: number().int()
17258
- }).nullable()
17249
+ /**
17250
+ * RETIRED (D900): always `null`. It carried the records-migration boot guard;
17251
+ * it stays on the wire, null, because an addon built before the removal reads
17252
+ * an ABSENT field as "adoption pending" and refuses to start.
17253
+ */
17254
+ adoptionPending: _null()
17259
17255
  });
17260
17256
  /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
17261
17257
  var SecretRefsList = array(string());
@@ -17428,26 +17424,7 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
17428
17424
  }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
17429
17425
  owner: string().min(1),
17430
17426
  kind: RecordKindNameSchema
17431
- }), RecordQueryResultSchema, { auth: "admin" }), method(object({
17432
- owner: string().min(1),
17433
- kind: RecordKindNameSchema,
17434
- records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
17435
- /** The LAST batch: the copy is complete, the boot guard stops asking. */
17436
- complete: boolean().optional()
17437
- }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
17438
- kind: "mutation",
17439
- auth: "admin"
17440
- }), method(object({
17441
- collection: string().min(1),
17442
- cursor: string().optional(),
17443
- limit: number().int().min(1).max(1e3).optional()
17444
- }), object({
17445
- rows: array(object({
17446
- id: string(),
17447
- data: record(string(), unknown())
17448
- })),
17449
- nextCursor: string().nullable()
17450
- }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
17427
+ }), RecordQueryResultSchema, { auth: "admin" });
17451
17428
  /**
17452
17429
  * record-entries - the ONE admin surface for every list of user-created entries
17453
17430
  * (D881): notification targets, brokers, LLM profiles, anything an addon
@@ -64703,6 +64680,12 @@ Object.freeze({
64703
64680
  addonId: null,
64704
64681
  access: "view"
64705
64682
  },
64683
+ "deviceHistory.queryMany": {
64684
+ capName: "device-history",
64685
+ capScope: "system",
64686
+ addonId: null,
64687
+ access: "view"
64688
+ },
64706
64689
  "deviceHistory.queryNode": {
64707
64690
  capName: "device-history",
64708
64691
  capScope: "system",
@@ -69923,24 +69906,12 @@ Object.freeze({
69923
69906
  addonId: null,
69924
69907
  access: "create"
69925
69908
  },
69926
- "storageAdmin.adoptRecords": {
69927
- capName: "storage-admin",
69928
- capScope: "system",
69929
- addonId: null,
69930
- access: "create"
69931
- },
69932
69909
  "storageAdmin.dropCollection": {
69933
69910
  capName: "storage-admin",
69934
69911
  capScope: "system",
69935
69912
  addonId: null,
69936
69913
  access: "delete"
69937
69914
  },
69938
- "storageAdmin.isAdoptedLegacyTable": {
69939
- capName: "storage-admin",
69940
- capScope: "system",
69941
- addonId: null,
69942
- access: "view"
69943
- },
69944
69915
  "storageAdmin.listKinds": {
69945
69916
  capName: "storage-admin",
69946
69917
  capScope: "system",
@@ -69953,12 +69924,6 @@ Object.freeze({
69953
69924
  addonId: null,
69954
69925
  access: "view"
69955
69926
  },
69956
- "storageAdmin.readLegacyCollection": {
69957
- capName: "storage-admin",
69958
- capScope: "system",
69959
- addonId: null,
69960
- access: "view"
69961
- },
69962
69927
  "storageAdmin.readRecords": {
69963
69928
  capName: "storage-admin",
69964
69929
  capScope: "system",
@@ -73773,12 +73738,6 @@ Object.freeze({
73773
73738
  form: "single",
73774
73739
  optional: false
73775
73740
  }],
73776
- "storageAdmin.adoptRecords": [{
73777
- name: "records",
73778
- form: "object-array",
73779
- optional: false,
73780
- itemField: "deviceId"
73781
- }],
73782
73741
  "storageAdmin.readRecords": [{
73783
73742
  name: "deviceId",
73784
73743
  form: "single",
@@ -75499,12 +75458,6 @@ Object.defineProperty(exports, "resolveIconKey", {
75499
75458
  return resolveIconKey;
75500
75459
  }
75501
75460
  });
75502
- Object.defineProperty(exports, "settingsArrayAdoptsFrom", {
75503
- enumerable: true,
75504
- get: function() {
75505
- return settingsArrayAdoptsFrom;
75506
- }
75507
- });
75508
75461
  Object.defineProperty(exports, "string", {
75509
75462
  enumerable: true,
75510
75463
  get: function() {
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-C22DtwR1.js");
5
+ const require_dist = require("../dist-a0m2kh9g.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  node_crypto = require_dist.__toESM(node_crypto);
8
8
  //#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
@@ -907,8 +907,7 @@ var oidcProviderEntryKind = require_dist.defineEntryKind(OIDC_PROVIDER_KIND, {
907
907
  title: "OIDC providers",
908
908
  nameField: "displayName",
909
909
  schema: OidcProviderBodySchema,
910
- writeTrigger: "an operator adds, edits or removes an OpenID Connect identity provider",
911
- adoptsFrom: require_dist.settingsArrayAdoptsFrom("auth-oidc", "providers")
910
+ writeTrigger: "an operator adds, edits or removes an OpenID Connect identity provider"
912
911
  });
913
912
  //#endregion
914
913
  //#region src/oidc/oidc-provider-store.ts
@@ -1085,8 +1084,8 @@ var AuthOidcAddon = class extends require_dist.BaseAddon {
1085
1084
  this.activeProviders = await this.loadPersistedProviders();
1086
1085
  } catch (err) {
1087
1086
  const msg = err instanceof Error ? err.message : String(err);
1088
- if (!msg.startsWith("records/foreign-marker:") && !msg.startsWith("records/adoption-pending:")) throw err;
1089
- this.ctx.logger.warn("OIDC: deferred config→records migrate (secret markers need adopt remap)", { meta: { error: msg } });
1087
+ if (!msg.startsWith("records/foreign-marker:")) throw err;
1088
+ this.ctx.logger.warn("OIDC: deferred config→records copy (a secret marker is bound to another row)", { meta: { error: msg } });
1090
1089
  this.activeProviders = [...this.config.providers];
1091
1090
  }
1092
1091
  this.rebuildInstances();
@@ -1,4 +1,4 @@
1
- import { A as settingsArrayAdoptsFrom, C as SECRET_CLEAR, D as globalSecretScope, I as object, L as string, M as _enum, O as isSecretClear, S as RecordSecretUnavailableError, T as defineEntryKind, _ as requestMountPrefix, b as errMsg, c as authProviderCapability, d as loginMethodCapability, f as normalizeOrigin, g as pickRequestOrigin, h as parseAppPageLang, i as addonRoutesCapability, j as toSecretFieldView, k as isSecretMarker, l as buildAddonRouteProvider, m as parseAppFlowRequest, n as APP_REFUSED_PATH, o as advertisedHubOrigins, p as oidcConnectionsCapability, r as SSO_STATE_COOKIE, s as appFlowLocation, t as APP_FLOW_DEFAULT_REDIRECT, u as claimedRequestOrigins, v as resolveIconKey, w as arrayItemFieldPath, x as BaseAddon } from "../dist-BFPqfaub.mjs";
1
+ import { A as toSecretFieldView, C as SECRET_CLEAR, D as globalSecretScope, F as object, I as string, O as isSecretClear, S as RecordSecretUnavailableError, T as defineEntryKind, _ as requestMountPrefix, b as errMsg, c as authProviderCapability, d as loginMethodCapability, f as normalizeOrigin, g as pickRequestOrigin, h as parseAppPageLang, i as addonRoutesCapability, j as _enum, k as isSecretMarker, l as buildAddonRouteProvider, m as parseAppFlowRequest, n as APP_REFUSED_PATH, o as advertisedHubOrigins, p as oidcConnectionsCapability, r as SSO_STATE_COOKIE, s as appFlowLocation, t as APP_FLOW_DEFAULT_REDIRECT, u as claimedRequestOrigins, v as resolveIconKey, w as arrayItemFieldPath, x as BaseAddon } from "../dist-B8sfNbOk.mjs";
2
2
  import * as crypto$1 from "node:crypto";
3
3
  //#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
4
4
  var encoder = new TextEncoder(), decoder = new TextDecoder(), strictDecoder = new TextDecoder("utf-8", { fatal: !0 });
@@ -902,8 +902,7 @@ var oidcProviderEntryKind = defineEntryKind(OIDC_PROVIDER_KIND, {
902
902
  title: "OIDC providers",
903
903
  nameField: "displayName",
904
904
  schema: OidcProviderBodySchema,
905
- writeTrigger: "an operator adds, edits or removes an OpenID Connect identity provider",
906
- adoptsFrom: settingsArrayAdoptsFrom("auth-oidc", "providers")
905
+ writeTrigger: "an operator adds, edits or removes an OpenID Connect identity provider"
907
906
  });
908
907
  //#endregion
909
908
  //#region src/oidc/oidc-provider-store.ts
@@ -1080,8 +1079,8 @@ var AuthOidcAddon = class extends BaseAddon {
1080
1079
  this.activeProviders = await this.loadPersistedProviders();
1081
1080
  } catch (err) {
1082
1081
  const msg = err instanceof Error ? err.message : String(err);
1083
- if (!msg.startsWith("records/foreign-marker:") && !msg.startsWith("records/adoption-pending:")) throw err;
1084
- this.ctx.logger.warn("OIDC: deferred config→records migrate (secret markers need adopt remap)", { meta: { error: msg } });
1082
+ if (!msg.startsWith("records/foreign-marker:")) throw err;
1083
+ this.ctx.logger.warn("OIDC: deferred config→records copy (a secret marker is bound to another row)", { meta: { error: msg } });
1085
1084
  this.activeProviders = [...this.config.providers];
1086
1085
  }
1087
1086
  this.rebuildInstances();
@@ -3,7 +3,7 @@ import "./dist-CYZr2fwk.mjs";
3
3
  var e = {
4
4
  "@camstack/sdk": {
5
5
  name: "@camstack/sdk",
6
- version: "1.2.139",
6
+ version: "1.2.142",
7
7
  scope: ["default"],
8
8
  loaded: !1,
9
9
  from: "addon_auth_webauthn_widgets",
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.389",
21
+ version: "1.2.392",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_auth_webauthn_widgets",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.2.306",
36
+ version: "1.2.309",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_auth_webauthn_widgets",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-C22DtwR1.js");
5
+ const require_dist = require("../dist-a0m2kh9g.js");
6
6
  let stream = require("stream");
7
7
  stream = require_dist.__toESM(stream, 1);
8
8
  let http = require("http");
@@ -12118,12 +12118,9 @@ async function hubBrowserOrigin(localNetwork, logger) {
12118
12118
  //#endregion
12119
12119
  //#region src/webauthn/record-kinds.ts
12120
12120
  /**
12121
- * Record kinds owned by `auth-webauthn` (records plan phase 6 / §2.8).
12122
- *
12123
- * Legacy tables are OPERATOR-ONLY drop after verify — never the orphan job.
12121
+ * Record kinds owned by `auth-webauthn` (records plan phase 6 / §2.8). The
12122
+ * legacy `auth-webauthn:*` collections they replaced are gone (D900).
12124
12123
  */
12125
- var USER_PASSKEYS_LEGACY = "auth-webauthn:user_passkeys";
12126
- var USER_PASSKEY_PREFS_LEGACY = "auth-webauthn:user_passkey_prefs";
12127
12124
  var PasskeyBodySchema = require_dist.object({
12128
12125
  credentialId: require_dist.string(),
12129
12126
  userId: require_dist.string(),
@@ -12153,8 +12150,7 @@ var authWebauthnRecordKinds = require_dist.defineRecordKinds({
12153
12150
  name: "user",
12154
12151
  fields: ["userId"]
12155
12152
  }],
12156
- retention: { none: "removePasskey only — no sweep; user delete does not cascade" },
12157
- adoptsFrom: USER_PASSKEYS_LEGACY
12153
+ retention: { none: "removePasskey only — no sweep; user delete does not cascade" }
12158
12154
  },
12159
12155
  "passkey-prefs": {
12160
12156
  schema: PasskeyPrefBodySchema,
@@ -12162,92 +12158,15 @@ var authWebauthnRecordKinds = require_dist.defineRecordKinds({
12162
12158
  writeTrigger: "setSecondFactorPreference upserts one row per user",
12163
12159
  device: "none",
12164
12160
  at: "none",
12165
- retention: { none: "missing row reads as second factor OFF" },
12166
- adoptsFrom: USER_PASSKEY_PREFS_LEGACY
12161
+ retention: { none: "missing row reads as second factor OFF" }
12167
12162
  }
12168
12163
  });
12169
12164
  //#endregion
12170
12165
  //#region src/webauthn/passkey-store.ts
12171
- var COLLECTION = "auth-webauthn:user_passkeys";
12172
- var PREF_COLLECTION = "auth-webauthn:user_passkey_prefs";
12173
- var PREF_COLUMNS = [
12174
- {
12175
- name: "userId",
12176
- type: "TEXT",
12177
- primaryKey: true,
12178
- notNull: true
12179
- },
12180
- {
12181
- name: "secondFactorEnabled",
12182
- type: "BOOLEAN",
12183
- notNull: true
12184
- },
12185
- {
12186
- name: "updatedAt",
12187
- type: "INTEGER",
12188
- notNull: true
12189
- }
12190
- ];
12191
12166
  var StoredPreferenceSchema = require_dist.object({
12192
12167
  secondFactorEnabled: require_dist.boolean(),
12193
12168
  updatedAt: require_dist.number()
12194
12169
  });
12195
- var COLUMNS = [
12196
- {
12197
- name: "credentialId",
12198
- type: "TEXT",
12199
- primaryKey: true,
12200
- notNull: true
12201
- },
12202
- {
12203
- name: "userId",
12204
- type: "TEXT",
12205
- notNull: true
12206
- },
12207
- {
12208
- name: "publicKey",
12209
- type: "TEXT",
12210
- notNull: true
12211
- },
12212
- {
12213
- name: "counter",
12214
- type: "INTEGER",
12215
- notNull: true
12216
- },
12217
- {
12218
- name: "transports",
12219
- type: "JSON"
12220
- },
12221
- {
12222
- name: "label",
12223
- type: "TEXT",
12224
- notNull: true
12225
- },
12226
- {
12227
- name: "createdAt",
12228
- type: "INTEGER",
12229
- notNull: true
12230
- },
12231
- {
12232
- name: "lastUsedAt",
12233
- type: "INTEGER"
12234
- }
12235
- ];
12236
- async function declarePasskeySchema(store, options) {
12237
- const skip = new Set(options?.skipCollections ?? []);
12238
- if (!skip.has(COLLECTION)) await store.declareCollection.mutate({
12239
- collection: COLLECTION,
12240
- columns: COLUMNS,
12241
- indexes: [{
12242
- name: "idx_user_passkeys_user_id",
12243
- columns: ["userId"]
12244
- }]
12245
- });
12246
- if (!skip.has(PREF_COLLECTION)) await store.declareCollection.mutate({
12247
- collection: PREF_COLLECTION,
12248
- columns: PREF_COLUMNS
12249
- });
12250
- }
12251
12170
  function parseRow(data) {
12252
12171
  const credentialId = data["credentialId"];
12253
12172
  const userId = data["userId"];
@@ -12293,66 +12212,34 @@ function rowToPasskey(id, body) {
12293
12212
  ...rest
12294
12213
  });
12295
12214
  }
12215
+ /** The passkeys of every user, on `ctx.records` (D900: the legacy collections are gone). */
12296
12216
  var PasskeyStore = class {
12297
12217
  passkeysKind;
12298
12218
  prefsKind;
12299
- store;
12300
12219
  constructor(deps) {
12301
- if ("passkeysKind" in deps) {
12302
- this.passkeysKind = deps.passkeysKind;
12303
- this.prefsKind = deps.prefsKind;
12304
- this.store = deps.legacyStore ?? null;
12305
- } else {
12306
- this.passkeysKind = null;
12307
- this.prefsKind = null;
12308
- this.store = deps;
12309
- }
12220
+ this.passkeysKind = deps.passkeysKind;
12221
+ this.prefsKind = deps.prefsKind;
12310
12222
  }
12311
12223
  async insert(pk) {
12312
- const kind = this.passkeysKind;
12313
- if (kind !== null) {
12314
- const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(pk));
12315
- if (!parsed.success) throw new Error(parsed.error.message);
12316
- await kind.put({
12317
- id: pk.credentialId,
12318
- data: parsed.data
12319
- });
12320
- return;
12321
- }
12322
- await this.store.insert.mutate({
12323
- collection: COLLECTION,
12324
- record: {
12325
- id: pk.credentialId,
12326
- data: { ...pk }
12327
- }
12224
+ const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(pk));
12225
+ if (!parsed.success) throw new Error(parsed.error.message);
12226
+ await this.passkeysKind.put({
12227
+ id: pk.credentialId,
12228
+ data: parsed.data
12328
12229
  });
12329
12230
  }
12330
12231
  async findByCredentialId(credentialId) {
12331
- const kind = this.passkeysKind;
12332
- if (kind !== null) {
12333
- const row = (await kind.query({
12334
- where: { credentialId },
12335
- limit: 1
12336
- })).records[0];
12337
- return row === void 0 ? null : rowToPasskey(row.id, row.data);
12338
- }
12339
- const results = await this.store.query.query({
12340
- collection: COLLECTION,
12341
- filter: { where: { credentialId } }
12342
- });
12343
- if (results.length === 0) return null;
12344
- return parseRow(results[0].data);
12232
+ const row = (await this.passkeysKind.query({
12233
+ where: { credentialId },
12234
+ limit: 1
12235
+ })).records[0];
12236
+ return row === void 0 ? null : rowToPasskey(row.id, row.data);
12345
12237
  }
12346
12238
  async findByUserId(userId) {
12347
- const kind = this.passkeysKind;
12348
- if (kind !== null) return (await kind.query({
12239
+ return (await this.passkeysKind.query({
12349
12240
  where: { userId },
12350
12241
  limit: 500
12351
12242
  })).records.map((row) => rowToPasskey(row.id, row.data));
12352
- return (await this.store.query.query({
12353
- collection: COLLECTION,
12354
- filter: { where: { userId } }
12355
- })).map((r) => parseRow(r.data));
12356
12243
  }
12357
12244
  async updateCounter(credentialId, counter) {
12358
12245
  const existing = await this.findByCredentialId(credentialId);
@@ -12362,45 +12249,19 @@ var PasskeyStore = class {
12362
12249
  counter,
12363
12250
  lastUsedAt: Date.now()
12364
12251
  };
12365
- const kind = this.passkeysKind;
12366
- if (kind !== null) {
12367
- const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(next));
12368
- if (!parsed.success) return;
12369
- await kind.put({
12370
- id: credentialId,
12371
- data: parsed.data
12372
- });
12373
- return;
12374
- }
12375
- await this.store.update.mutate({
12376
- collection: COLLECTION,
12252
+ const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(next));
12253
+ if (!parsed.success) return;
12254
+ await this.passkeysKind.put({
12377
12255
  id: credentialId,
12378
- data: { ...next }
12256
+ data: parsed.data
12379
12257
  });
12380
12258
  }
12381
12259
  async delete(credentialId) {
12382
- const kind = this.passkeysKind;
12383
- if (kind !== null) {
12384
- await kind.delete(credentialId);
12385
- return;
12386
- }
12387
- await this.store.delete.mutate({
12388
- collection: COLLECTION,
12389
- key: credentialId
12390
- });
12260
+ await this.passkeysKind.delete(credentialId);
12391
12261
  }
12392
12262
  async getSecondFactorPreference(userId) {
12393
- const prefsKind = this.prefsKind;
12394
- if (prefsKind !== null) {
12395
- const row = await prefsKind.get(userId);
12396
- const parsed = StoredPreferenceSchema.safeParse(row?.data);
12397
- return parsed.success ? parsed.data.secondFactorEnabled : false;
12398
- }
12399
- const raw = await this.store.get.query({
12400
- collection: PREF_COLLECTION,
12401
- key: userId
12402
- });
12403
- const parsed = StoredPreferenceSchema.safeParse(raw);
12263
+ const row = await this.prefsKind.get(userId);
12264
+ const parsed = StoredPreferenceSchema.safeParse(row?.data);
12404
12265
  return parsed.success ? parsed.data.secondFactorEnabled : false;
12405
12266
  }
12406
12267
  async setSecondFactorPreference(userId, enabled) {
@@ -12408,20 +12269,11 @@ var PasskeyStore = class {
12408
12269
  secondFactorEnabled: enabled,
12409
12270
  updatedAt: Date.now()
12410
12271
  };
12411
- const prefsKind = this.prefsKind;
12412
- if (prefsKind !== null) {
12413
- const parsed = authWebauthnRecordKinds["passkey-prefs"].schema.safeParse(value);
12414
- if (!parsed.success) throw new Error(parsed.error.message);
12415
- await prefsKind.put({
12416
- id: userId,
12417
- data: parsed.data
12418
- });
12419
- return;
12420
- }
12421
- await this.store.set.mutate({
12422
- collection: PREF_COLLECTION,
12423
- key: userId,
12424
- value
12272
+ const parsed = authWebauthnRecordKinds["passkey-prefs"].schema.safeParse(value);
12273
+ if (!parsed.success) throw new Error(parsed.error.message);
12274
+ await this.prefsKind.put({
12275
+ id: userId,
12276
+ data: parsed.data
12425
12277
  });
12426
12278
  }
12427
12279
  };
@@ -12603,20 +12455,12 @@ var AuthWebauthnAddon = class extends require_dist.BaseAddon {
12603
12455
  super({ ...DEFAULT_CONFIG });
12604
12456
  }
12605
12457
  async onInitialize() {
12606
- const settingsStore = this.ctx.api?.settingsStore;
12607
12458
  const records = this.ctx.records;
12608
- if (!settingsStore || !records) throw new Error("addon-auth-webauthn: settingsStore and ctx.records required (phase 6)");
12609
- try {
12610
- await records.declare(authWebauthnRecordKinds);
12611
- } catch (err) {
12612
- if (!(err instanceof Error ? err.message : String(err)).startsWith("records/adoption-pending:")) throw err;
12613
- this.ctx.logger.info("phase 6: webauthn kinds declared; legacy until adopt completes");
12614
- }
12615
- await declarePasskeySchema(settingsStore, { skipCollections: [USER_PASSKEYS_LEGACY, USER_PASSKEY_PREFS_LEGACY] });
12459
+ if (!records) throw new Error("addon-auth-webauthn: ctx.records required");
12460
+ await records.declare(authWebauthnRecordKinds);
12616
12461
  this.store = new PasskeyStore({
12617
12462
  passkeysKind: records.kind(authWebauthnRecordKinds.passkeys),
12618
- prefsKind: records.kind(authWebauthnRecordKinds["passkey-prefs"]),
12619
- legacyStore: settingsStore
12463
+ prefsKind: records.kind(authWebauthnRecordKinds["passkey-prefs"])
12620
12464
  });
12621
12465
  const provider = {
12622
12466
  beginRegistration: async ({ userId, username }) => this.beginRegistration(userId, username),
@@ -1,4 +1,4 @@
1
- import { E as defineRecordKinds, F as number, I as object, L as string, N as array, P as boolean, a as addonWidgetsSourceCapability, d as loginMethodCapability, x as BaseAddon, y as userPasskeysCapability } from "../dist-BFPqfaub.mjs";
1
+ import { E as defineRecordKinds, F as object, I as string, M as array, N as boolean, P as number, a as addonWidgetsSourceCapability, d as loginMethodCapability, x as BaseAddon, y as userPasskeysCapability } from "../dist-B8sfNbOk.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import Stream from "stream";
4
4
  import http from "http";
@@ -12145,12 +12145,9 @@ async function hubBrowserOrigin(localNetwork, logger) {
12145
12145
  //#endregion
12146
12146
  //#region src/webauthn/record-kinds.ts
12147
12147
  /**
12148
- * Record kinds owned by `auth-webauthn` (records plan phase 6 / §2.8).
12149
- *
12150
- * Legacy tables are OPERATOR-ONLY drop after verify — never the orphan job.
12148
+ * Record kinds owned by `auth-webauthn` (records plan phase 6 / §2.8). The
12149
+ * legacy `auth-webauthn:*` collections they replaced are gone (D900).
12151
12150
  */
12152
- var USER_PASSKEYS_LEGACY = "auth-webauthn:user_passkeys";
12153
- var USER_PASSKEY_PREFS_LEGACY = "auth-webauthn:user_passkey_prefs";
12154
12151
  var PasskeyBodySchema = object({
12155
12152
  credentialId: string(),
12156
12153
  userId: string(),
@@ -12180,8 +12177,7 @@ var authWebauthnRecordKinds = defineRecordKinds({
12180
12177
  name: "user",
12181
12178
  fields: ["userId"]
12182
12179
  }],
12183
- retention: { none: "removePasskey only — no sweep; user delete does not cascade" },
12184
- adoptsFrom: USER_PASSKEYS_LEGACY
12180
+ retention: { none: "removePasskey only — no sweep; user delete does not cascade" }
12185
12181
  },
12186
12182
  "passkey-prefs": {
12187
12183
  schema: PasskeyPrefBodySchema,
@@ -12189,92 +12185,15 @@ var authWebauthnRecordKinds = defineRecordKinds({
12189
12185
  writeTrigger: "setSecondFactorPreference upserts one row per user",
12190
12186
  device: "none",
12191
12187
  at: "none",
12192
- retention: { none: "missing row reads as second factor OFF" },
12193
- adoptsFrom: USER_PASSKEY_PREFS_LEGACY
12188
+ retention: { none: "missing row reads as second factor OFF" }
12194
12189
  }
12195
12190
  });
12196
12191
  //#endregion
12197
12192
  //#region src/webauthn/passkey-store.ts
12198
- var COLLECTION = "auth-webauthn:user_passkeys";
12199
- var PREF_COLLECTION = "auth-webauthn:user_passkey_prefs";
12200
- var PREF_COLUMNS = [
12201
- {
12202
- name: "userId",
12203
- type: "TEXT",
12204
- primaryKey: true,
12205
- notNull: true
12206
- },
12207
- {
12208
- name: "secondFactorEnabled",
12209
- type: "BOOLEAN",
12210
- notNull: true
12211
- },
12212
- {
12213
- name: "updatedAt",
12214
- type: "INTEGER",
12215
- notNull: true
12216
- }
12217
- ];
12218
12193
  var StoredPreferenceSchema = object({
12219
12194
  secondFactorEnabled: boolean(),
12220
12195
  updatedAt: number()
12221
12196
  });
12222
- var COLUMNS = [
12223
- {
12224
- name: "credentialId",
12225
- type: "TEXT",
12226
- primaryKey: true,
12227
- notNull: true
12228
- },
12229
- {
12230
- name: "userId",
12231
- type: "TEXT",
12232
- notNull: true
12233
- },
12234
- {
12235
- name: "publicKey",
12236
- type: "TEXT",
12237
- notNull: true
12238
- },
12239
- {
12240
- name: "counter",
12241
- type: "INTEGER",
12242
- notNull: true
12243
- },
12244
- {
12245
- name: "transports",
12246
- type: "JSON"
12247
- },
12248
- {
12249
- name: "label",
12250
- type: "TEXT",
12251
- notNull: true
12252
- },
12253
- {
12254
- name: "createdAt",
12255
- type: "INTEGER",
12256
- notNull: true
12257
- },
12258
- {
12259
- name: "lastUsedAt",
12260
- type: "INTEGER"
12261
- }
12262
- ];
12263
- async function declarePasskeySchema(store, options) {
12264
- const skip = new Set(options?.skipCollections ?? []);
12265
- if (!skip.has(COLLECTION)) await store.declareCollection.mutate({
12266
- collection: COLLECTION,
12267
- columns: COLUMNS,
12268
- indexes: [{
12269
- name: "idx_user_passkeys_user_id",
12270
- columns: ["userId"]
12271
- }]
12272
- });
12273
- if (!skip.has(PREF_COLLECTION)) await store.declareCollection.mutate({
12274
- collection: PREF_COLLECTION,
12275
- columns: PREF_COLUMNS
12276
- });
12277
- }
12278
12197
  function parseRow(data) {
12279
12198
  const credentialId = data["credentialId"];
12280
12199
  const userId = data["userId"];
@@ -12320,66 +12239,34 @@ function rowToPasskey(id, body) {
12320
12239
  ...rest
12321
12240
  });
12322
12241
  }
12242
+ /** The passkeys of every user, on `ctx.records` (D900: the legacy collections are gone). */
12323
12243
  var PasskeyStore = class {
12324
12244
  passkeysKind;
12325
12245
  prefsKind;
12326
- store;
12327
12246
  constructor(deps) {
12328
- if ("passkeysKind" in deps) {
12329
- this.passkeysKind = deps.passkeysKind;
12330
- this.prefsKind = deps.prefsKind;
12331
- this.store = deps.legacyStore ?? null;
12332
- } else {
12333
- this.passkeysKind = null;
12334
- this.prefsKind = null;
12335
- this.store = deps;
12336
- }
12247
+ this.passkeysKind = deps.passkeysKind;
12248
+ this.prefsKind = deps.prefsKind;
12337
12249
  }
12338
12250
  async insert(pk) {
12339
- const kind = this.passkeysKind;
12340
- if (kind !== null) {
12341
- const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(pk));
12342
- if (!parsed.success) throw new Error(parsed.error.message);
12343
- await kind.put({
12344
- id: pk.credentialId,
12345
- data: parsed.data
12346
- });
12347
- return;
12348
- }
12349
- await this.store.insert.mutate({
12350
- collection: COLLECTION,
12351
- record: {
12352
- id: pk.credentialId,
12353
- data: { ...pk }
12354
- }
12251
+ const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(pk));
12252
+ if (!parsed.success) throw new Error(parsed.error.message);
12253
+ await this.passkeysKind.put({
12254
+ id: pk.credentialId,
12255
+ data: parsed.data
12355
12256
  });
12356
12257
  }
12357
12258
  async findByCredentialId(credentialId) {
12358
- const kind = this.passkeysKind;
12359
- if (kind !== null) {
12360
- const row = (await kind.query({
12361
- where: { credentialId },
12362
- limit: 1
12363
- })).records[0];
12364
- return row === void 0 ? null : rowToPasskey(row.id, row.data);
12365
- }
12366
- const results = await this.store.query.query({
12367
- collection: COLLECTION,
12368
- filter: { where: { credentialId } }
12369
- });
12370
- if (results.length === 0) return null;
12371
- return parseRow(results[0].data);
12259
+ const row = (await this.passkeysKind.query({
12260
+ where: { credentialId },
12261
+ limit: 1
12262
+ })).records[0];
12263
+ return row === void 0 ? null : rowToPasskey(row.id, row.data);
12372
12264
  }
12373
12265
  async findByUserId(userId) {
12374
- const kind = this.passkeysKind;
12375
- if (kind !== null) return (await kind.query({
12266
+ return (await this.passkeysKind.query({
12376
12267
  where: { userId },
12377
12268
  limit: 500
12378
12269
  })).records.map((row) => rowToPasskey(row.id, row.data));
12379
- return (await this.store.query.query({
12380
- collection: COLLECTION,
12381
- filter: { where: { userId } }
12382
- })).map((r) => parseRow(r.data));
12383
12270
  }
12384
12271
  async updateCounter(credentialId, counter) {
12385
12272
  const existing = await this.findByCredentialId(credentialId);
@@ -12389,45 +12276,19 @@ var PasskeyStore = class {
12389
12276
  counter,
12390
12277
  lastUsedAt: Date.now()
12391
12278
  };
12392
- const kind = this.passkeysKind;
12393
- if (kind !== null) {
12394
- const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(next));
12395
- if (!parsed.success) return;
12396
- await kind.put({
12397
- id: credentialId,
12398
- data: parsed.data
12399
- });
12400
- return;
12401
- }
12402
- await this.store.update.mutate({
12403
- collection: COLLECTION,
12279
+ const parsed = authWebauthnRecordKinds.passkeys.schema.safeParse(pkToBody(next));
12280
+ if (!parsed.success) return;
12281
+ await this.passkeysKind.put({
12404
12282
  id: credentialId,
12405
- data: { ...next }
12283
+ data: parsed.data
12406
12284
  });
12407
12285
  }
12408
12286
  async delete(credentialId) {
12409
- const kind = this.passkeysKind;
12410
- if (kind !== null) {
12411
- await kind.delete(credentialId);
12412
- return;
12413
- }
12414
- await this.store.delete.mutate({
12415
- collection: COLLECTION,
12416
- key: credentialId
12417
- });
12287
+ await this.passkeysKind.delete(credentialId);
12418
12288
  }
12419
12289
  async getSecondFactorPreference(userId) {
12420
- const prefsKind = this.prefsKind;
12421
- if (prefsKind !== null) {
12422
- const row = await prefsKind.get(userId);
12423
- const parsed = StoredPreferenceSchema.safeParse(row?.data);
12424
- return parsed.success ? parsed.data.secondFactorEnabled : false;
12425
- }
12426
- const raw = await this.store.get.query({
12427
- collection: PREF_COLLECTION,
12428
- key: userId
12429
- });
12430
- const parsed = StoredPreferenceSchema.safeParse(raw);
12290
+ const row = await this.prefsKind.get(userId);
12291
+ const parsed = StoredPreferenceSchema.safeParse(row?.data);
12431
12292
  return parsed.success ? parsed.data.secondFactorEnabled : false;
12432
12293
  }
12433
12294
  async setSecondFactorPreference(userId, enabled) {
@@ -12435,20 +12296,11 @@ var PasskeyStore = class {
12435
12296
  secondFactorEnabled: enabled,
12436
12297
  updatedAt: Date.now()
12437
12298
  };
12438
- const prefsKind = this.prefsKind;
12439
- if (prefsKind !== null) {
12440
- const parsed = authWebauthnRecordKinds["passkey-prefs"].schema.safeParse(value);
12441
- if (!parsed.success) throw new Error(parsed.error.message);
12442
- await prefsKind.put({
12443
- id: userId,
12444
- data: parsed.data
12445
- });
12446
- return;
12447
- }
12448
- await this.store.set.mutate({
12449
- collection: PREF_COLLECTION,
12450
- key: userId,
12451
- value
12299
+ const parsed = authWebauthnRecordKinds["passkey-prefs"].schema.safeParse(value);
12300
+ if (!parsed.success) throw new Error(parsed.error.message);
12301
+ await this.prefsKind.put({
12302
+ id: userId,
12303
+ data: parsed.data
12452
12304
  });
12453
12305
  }
12454
12306
  };
@@ -12593,20 +12445,12 @@ var AuthWebauthnAddon = class extends BaseAddon {
12593
12445
  super({ ...DEFAULT_CONFIG });
12594
12446
  }
12595
12447
  async onInitialize() {
12596
- const settingsStore = this.ctx.api?.settingsStore;
12597
12448
  const records = this.ctx.records;
12598
- if (!settingsStore || !records) throw new Error("addon-auth-webauthn: settingsStore and ctx.records required (phase 6)");
12599
- try {
12600
- await records.declare(authWebauthnRecordKinds);
12601
- } catch (err) {
12602
- if (!(err instanceof Error ? err.message : String(err)).startsWith("records/adoption-pending:")) throw err;
12603
- this.ctx.logger.info("phase 6: webauthn kinds declared; legacy until adopt completes");
12604
- }
12605
- await declarePasskeySchema(settingsStore, { skipCollections: [USER_PASSKEYS_LEGACY, USER_PASSKEY_PREFS_LEGACY] });
12449
+ if (!records) throw new Error("addon-auth-webauthn: ctx.records required");
12450
+ await records.declare(authWebauthnRecordKinds);
12606
12451
  this.store = new PasskeyStore({
12607
12452
  passkeysKind: records.kind(authWebauthnRecordKinds.passkeys),
12608
- prefsKind: records.kind(authWebauthnRecordKinds["passkey-prefs"]),
12609
- legacyStore: settingsStore
12453
+ prefsKind: records.kind(authWebauthnRecordKinds["passkey-prefs"])
12610
12454
  });
12611
12455
  const provider = {
12612
12456
  beginRegistration: async ({ userId, username }) => this.beginRegistration(userId, username),
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.389",
39
+ version: "1.2.392",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -45,7 +45,7 @@ async function r() {
45
45
  }
46
46
  },
47
47
  "@camstack/sdk": {
48
- version: "1.2.139",
48
+ version: "1.2.142",
49
49
  scope: "default",
50
50
  shareConfig: {
51
51
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.306",
84
+ version: "1.2.309",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-CSECtd7j.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-BIwATeJB.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-auth",
3
- "version": "1.2.155",
3
+ "version": "1.2.157",
4
4
  "description": "Authentication bundle — OIDC and WebAuthn/passkey. Multi-entry npm package shipping 2 addons under a single bundle; each addon keeps its own id, capabilities, and runner.",
5
5
  "keywords": [
6
6
  "camstack",