@naylence/runtime 0.3.6-test.108 → 0.3.7

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.
Files changed (59) hide show
  1. package/dist/browser/index.cjs +98 -61
  2. package/dist/browser/index.mjs +98 -61
  3. package/dist/cjs/_env-shim.js +2 -1
  4. package/dist/cjs/naylence/fame/config/extended-fame-config.js +2 -1
  5. package/dist/cjs/naylence/fame/connector/broadcast-channel-connector-factory.js +8 -4
  6. package/dist/cjs/naylence/fame/connector/broadcast-channel-connector.browser.js +13 -6
  7. package/dist/cjs/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
  8. package/dist/cjs/naylence/fame/connector/broadcast-channel-listener.js +2 -6
  9. package/dist/cjs/naylence/fame/connector/inpage-connector-factory.js +2 -1
  10. package/dist/cjs/naylence/fame/connector/inpage-connector.js +13 -6
  11. package/dist/cjs/naylence/fame/connector/inpage-listener-factory.js +4 -4
  12. package/dist/cjs/naylence/fame/connector/inpage-listener.js +5 -2
  13. package/dist/cjs/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
  14. package/dist/cjs/naylence/fame/grants/inpage-connection-grant.js +4 -2
  15. package/dist/cjs/naylence/fame/http/oauth2-token-router.js +9 -9
  16. package/dist/cjs/naylence/fame/node/admission/default-node-attach-client.js +6 -3
  17. package/dist/cjs/naylence/fame/node/upstream-session-manager.js +9 -6
  18. package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
  19. package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
  20. package/dist/cjs/naylence/fame/security/default-security-manager.js +2 -1
  21. package/dist/cjs/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +2 -2
  22. package/dist/cjs/naylence/fame/security/trust-store/trust-store-provider-factory.js +2 -2
  23. package/dist/cjs/version.js +2 -2
  24. package/dist/esm/_env-shim.js +2 -1
  25. package/dist/esm/browser.js +2 -2
  26. package/dist/esm/naylence/fame/config/extended-fame-config.js +2 -1
  27. package/dist/esm/naylence/fame/connector/broadcast-channel-connector-factory.js +8 -4
  28. package/dist/esm/naylence/fame/connector/broadcast-channel-connector.browser.js +13 -6
  29. package/dist/esm/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
  30. package/dist/esm/naylence/fame/connector/broadcast-channel-listener.js +2 -6
  31. package/dist/esm/naylence/fame/connector/index.js +2 -2
  32. package/dist/esm/naylence/fame/connector/inpage-connector-factory.js +2 -1
  33. package/dist/esm/naylence/fame/connector/inpage-connector.js +13 -6
  34. package/dist/esm/naylence/fame/connector/inpage-listener-factory.js +4 -4
  35. package/dist/esm/naylence/fame/connector/inpage-listener.js +5 -2
  36. package/dist/esm/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
  37. package/dist/esm/naylence/fame/grants/inpage-connection-grant.js +4 -2
  38. package/dist/esm/naylence/fame/http/oauth2-token-router.js +9 -9
  39. package/dist/esm/naylence/fame/node/admission/default-node-attach-client.js +6 -3
  40. package/dist/esm/naylence/fame/node/upstream-session-manager.js +9 -6
  41. package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
  42. package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
  43. package/dist/esm/naylence/fame/security/default-security-manager.js +2 -1
  44. package/dist/esm/naylence/fame/security/index.js +1 -1
  45. package/dist/esm/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +3 -3
  46. package/dist/esm/naylence/fame/security/trust-store/trust-store-provider-factory.js +3 -3
  47. package/dist/esm/version.js +2 -2
  48. package/dist/node/index.cjs +96 -60
  49. package/dist/node/index.mjs +96 -60
  50. package/dist/node/node.cjs +105 -69
  51. package/dist/node/node.mjs +105 -69
  52. package/dist/types/browser.d.ts +2 -2
  53. package/dist/types/naylence/fame/connector/index.d.ts +2 -2
  54. package/dist/types/naylence/fame/security/index.d.ts +1 -1
  55. package/dist/types/naylence/fame/security/trust-store/noop-trust-store-provider-factory.d.ts +3 -3
  56. package/dist/types/naylence/fame/security/trust-store/trust-store-provider-factory.d.ts +4 -4
  57. package/dist/types/naylence/fame/security/trust-store/trust-store-provider.d.ts +5 -5
  58. package/dist/types/version.d.ts +1 -1
  59. package/package.json +1 -1
@@ -13,12 +13,12 @@ import fastify from 'fastify';
13
13
  import websocketPlugin from '@fastify/websocket';
14
14
 
15
15
  // This file is auto-generated during build - do not edit manually
16
- // Generated from package.json version: 0.3.6-test.108
16
+ // Generated from package.json version: 0.3.7
17
17
  /**
18
18
  * The package version, injected at build time.
19
19
  * @internal
20
20
  */
21
- const VERSION = '0.3.6-test.108';
21
+ const VERSION = '0.3.7';
22
22
 
23
23
  /**
24
24
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -9774,7 +9774,8 @@ const ensureBroadcastEnvironment = () => {
9774
9774
  };
9775
9775
  let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
9776
9776
  static generateConnectorId() {
9777
- const globalCrypto = globalThis.crypto;
9777
+ const globalCrypto = globalThis
9778
+ .crypto;
9778
9779
  if (globalCrypto?.randomUUID) {
9779
9780
  return globalCrypto.randomUUID();
9780
9781
  }
@@ -9829,7 +9830,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
9829
9830
  this.listenerRegistered = false;
9830
9831
  this.visibilityChangeListenerRegistered = false;
9831
9832
  this.channelName =
9832
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
9833
+ typeof config.channelName === 'string' &&
9834
+ config.channelName.trim().length > 0
9833
9835
  ? config.channelName.trim()
9834
9836
  : DEFAULT_CHANNEL$7;
9835
9837
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -9871,7 +9873,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
9871
9873
  channel: this.channelName,
9872
9874
  connector_id: this.connectorId,
9873
9875
  message_type: message && typeof message === 'object'
9874
- ? message.constructor?.name ?? typeof message
9876
+ ? (message.constructor
9877
+ ?.name ?? typeof message)
9875
9878
  : typeof message,
9876
9879
  has_sender_id: Boolean(message?.senderId),
9877
9880
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -10101,7 +10104,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10101
10104
  timestamp: new Date().toISOString(),
10102
10105
  });
10103
10106
  }
10104
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
10107
+ if (this.visibilityChangeListenerRegistered &&
10108
+ this.visibilityChangeHandler &&
10109
+ typeof document !== 'undefined') {
10105
10110
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
10106
10111
  this.visibilityChangeListenerRegistered = false;
10107
10112
  this.visibilityChangeHandler = undefined;
@@ -10129,7 +10134,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10129
10134
  return rawOrEnvelope;
10130
10135
  }
10131
10136
  _isWildcardTarget() {
10132
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
10137
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
10133
10138
  }
10134
10139
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
10135
10140
  if (this._isWildcardTarget()) {
@@ -10149,7 +10154,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10149
10154
  return true;
10150
10155
  }
10151
10156
  const expectedSender = this.targetNodeId;
10152
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
10157
+ if (expectedSender &&
10158
+ expectedSender !== '*' &&
10159
+ senderNodeId !== expectedSender) {
10153
10160
  logger$_.debug('broadcast_channel_message_rejected', {
10154
10161
  channel: this.channelName,
10155
10162
  connector_id: this.connectorId,
@@ -10368,14 +10375,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
10368
10375
  type,
10369
10376
  purpose,
10370
10377
  };
10371
- const channelValue = candidate.channelName ?? candidate['channel_name'];
10378
+ const channelValue = candidate.channelName ??
10379
+ candidate['channel_name'];
10372
10380
  if (channelValue !== undefined) {
10373
10381
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
10374
10382
  throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
10375
10383
  }
10376
10384
  result.channelName = channelValue.trim();
10377
10385
  }
10378
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
10386
+ const inboxValue = candidate.inboxCapacity ??
10387
+ candidate['inbox_capacity'];
10379
10388
  if (inboxValue !== undefined) {
10380
10389
  if (typeof inboxValue !== 'number' ||
10381
10390
  !Number.isFinite(inboxValue) ||
@@ -10384,7 +10393,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
10384
10393
  }
10385
10394
  result.inboxCapacity = Math.floor(inboxValue);
10386
10395
  }
10387
- const windowValue = candidate.initialWindow ?? candidate['initial_window'];
10396
+ const windowValue = candidate.initialWindow ??
10397
+ candidate['initial_window'];
10388
10398
  if (windowValue !== undefined) {
10389
10399
  if (typeof windowValue !== 'number' ||
10390
10400
  !Number.isFinite(windowValue) ||
@@ -10723,7 +10733,7 @@ class UpstreamSessionManager extends TaskSpawner {
10723
10733
  const callbackGrants = this.node.gatherSupportedCallbackGrants();
10724
10734
  logger$Z.debug('callback_grants_before_augmentation', {
10725
10735
  count: callbackGrants.length,
10726
- types: callbackGrants.map(g => g.type),
10736
+ types: callbackGrants.map((g) => g.type),
10727
10737
  });
10728
10738
  // Check if we should create a broadcast callback grant before processing connection grants
10729
10739
  // This prevents adding duplicate broadcast grants
@@ -10737,11 +10747,12 @@ class UpstreamSessionManager extends TaskSpawner {
10737
10747
  });
10738
10748
  // Include admission client's connection grants as callback grants
10739
10749
  // This ensures DirectAdmissionClient grants are available for grant selection
10740
- if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
10750
+ if (welcome.frame.connectionGrants &&
10751
+ Array.isArray(welcome.frame.connectionGrants)) {
10741
10752
  for (const grant of welcome.frame.connectionGrants) {
10742
10753
  if (grant && typeof grant === 'object') {
10743
10754
  // Avoid duplicates by checking if grant already exists
10744
- const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
10755
+ const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
10745
10756
  if (!isDuplicate) {
10746
10757
  callbackGrants.push(grant);
10747
10758
  logger$Z.debug('added_connection_grant_as_callback', {
@@ -10758,7 +10769,8 @@ class UpstreamSessionManager extends TaskSpawner {
10758
10769
  }
10759
10770
  // Add broadcast grant after connection grants to ensure we don't duplicate
10760
10771
  // any broadcast grants that may have been in connectionGrants
10761
- if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
10772
+ if (broadcastCallbackGrant &&
10773
+ this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
10762
10774
  callbackGrants.push(broadcastCallbackGrant);
10763
10775
  logger$Z.debug('added_broadcast_callback_grant');
10764
10776
  }
@@ -10767,7 +10779,7 @@ class UpstreamSessionManager extends TaskSpawner {
10767
10779
  }
10768
10780
  logger$Z.debug('callback_grants_after_augmentation', {
10769
10781
  count: callbackGrants.length,
10770
- types: callbackGrants.map(g => g.type),
10782
+ types: callbackGrants.map((g) => g.type),
10771
10783
  });
10772
10784
  const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
10773
10785
  this.targetSystemId = attachInfo.targetSystemId ?? null;
@@ -11009,7 +11021,8 @@ class UpstreamSessionManager extends TaskSpawner {
11009
11021
  continue;
11010
11022
  }
11011
11023
  // Reset ack time if just resumed from pause (prevents immediate timeout)
11012
- if (previousState === ConnectorState.PAUSED && currentState === ConnectorState.STARTED) {
11024
+ if (previousState === ConnectorState.PAUSED &&
11025
+ currentState === ConnectorState.STARTED) {
11013
11026
  logger$Z.debug('connector_just_resumed_resetting_ack_time', {
11014
11027
  previous_state: previousState,
11015
11028
  current_state: currentState,
@@ -12577,7 +12590,8 @@ class DefaultNodeAttachClient {
12577
12590
  const interimHandler = async (envelope, context) => {
12578
12591
  if (this.inHandshake) {
12579
12592
  // Filter: only buffer frames related to our systemId or frames without systemId info
12580
- const frameSystemId = envelope.frame?.systemId;
12593
+ const frameSystemId = envelope.frame
12594
+ ?.systemId;
12581
12595
  if (!frameSystemId || frameSystemId === this.expectedSystemId) {
12582
12596
  this.buffer.push(envelope);
12583
12597
  }
@@ -12773,7 +12787,8 @@ class DefaultNodeAttachClient {
12773
12787
  const deadline = Date.now() + this.timeoutMs;
12774
12788
  while (Date.now() < deadline) {
12775
12789
  // Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
12776
- if (connector.state !== ConnectorState.STARTED && connector.state !== ConnectorState.PAUSED) {
12790
+ if (connector.state !== ConnectorState.STARTED &&
12791
+ connector.state !== ConnectorState.PAUSED) {
12777
12792
  let errorMessage = 'Connector closed while waiting for NodeAttachAck';
12778
12793
  if (connector.closeCode !== undefined) {
12779
12794
  errorMessage += ` (code=${connector.closeCode}`;
@@ -12797,7 +12812,8 @@ class DefaultNodeAttachClient {
12797
12812
  if (envelope.frame.type === 'NodeAttach') {
12798
12813
  logger$W.debug('handshake_ignoring_concurrent_attach', {
12799
12814
  frame_type: envelope.frame.type,
12800
- frame_system_id: envelope.frame?.systemId ?? 'unknown',
12815
+ frame_system_id: envelope.frame?.systemId ??
12816
+ 'unknown',
12801
12817
  });
12802
12818
  }
12803
12819
  else {
@@ -13524,7 +13540,8 @@ function createFsShim() {
13524
13540
  else if (options &&
13525
13541
  typeof options === 'object' &&
13526
13542
  'encoding' in options &&
13527
- typeof options.encoding === 'string') {
13543
+ typeof options.encoding ===
13544
+ 'string') {
13528
13545
  encoding = options.encoding;
13529
13546
  }
13530
13547
  const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
@@ -20457,7 +20474,8 @@ class InPageConnector extends BaseAsyncConnector {
20457
20474
  this.listenerRegistered = false;
20458
20475
  this.visibilityChangeListenerRegistered = false;
20459
20476
  this.channelName =
20460
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
20477
+ typeof config.channelName === 'string' &&
20478
+ config.channelName.trim().length > 0
20461
20479
  ? config.channelName.trim()
20462
20480
  : DEFAULT_CHANNEL$6;
20463
20481
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -20496,7 +20514,8 @@ class InPageConnector extends BaseAsyncConnector {
20496
20514
  channel: this.channelName,
20497
20515
  connector_id: this.connectorId,
20498
20516
  message_type: message && typeof message === 'object'
20499
- ? message.constructor?.name ?? typeof message
20517
+ ? (message.constructor
20518
+ ?.name ?? typeof message)
20500
20519
  : typeof message,
20501
20520
  has_sender_id: Boolean(message?.senderId),
20502
20521
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -20505,7 +20524,8 @@ class InPageConnector extends BaseAsyncConnector {
20505
20524
  return;
20506
20525
  }
20507
20526
  const busMessage = message;
20508
- const senderId = typeof busMessage.senderId === 'string' && busMessage.senderId.length > 0
20527
+ const senderId = typeof busMessage.senderId === 'string' &&
20528
+ busMessage.senderId.length > 0
20509
20529
  ? busMessage.senderId
20510
20530
  : null;
20511
20531
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
@@ -20756,7 +20776,9 @@ class InPageConnector extends BaseAsyncConnector {
20756
20776
  timestamp: new Date().toISOString(),
20757
20777
  });
20758
20778
  }
20759
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
20779
+ if (this.visibilityChangeListenerRegistered &&
20780
+ this.visibilityChangeHandler &&
20781
+ typeof document !== 'undefined') {
20760
20782
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
20761
20783
  this.visibilityChangeListenerRegistered = false;
20762
20784
  this.visibilityChangeHandler = undefined;
@@ -20773,7 +20795,7 @@ class InPageConnector extends BaseAsyncConnector {
20773
20795
  return rawOrEnvelope;
20774
20796
  }
20775
20797
  _isWildcardTarget() {
20776
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
20798
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
20777
20799
  }
20778
20800
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
20779
20801
  if (this._isWildcardTarget()) {
@@ -20793,7 +20815,9 @@ class InPageConnector extends BaseAsyncConnector {
20793
20815
  return true;
20794
20816
  }
20795
20817
  const expectedSender = this.targetNodeId;
20796
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
20818
+ if (expectedSender &&
20819
+ expectedSender !== '*' &&
20820
+ senderNodeId !== expectedSender) {
20797
20821
  logger$G.debug('inpage_message_rejected', {
20798
20822
  channel: this.channelName,
20799
20823
  connector_id: this.connectorId,
@@ -21213,8 +21237,8 @@ class CertificateManagerFactory extends AbstractResourceFactory {
21213
21237
  }
21214
21238
  }
21215
21239
 
21216
- const DEFAULT_UNCONFIGURED_MESSAGE = "Trust store is not configured. Set FAME_CA_CERTS to a PEM value, a file path, a data URI, or an HTTPS bundle URL.";
21217
- const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = "TrustStoreProviderFactory";
21240
+ const DEFAULT_UNCONFIGURED_MESSAGE = 'Trust store is not configured. Set FAME_CA_CERTS to a PEM value, a file path, a data URI, or an HTTPS bundle URL.';
21241
+ const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
21218
21242
  class TrustStoreProviderFactory extends AbstractResourceFactory {
21219
21243
  createUnconfiguredProvider(reason) {
21220
21244
  return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
@@ -24942,7 +24966,8 @@ class DefaultSecurityManager {
24942
24966
  const hasSignature = Boolean(envelope.sec?.sig);
24943
24967
  if (!hasSignature) {
24944
24968
  const nodeSid = node.sid;
24945
- const envelopeSid = envelope.sid;
24969
+ const envelopeSid = envelope
24970
+ .sid;
24946
24971
  const isLocalUnsignedSelfEnvelope = localContext.originType === DeliveryOriginType.LOCAL &&
24947
24972
  typeof nodeSid === 'string' &&
24948
24973
  nodeSid.length > 0 &&
@@ -28222,14 +28247,16 @@ function normalizeInPageConnectionGrant(candidate) {
28222
28247
  type,
28223
28248
  purpose,
28224
28249
  };
28225
- const channelValue = candidate.channelName ?? candidate['channel_name'];
28250
+ const channelValue = candidate.channelName ??
28251
+ candidate['channel_name'];
28226
28252
  if (channelValue !== undefined) {
28227
28253
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
28228
28254
  throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
28229
28255
  }
28230
28256
  result.channelName = channelValue.trim();
28231
28257
  }
28232
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
28258
+ const inboxValue = candidate.inboxCapacity ??
28259
+ candidate['inbox_capacity'];
28233
28260
  if (inboxValue !== undefined) {
28234
28261
  if (typeof inboxValue !== 'number' ||
28235
28262
  !Number.isFinite(inboxValue) ||
@@ -28835,10 +28862,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
28835
28862
  type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
28836
28863
  };
28837
28864
  const channelCandidate = record.channelName ?? record['channel_name'];
28838
- if (typeof channelCandidate === 'string' && channelCandidate.trim().length > 0) {
28865
+ if (typeof channelCandidate === 'string' &&
28866
+ channelCandidate.trim().length > 0) {
28839
28867
  config.channelName = channelCandidate.trim();
28840
28868
  }
28841
- const inboxCandidate = record.inboxCapacity ?? record['inbox_capacity'];
28869
+ const inboxCandidate = record.inboxCapacity ??
28870
+ record['inbox_capacity'];
28842
28871
  if (typeof inboxCandidate === 'number' &&
28843
28872
  Number.isFinite(inboxCandidate) &&
28844
28873
  inboxCandidate > 0) {
@@ -28862,9 +28891,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
28862
28891
  throw new Error('BroadcastChannelConnectorFactory requires a configuration');
28863
28892
  }
28864
28893
  const normalized = this._normalizeConfig(config);
28865
- const options = (factoryArgs[0] ?? {});
28894
+ const options = (factoryArgs[0] ??
28895
+ {});
28866
28896
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
28867
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
28897
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
28898
+ normalizedLocalNodeFromConfig;
28868
28899
  if (!localNodeId) {
28869
28900
  throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
28870
28901
  }
@@ -29011,7 +29042,9 @@ function normalizeConfig$r(config) {
29011
29042
  : DEFAULT_CHANNEL$4;
29012
29043
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
29013
29044
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$4;
29014
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
29045
+ if (typeof rawInbox === 'number' &&
29046
+ Number.isFinite(rawInbox) &&
29047
+ rawInbox > 0) {
29015
29048
  inboxCapacity = Math.floor(rawInbox);
29016
29049
  }
29017
29050
  else if (typeof rawInbox === 'string') {
@@ -29528,7 +29561,8 @@ class InPageConnectorFactory extends ConnectorFactory {
29528
29561
  const normalized = this._normalizeConfig(config);
29529
29562
  const options = (factoryArgs[0] ?? {});
29530
29563
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
29531
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
29564
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
29565
+ normalizedLocalNodeFromConfig;
29532
29566
  if (!localNodeId) {
29533
29567
  throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
29534
29568
  }
@@ -29678,7 +29712,9 @@ function normalizeConfig$p(config) {
29678
29712
  : DEFAULT_CHANNEL$2;
29679
29713
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
29680
29714
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$2;
29681
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
29715
+ if (typeof rawInbox === 'number' &&
29716
+ Number.isFinite(rawInbox) &&
29717
+ rawInbox > 0) {
29682
29718
  inboxCapacity = Math.floor(rawInbox);
29683
29719
  }
29684
29720
  else if (typeof rawInbox === 'string') {
@@ -29706,9 +29742,7 @@ class InPageListenerFactory extends TransportListenerFactory {
29706
29742
  }
29707
29743
  async create(config, ...factoryArgs) {
29708
29744
  const normalized = normalizeConfig$p(config);
29709
- const [{ InPageListener }] = await Promise.all([
29710
- getInPageListenerModule(),
29711
- ]);
29745
+ const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
29712
29746
  return new InPageListener({
29713
29747
  channelName: normalized.channelName,
29714
29748
  inboxCapacity: normalized.inboxCapacity,
@@ -32759,19 +32793,23 @@ function normalizeConfig$a(config) {
32759
32793
  normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
32760
32794
  }
32761
32795
  const audienceCandidate = candidate.audience ?? candidate.aud;
32762
- if (typeof audienceCandidate === 'string' && audienceCandidate.trim().length > 0) {
32796
+ if (typeof audienceCandidate === 'string' &&
32797
+ audienceCandidate.trim().length > 0) {
32763
32798
  normalized.audience = audienceCandidate.trim();
32764
32799
  }
32765
32800
  const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
32766
- if (typeof codeChallengeMethod === 'string' && codeChallengeMethod.trim().length > 0) {
32801
+ if (typeof codeChallengeMethod === 'string' &&
32802
+ codeChallengeMethod.trim().length > 0) {
32767
32803
  normalized.codeChallengeMethod = codeChallengeMethod.trim();
32768
32804
  }
32769
32805
  const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
32770
- if (typeof codeVerifierLength === 'number' && Number.isFinite(codeVerifierLength)) {
32806
+ if (typeof codeVerifierLength === 'number' &&
32807
+ Number.isFinite(codeVerifierLength)) {
32771
32808
  normalized.codeVerifierLength = codeVerifierLength;
32772
32809
  }
32773
32810
  const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
32774
- if (typeof clockSkewSeconds === 'number' && Number.isFinite(clockSkewSeconds)) {
32811
+ if (typeof clockSkewSeconds === 'number' &&
32812
+ Number.isFinite(clockSkewSeconds)) {
32775
32813
  normalized.clockSkewSeconds = clockSkewSeconds;
32776
32814
  }
32777
32815
  const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
@@ -32816,8 +32854,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
32816
32854
  options.audience = normalized.audience;
32817
32855
  }
32818
32856
  if (normalized.codeChallengeMethod) {
32819
- options.codeChallengeMethod = normalized.codeChallengeMethod
32820
- .toUpperCase();
32857
+ options.codeChallengeMethod =
32858
+ normalized.codeChallengeMethod.toUpperCase();
32821
32859
  }
32822
32860
  if (normalized.codeVerifierLength) {
32823
32861
  options.codeVerifierLength = normalized.codeVerifierLength;
@@ -34574,14 +34612,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
34574
34612
 
34575
34613
  const FACTORY_META$d = {
34576
34614
  base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
34577
- key: "NoopTrustStoreProvider",
34615
+ key: 'NoopTrustStoreProvider',
34578
34616
  isDefault: true,
34579
34617
  priority: 10,
34580
34618
  };
34581
34619
  class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
34582
34620
  constructor() {
34583
34621
  super(...arguments);
34584
- this.type = "NoopTrustStoreProvider";
34622
+ this.type = 'NoopTrustStoreProvider';
34585
34623
  this.isDefault = true;
34586
34624
  this.priority = 10;
34587
34625
  }
@@ -36284,9 +36322,7 @@ const defaultGrantSelectionPolicy = new GrantSelectionPolicy();
36284
36322
  const logger$a = getLogger('naylence.fame.connector.broadcast_channel_listener');
36285
36323
  const DEFAULT_CHANNEL$1 = 'naylence-fabric';
36286
36324
  const DEFAULT_INBOX_CAPACITY$1 = 2048;
36287
- const RESPONSE_TYPE_MASK = FameResponseType.ACK |
36288
- FameResponseType.REPLY |
36289
- FameResponseType.STREAM;
36325
+ const RESPONSE_TYPE_MASK = FameResponseType.ACK | FameResponseType.REPLY | FameResponseType.STREAM;
36290
36326
  const isBrowserEnvironment$2 = () => typeof window !== 'undefined' &&
36291
36327
  typeof BroadcastChannel !== 'undefined' &&
36292
36328
  typeof MessageEvent !== 'undefined';
@@ -36500,9 +36536,7 @@ class BroadcastChannelListener extends TransportListener {
36500
36536
  return null;
36501
36537
  }
36502
36538
  })();
36503
- if (error instanceof ZodError &&
36504
- decoded &&
36505
- decoded.length > 0) {
36539
+ if (error instanceof ZodError && decoded && decoded.length > 0) {
36506
36540
  try {
36507
36541
  const reparsed = JSON.parse(decoded);
36508
36542
  const candidate = reparsed.rtype;
@@ -37488,7 +37522,9 @@ class InPageListener extends TransportListener {
37488
37522
  typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
37489
37523
  ? channelCandidate.trim()
37490
37524
  : DEFAULT_CHANNEL;
37491
- const normalizedCapacity = typeof inboxCandidate === 'number' && Number.isFinite(inboxCandidate) && inboxCandidate > 0
37525
+ const normalizedCapacity = typeof inboxCandidate === 'number' &&
37526
+ Number.isFinite(inboxCandidate) &&
37527
+ inboxCandidate > 0
37492
37528
  ? Math.floor(inboxCandidate)
37493
37529
  : DEFAULT_INBOX_CAPACITY;
37494
37530
  this._inboxCapacity = normalizedCapacity;
@@ -37763,7 +37799,8 @@ class InPageListener extends TransportListener {
37763
37799
  if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
37764
37800
  return inPageGrantToConnectorConfig(grant);
37765
37801
  }
37766
- if (typeof grant?.toConnectorConfig === 'function') {
37802
+ if (typeof grant
37803
+ ?.toConnectorConfig === 'function') {
37767
37804
  return grant.toConnectorConfig();
37768
37805
  }
37769
37806
  throw new Error(`Unsupported grant type: ${grant.type}`);
@@ -39301,8 +39338,7 @@ function normalizeOptions$2(raw) {
39301
39338
  const scopes = normalizeScopes(camel.scopes) ??
39302
39339
  normalizeScopes(snake.scopes ?? snake.scope) ??
39303
39340
  DEFAULT_SCOPES.slice();
39304
- const audience = coerceString(camel.audience) ??
39305
- coerceString(snake.audience ?? snake.aud);
39341
+ const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
39306
39342
  const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
39307
39343
  const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
39308
39344
  coerceNumber(snake.clock_skew_seconds) ??