@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
@@ -28,7 +28,8 @@ function installProcessEnvShim() {
28
28
  if (g.__ENV__ && typeof g.__ENV__ === 'object')
29
29
  Object.assign(out, g.__ENV__);
30
30
  try {
31
- // @ts-ignore -- import.meta is only available in ESM builds
31
+ // import.meta is only available in ESM builds
32
+ // @ts-ignore
32
33
  const ie = (typeof import.meta !== 'undefined' && import.meta.env) || undefined;
33
34
  if (ie && typeof ie === 'object')
34
35
  Object.assign(out, ie);
@@ -96,12 +97,12 @@ installProcessEnvShim();
96
97
  // --- END ENV SHIM ---
97
98
 
98
99
  // This file is auto-generated during build - do not edit manually
99
- // Generated from package.json version: 0.3.6-test.108
100
+ // Generated from package.json version: 0.3.7
100
101
  /**
101
102
  * The package version, injected at build time.
102
103
  * @internal
103
104
  */
104
- const VERSION = '0.3.6-test.108';
105
+ const VERSION = '0.3.7';
105
106
 
106
107
  /**
107
108
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -9857,7 +9858,8 @@ const ensureBroadcastEnvironment = () => {
9857
9858
  };
9858
9859
  let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
9859
9860
  static generateConnectorId() {
9860
- const globalCrypto = globalThis.crypto;
9861
+ const globalCrypto = globalThis
9862
+ .crypto;
9861
9863
  if (globalCrypto?.randomUUID) {
9862
9864
  return globalCrypto.randomUUID();
9863
9865
  }
@@ -9912,7 +9914,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
9912
9914
  this.listenerRegistered = false;
9913
9915
  this.visibilityChangeListenerRegistered = false;
9914
9916
  this.channelName =
9915
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
9917
+ typeof config.channelName === 'string' &&
9918
+ config.channelName.trim().length > 0
9916
9919
  ? config.channelName.trim()
9917
9920
  : DEFAULT_CHANNEL$7;
9918
9921
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -9954,7 +9957,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
9954
9957
  channel: this.channelName,
9955
9958
  connector_id: this.connectorId,
9956
9959
  message_type: message && typeof message === 'object'
9957
- ? message.constructor?.name ?? typeof message
9960
+ ? (message.constructor
9961
+ ?.name ?? typeof message)
9958
9962
  : typeof message,
9959
9963
  has_sender_id: Boolean(message?.senderId),
9960
9964
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -10184,7 +10188,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10184
10188
  timestamp: new Date().toISOString(),
10185
10189
  });
10186
10190
  }
10187
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
10191
+ if (this.visibilityChangeListenerRegistered &&
10192
+ this.visibilityChangeHandler &&
10193
+ typeof document !== 'undefined') {
10188
10194
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
10189
10195
  this.visibilityChangeListenerRegistered = false;
10190
10196
  this.visibilityChangeHandler = undefined;
@@ -10212,7 +10218,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10212
10218
  return rawOrEnvelope;
10213
10219
  }
10214
10220
  _isWildcardTarget() {
10215
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
10221
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
10216
10222
  }
10217
10223
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
10218
10224
  if (this._isWildcardTarget()) {
@@ -10232,7 +10238,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10232
10238
  return true;
10233
10239
  }
10234
10240
  const expectedSender = this.targetNodeId;
10235
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
10241
+ if (expectedSender &&
10242
+ expectedSender !== '*' &&
10243
+ senderNodeId !== expectedSender) {
10236
10244
  logger$_.debug('broadcast_channel_message_rejected', {
10237
10245
  channel: this.channelName,
10238
10246
  connector_id: this.connectorId,
@@ -10451,14 +10459,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
10451
10459
  type,
10452
10460
  purpose,
10453
10461
  };
10454
- const channelValue = candidate.channelName ?? candidate['channel_name'];
10462
+ const channelValue = candidate.channelName ??
10463
+ candidate['channel_name'];
10455
10464
  if (channelValue !== undefined) {
10456
10465
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
10457
10466
  throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
10458
10467
  }
10459
10468
  result.channelName = channelValue.trim();
10460
10469
  }
10461
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
10470
+ const inboxValue = candidate.inboxCapacity ??
10471
+ candidate['inbox_capacity'];
10462
10472
  if (inboxValue !== undefined) {
10463
10473
  if (typeof inboxValue !== 'number' ||
10464
10474
  !Number.isFinite(inboxValue) ||
@@ -10467,7 +10477,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
10467
10477
  }
10468
10478
  result.inboxCapacity = Math.floor(inboxValue);
10469
10479
  }
10470
- const windowValue = candidate.initialWindow ?? candidate['initial_window'];
10480
+ const windowValue = candidate.initialWindow ??
10481
+ candidate['initial_window'];
10471
10482
  if (windowValue !== undefined) {
10472
10483
  if (typeof windowValue !== 'number' ||
10473
10484
  !Number.isFinite(windowValue) ||
@@ -10806,7 +10817,7 @@ class UpstreamSessionManager extends TaskSpawner {
10806
10817
  const callbackGrants = this.node.gatherSupportedCallbackGrants();
10807
10818
  logger$Z.debug('callback_grants_before_augmentation', {
10808
10819
  count: callbackGrants.length,
10809
- types: callbackGrants.map(g => g.type),
10820
+ types: callbackGrants.map((g) => g.type),
10810
10821
  });
10811
10822
  // Check if we should create a broadcast callback grant before processing connection grants
10812
10823
  // This prevents adding duplicate broadcast grants
@@ -10820,11 +10831,12 @@ class UpstreamSessionManager extends TaskSpawner {
10820
10831
  });
10821
10832
  // Include admission client's connection grants as callback grants
10822
10833
  // This ensures DirectAdmissionClient grants are available for grant selection
10823
- if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
10834
+ if (welcome.frame.connectionGrants &&
10835
+ Array.isArray(welcome.frame.connectionGrants)) {
10824
10836
  for (const grant of welcome.frame.connectionGrants) {
10825
10837
  if (grant && typeof grant === 'object') {
10826
10838
  // Avoid duplicates by checking if grant already exists
10827
- const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
10839
+ const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
10828
10840
  if (!isDuplicate) {
10829
10841
  callbackGrants.push(grant);
10830
10842
  logger$Z.debug('added_connection_grant_as_callback', {
@@ -10841,7 +10853,8 @@ class UpstreamSessionManager extends TaskSpawner {
10841
10853
  }
10842
10854
  // Add broadcast grant after connection grants to ensure we don't duplicate
10843
10855
  // any broadcast grants that may have been in connectionGrants
10844
- if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
10856
+ if (broadcastCallbackGrant &&
10857
+ this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
10845
10858
  callbackGrants.push(broadcastCallbackGrant);
10846
10859
  logger$Z.debug('added_broadcast_callback_grant');
10847
10860
  }
@@ -10850,7 +10863,7 @@ class UpstreamSessionManager extends TaskSpawner {
10850
10863
  }
10851
10864
  logger$Z.debug('callback_grants_after_augmentation', {
10852
10865
  count: callbackGrants.length,
10853
- types: callbackGrants.map(g => g.type),
10866
+ types: callbackGrants.map((g) => g.type),
10854
10867
  });
10855
10868
  const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
10856
10869
  this.targetSystemId = attachInfo.targetSystemId ?? null;
@@ -11092,7 +11105,8 @@ class UpstreamSessionManager extends TaskSpawner {
11092
11105
  continue;
11093
11106
  }
11094
11107
  // Reset ack time if just resumed from pause (prevents immediate timeout)
11095
- if (previousState === ConnectorState.PAUSED && currentState === ConnectorState.STARTED) {
11108
+ if (previousState === ConnectorState.PAUSED &&
11109
+ currentState === ConnectorState.STARTED) {
11096
11110
  logger$Z.debug('connector_just_resumed_resetting_ack_time', {
11097
11111
  previous_state: previousState,
11098
11112
  current_state: currentState,
@@ -12660,7 +12674,8 @@ class DefaultNodeAttachClient {
12660
12674
  const interimHandler = async (envelope, context) => {
12661
12675
  if (this.inHandshake) {
12662
12676
  // Filter: only buffer frames related to our systemId or frames without systemId info
12663
- const frameSystemId = envelope.frame?.systemId;
12677
+ const frameSystemId = envelope.frame
12678
+ ?.systemId;
12664
12679
  if (!frameSystemId || frameSystemId === this.expectedSystemId) {
12665
12680
  this.buffer.push(envelope);
12666
12681
  }
@@ -12856,7 +12871,8 @@ class DefaultNodeAttachClient {
12856
12871
  const deadline = Date.now() + this.timeoutMs;
12857
12872
  while (Date.now() < deadline) {
12858
12873
  // Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
12859
- if (connector.state !== ConnectorState.STARTED && connector.state !== ConnectorState.PAUSED) {
12874
+ if (connector.state !== ConnectorState.STARTED &&
12875
+ connector.state !== ConnectorState.PAUSED) {
12860
12876
  let errorMessage = 'Connector closed while waiting for NodeAttachAck';
12861
12877
  if (connector.closeCode !== undefined) {
12862
12878
  errorMessage += ` (code=${connector.closeCode}`;
@@ -12880,7 +12896,8 @@ class DefaultNodeAttachClient {
12880
12896
  if (envelope.frame.type === 'NodeAttach') {
12881
12897
  logger$W.debug('handshake_ignoring_concurrent_attach', {
12882
12898
  frame_type: envelope.frame.type,
12883
- frame_system_id: envelope.frame?.systemId ?? 'unknown',
12899
+ frame_system_id: envelope.frame?.systemId ??
12900
+ 'unknown',
12884
12901
  });
12885
12902
  }
12886
12903
  else {
@@ -13607,7 +13624,8 @@ function createFsShim() {
13607
13624
  else if (options &&
13608
13625
  typeof options === 'object' &&
13609
13626
  'encoding' in options &&
13610
- typeof options.encoding === 'string') {
13627
+ typeof options.encoding ===
13628
+ 'string') {
13611
13629
  encoding = options.encoding;
13612
13630
  }
13613
13631
  const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
@@ -20540,7 +20558,8 @@ class InPageConnector extends BaseAsyncConnector {
20540
20558
  this.listenerRegistered = false;
20541
20559
  this.visibilityChangeListenerRegistered = false;
20542
20560
  this.channelName =
20543
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
20561
+ typeof config.channelName === 'string' &&
20562
+ config.channelName.trim().length > 0
20544
20563
  ? config.channelName.trim()
20545
20564
  : DEFAULT_CHANNEL$6;
20546
20565
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -20579,7 +20598,8 @@ class InPageConnector extends BaseAsyncConnector {
20579
20598
  channel: this.channelName,
20580
20599
  connector_id: this.connectorId,
20581
20600
  message_type: message && typeof message === 'object'
20582
- ? message.constructor?.name ?? typeof message
20601
+ ? (message.constructor
20602
+ ?.name ?? typeof message)
20583
20603
  : typeof message,
20584
20604
  has_sender_id: Boolean(message?.senderId),
20585
20605
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -20588,7 +20608,8 @@ class InPageConnector extends BaseAsyncConnector {
20588
20608
  return;
20589
20609
  }
20590
20610
  const busMessage = message;
20591
- const senderId = typeof busMessage.senderId === 'string' && busMessage.senderId.length > 0
20611
+ const senderId = typeof busMessage.senderId === 'string' &&
20612
+ busMessage.senderId.length > 0
20592
20613
  ? busMessage.senderId
20593
20614
  : null;
20594
20615
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
@@ -20839,7 +20860,9 @@ class InPageConnector extends BaseAsyncConnector {
20839
20860
  timestamp: new Date().toISOString(),
20840
20861
  });
20841
20862
  }
20842
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
20863
+ if (this.visibilityChangeListenerRegistered &&
20864
+ this.visibilityChangeHandler &&
20865
+ typeof document !== 'undefined') {
20843
20866
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
20844
20867
  this.visibilityChangeListenerRegistered = false;
20845
20868
  this.visibilityChangeHandler = undefined;
@@ -20856,7 +20879,7 @@ class InPageConnector extends BaseAsyncConnector {
20856
20879
  return rawOrEnvelope;
20857
20880
  }
20858
20881
  _isWildcardTarget() {
20859
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
20882
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
20860
20883
  }
20861
20884
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
20862
20885
  if (this._isWildcardTarget()) {
@@ -20876,7 +20899,9 @@ class InPageConnector extends BaseAsyncConnector {
20876
20899
  return true;
20877
20900
  }
20878
20901
  const expectedSender = this.targetNodeId;
20879
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
20902
+ if (expectedSender &&
20903
+ expectedSender !== '*' &&
20904
+ senderNodeId !== expectedSender) {
20880
20905
  logger$G.debug('inpage_message_rejected', {
20881
20906
  channel: this.channelName,
20882
20907
  connector_id: this.connectorId,
@@ -21296,8 +21321,8 @@ class CertificateManagerFactory extends AbstractResourceFactory {
21296
21321
  }
21297
21322
  }
21298
21323
 
21299
- 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.";
21300
- const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = "TrustStoreProviderFactory";
21324
+ 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.';
21325
+ const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
21301
21326
  class TrustStoreProviderFactory extends AbstractResourceFactory {
21302
21327
  createUnconfiguredProvider(reason) {
21303
21328
  return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
@@ -25025,7 +25050,8 @@ class DefaultSecurityManager {
25025
25050
  const hasSignature = Boolean(envelope.sec?.sig);
25026
25051
  if (!hasSignature) {
25027
25052
  const nodeSid = node.sid;
25028
- const envelopeSid = envelope.sid;
25053
+ const envelopeSid = envelope
25054
+ .sid;
25029
25055
  const isLocalUnsignedSelfEnvelope = localContext.originType === DeliveryOriginType.LOCAL &&
25030
25056
  typeof nodeSid === 'string' &&
25031
25057
  nodeSid.length > 0 &&
@@ -28305,14 +28331,16 @@ function normalizeInPageConnectionGrant(candidate) {
28305
28331
  type,
28306
28332
  purpose,
28307
28333
  };
28308
- const channelValue = candidate.channelName ?? candidate['channel_name'];
28334
+ const channelValue = candidate.channelName ??
28335
+ candidate['channel_name'];
28309
28336
  if (channelValue !== undefined) {
28310
28337
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
28311
28338
  throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
28312
28339
  }
28313
28340
  result.channelName = channelValue.trim();
28314
28341
  }
28315
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
28342
+ const inboxValue = candidate.inboxCapacity ??
28343
+ candidate['inbox_capacity'];
28316
28344
  if (inboxValue !== undefined) {
28317
28345
  if (typeof inboxValue !== 'number' ||
28318
28346
  !Number.isFinite(inboxValue) ||
@@ -28940,7 +28968,8 @@ class InPageConnectorFactory extends ConnectorFactory {
28940
28968
  const normalized = this._normalizeConfig(config);
28941
28969
  const options = (factoryArgs[0] ?? {});
28942
28970
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
28943
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
28971
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
28972
+ normalizedLocalNodeFromConfig;
28944
28973
  if (!localNodeId) {
28945
28974
  throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
28946
28975
  }
@@ -29116,10 +29145,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
29116
29145
  type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
29117
29146
  };
29118
29147
  const channelCandidate = record.channelName ?? record['channel_name'];
29119
- if (typeof channelCandidate === 'string' && channelCandidate.trim().length > 0) {
29148
+ if (typeof channelCandidate === 'string' &&
29149
+ channelCandidate.trim().length > 0) {
29120
29150
  config.channelName = channelCandidate.trim();
29121
29151
  }
29122
- const inboxCandidate = record.inboxCapacity ?? record['inbox_capacity'];
29152
+ const inboxCandidate = record.inboxCapacity ??
29153
+ record['inbox_capacity'];
29123
29154
  if (typeof inboxCandidate === 'number' &&
29124
29155
  Number.isFinite(inboxCandidate) &&
29125
29156
  inboxCandidate > 0) {
@@ -29143,9 +29174,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
29143
29174
  throw new Error('BroadcastChannelConnectorFactory requires a configuration');
29144
29175
  }
29145
29176
  const normalized = this._normalizeConfig(config);
29146
- const options = (factoryArgs[0] ?? {});
29177
+ const options = (factoryArgs[0] ??
29178
+ {});
29147
29179
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
29148
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
29180
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
29181
+ normalizedLocalNodeFromConfig;
29149
29182
  if (!localNodeId) {
29150
29183
  throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
29151
29184
  }
@@ -29637,7 +29670,9 @@ class InPageListener extends TransportListener {
29637
29670
  typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
29638
29671
  ? channelCandidate.trim()
29639
29672
  : DEFAULT_CHANNEL$3;
29640
- const normalizedCapacity = typeof inboxCandidate === 'number' && Number.isFinite(inboxCandidate) && inboxCandidate > 0
29673
+ const normalizedCapacity = typeof inboxCandidate === 'number' &&
29674
+ Number.isFinite(inboxCandidate) &&
29675
+ inboxCandidate > 0
29641
29676
  ? Math.floor(inboxCandidate)
29642
29677
  : DEFAULT_INBOX_CAPACITY$3;
29643
29678
  this._inboxCapacity = normalizedCapacity;
@@ -29912,7 +29947,8 @@ class InPageListener extends TransportListener {
29912
29947
  if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
29913
29948
  return inPageGrantToConnectorConfig(grant);
29914
29949
  }
29915
- if (typeof grant?.toConnectorConfig === 'function') {
29950
+ if (typeof grant
29951
+ ?.toConnectorConfig === 'function') {
29916
29952
  return grant.toConnectorConfig();
29917
29953
  }
29918
29954
  throw new Error(`Unsupported grant type: ${grant.type}`);
@@ -30066,7 +30102,9 @@ function normalizeConfig$r(config) {
30066
30102
  : DEFAULT_CHANNEL$2;
30067
30103
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30068
30104
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$2;
30069
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30105
+ if (typeof rawInbox === 'number' &&
30106
+ Number.isFinite(rawInbox) &&
30107
+ rawInbox > 0) {
30070
30108
  inboxCapacity = Math.floor(rawInbox);
30071
30109
  }
30072
30110
  else if (typeof rawInbox === 'string') {
@@ -30094,9 +30132,7 @@ class InPageListenerFactory extends TransportListenerFactory {
30094
30132
  }
30095
30133
  async create(config, ...factoryArgs) {
30096
30134
  const normalized = normalizeConfig$r(config);
30097
- const [{ InPageListener }] = await Promise.all([
30098
- getInPageListenerModule(),
30099
- ]);
30135
+ const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
30100
30136
  return new InPageListener({
30101
30137
  channelName: normalized.channelName,
30102
30138
  inboxCapacity: normalized.inboxCapacity,
@@ -30114,9 +30150,7 @@ var inpageListenerFactory = /*#__PURE__*/Object.freeze({
30114
30150
  const logger$o = getLogger('naylence.fame.connector.broadcast_channel_listener');
30115
30151
  const DEFAULT_CHANNEL$1 = 'naylence-fabric';
30116
30152
  const DEFAULT_INBOX_CAPACITY$1 = 2048;
30117
- const RESPONSE_TYPE_MASK = FameResponseType.ACK |
30118
- FameResponseType.REPLY |
30119
- FameResponseType.STREAM;
30153
+ const RESPONSE_TYPE_MASK = FameResponseType.ACK | FameResponseType.REPLY | FameResponseType.STREAM;
30120
30154
  const isBrowserEnvironment$1 = () => typeof window !== 'undefined' &&
30121
30155
  typeof BroadcastChannel !== 'undefined' &&
30122
30156
  typeof MessageEvent !== 'undefined';
@@ -30330,9 +30364,7 @@ class BroadcastChannelListener extends TransportListener {
30330
30364
  return null;
30331
30365
  }
30332
30366
  })();
30333
- if (error instanceof ZodError &&
30334
- decoded &&
30335
- decoded.length > 0) {
30367
+ if (error instanceof ZodError && decoded && decoded.length > 0) {
30336
30368
  try {
30337
30369
  const reparsed = JSON.parse(decoded);
30338
30370
  const candidate = reparsed.rtype;
@@ -30680,7 +30712,9 @@ function normalizeConfig$q(config) {
30680
30712
  : DEFAULT_CHANNEL;
30681
30713
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30682
30714
  let inboxCapacity = DEFAULT_INBOX_CAPACITY;
30683
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30715
+ if (typeof rawInbox === 'number' &&
30716
+ Number.isFinite(rawInbox) &&
30717
+ rawInbox > 0) {
30684
30718
  inboxCapacity = Math.floor(rawInbox);
30685
30719
  }
30686
30720
  else if (typeof rawInbox === 'string') {
@@ -34170,19 +34204,23 @@ function normalizeConfig$a(config) {
34170
34204
  normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
34171
34205
  }
34172
34206
  const audienceCandidate = candidate.audience ?? candidate.aud;
34173
- if (typeof audienceCandidate === 'string' && audienceCandidate.trim().length > 0) {
34207
+ if (typeof audienceCandidate === 'string' &&
34208
+ audienceCandidate.trim().length > 0) {
34174
34209
  normalized.audience = audienceCandidate.trim();
34175
34210
  }
34176
34211
  const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
34177
- if (typeof codeChallengeMethod === 'string' && codeChallengeMethod.trim().length > 0) {
34212
+ if (typeof codeChallengeMethod === 'string' &&
34213
+ codeChallengeMethod.trim().length > 0) {
34178
34214
  normalized.codeChallengeMethod = codeChallengeMethod.trim();
34179
34215
  }
34180
34216
  const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
34181
- if (typeof codeVerifierLength === 'number' && Number.isFinite(codeVerifierLength)) {
34217
+ if (typeof codeVerifierLength === 'number' &&
34218
+ Number.isFinite(codeVerifierLength)) {
34182
34219
  normalized.codeVerifierLength = codeVerifierLength;
34183
34220
  }
34184
34221
  const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
34185
- if (typeof clockSkewSeconds === 'number' && Number.isFinite(clockSkewSeconds)) {
34222
+ if (typeof clockSkewSeconds === 'number' &&
34223
+ Number.isFinite(clockSkewSeconds)) {
34186
34224
  normalized.clockSkewSeconds = clockSkewSeconds;
34187
34225
  }
34188
34226
  const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
@@ -34227,8 +34265,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
34227
34265
  options.audience = normalized.audience;
34228
34266
  }
34229
34267
  if (normalized.codeChallengeMethod) {
34230
- options.codeChallengeMethod = normalized.codeChallengeMethod
34231
- .toUpperCase();
34268
+ options.codeChallengeMethod =
34269
+ normalized.codeChallengeMethod.toUpperCase();
34232
34270
  }
34233
34271
  if (normalized.codeVerifierLength) {
34234
34272
  options.codeVerifierLength = normalized.codeVerifierLength;
@@ -35985,14 +36023,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
35985
36023
 
35986
36024
  const FACTORY_META$d = {
35987
36025
  base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
35988
- key: "NoopTrustStoreProvider",
36026
+ key: 'NoopTrustStoreProvider',
35989
36027
  isDefault: true,
35990
36028
  priority: 10,
35991
36029
  };
35992
36030
  class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
35993
36031
  constructor() {
35994
36032
  super(...arguments);
35995
- this.type = "NoopTrustStoreProvider";
36033
+ this.type = 'NoopTrustStoreProvider';
35996
36034
  this.isDefault = true;
35997
36035
  this.priority = 10;
35998
36036
  }
@@ -39386,8 +39424,7 @@ function normalizeOptions$2(raw) {
39386
39424
  const scopes = normalizeScopes(camel.scopes) ??
39387
39425
  normalizeScopes(snake.scopes ?? snake.scope) ??
39388
39426
  DEFAULT_SCOPES.slice();
39389
- const audience = coerceString(camel.audience) ??
39390
- coerceString(snake.audience ?? snake.aud);
39427
+ const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
39391
39428
  const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
39392
39429
  const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
39393
39430
  coerceNumber(snake.clock_skew_seconds) ??
@@ -17,7 +17,8 @@ function installProcessEnvShim() {
17
17
  if (g.__ENV__ && typeof g.__ENV__ === 'object')
18
18
  Object.assign(out, g.__ENV__);
19
19
  try {
20
- // @ts-ignore -- import.meta is only available in ESM builds
20
+ // import.meta is only available in ESM builds
21
+ // @ts-ignore
21
22
  const ie = (typeof import.meta !== 'undefined' && import.meta.env) || undefined;
22
23
  if (ie && typeof ie === 'object')
23
24
  Object.assign(out, ie);
@@ -93,7 +93,8 @@ function createFsShim() {
93
93
  else if (options &&
94
94
  typeof options === 'object' &&
95
95
  'encoding' in options &&
96
- typeof options.encoding === 'string') {
96
+ typeof options.encoding ===
97
+ 'string') {
97
98
  encoding = options.encoding;
98
99
  }
99
100
  const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
@@ -47,10 +47,12 @@ class BroadcastChannelConnectorFactory extends connector_factory_js_1.ConnectorF
47
47
  type: broadcast_channel_connector_js_1.BROADCAST_CHANNEL_CONNECTOR_TYPE,
48
48
  };
49
49
  const channelCandidate = record.channelName ?? record['channel_name'];
50
- if (typeof channelCandidate === 'string' && channelCandidate.trim().length > 0) {
50
+ if (typeof channelCandidate === 'string' &&
51
+ channelCandidate.trim().length > 0) {
51
52
  config.channelName = channelCandidate.trim();
52
53
  }
53
- const inboxCandidate = record.inboxCapacity ?? record['inbox_capacity'];
54
+ const inboxCandidate = record.inboxCapacity ??
55
+ record['inbox_capacity'];
54
56
  if (typeof inboxCandidate === 'number' &&
55
57
  Number.isFinite(inboxCandidate) &&
56
58
  inboxCandidate > 0) {
@@ -74,9 +76,11 @@ class BroadcastChannelConnectorFactory extends connector_factory_js_1.ConnectorF
74
76
  throw new Error('BroadcastChannelConnectorFactory requires a configuration');
75
77
  }
76
78
  const normalized = this._normalizeConfig(config);
77
- const options = (factoryArgs[0] ?? {});
79
+ const options = (factoryArgs[0] ??
80
+ {});
78
81
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
79
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
82
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
83
+ normalizedLocalNodeFromConfig;
80
84
  if (!localNodeId) {
81
85
  throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
82
86
  }
@@ -20,7 +20,8 @@ const ensureBroadcastEnvironment = () => {
20
20
  };
21
21
  class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConnector {
22
22
  static generateConnectorId() {
23
- const globalCrypto = globalThis.crypto;
23
+ const globalCrypto = globalThis
24
+ .crypto;
24
25
  if (globalCrypto?.randomUUID) {
25
26
  return globalCrypto.randomUUID();
26
27
  }
@@ -75,7 +76,8 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
75
76
  this.listenerRegistered = false;
76
77
  this.visibilityChangeListenerRegistered = false;
77
78
  this.channelName =
78
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
79
+ typeof config.channelName === 'string' &&
80
+ config.channelName.trim().length > 0
79
81
  ? config.channelName.trim()
80
82
  : DEFAULT_CHANNEL;
81
83
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -117,7 +119,8 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
117
119
  channel: this.channelName,
118
120
  connector_id: this.connectorId,
119
121
  message_type: message && typeof message === 'object'
120
- ? message.constructor?.name ?? typeof message
122
+ ? (message.constructor
123
+ ?.name ?? typeof message)
121
124
  : typeof message,
122
125
  has_sender_id: Boolean(message?.senderId),
123
126
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -347,7 +350,9 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
347
350
  timestamp: new Date().toISOString(),
348
351
  });
349
352
  }
350
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
353
+ if (this.visibilityChangeListenerRegistered &&
354
+ this.visibilityChangeHandler &&
355
+ typeof document !== 'undefined') {
351
356
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
352
357
  this.visibilityChangeListenerRegistered = false;
353
358
  this.visibilityChangeHandler = undefined;
@@ -375,7 +380,7 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
375
380
  return rawOrEnvelope;
376
381
  }
377
382
  _isWildcardTarget() {
378
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
383
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
379
384
  }
380
385
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
381
386
  if (this._isWildcardTarget()) {
@@ -395,7 +400,9 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
395
400
  return true;
396
401
  }
397
402
  const expectedSender = this.targetNodeId;
398
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
403
+ if (expectedSender &&
404
+ expectedSender !== '*' &&
405
+ senderNodeId !== expectedSender) {
399
406
  logger.debug('broadcast_channel_message_rejected', {
400
407
  channel: this.channelName,
401
408
  connector_id: this.connectorId,
@@ -53,7 +53,9 @@ function normalizeConfig(config) {
53
53
  : DEFAULT_CHANNEL;
54
54
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
55
55
  let inboxCapacity = DEFAULT_INBOX_CAPACITY;
56
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
56
+ if (typeof rawInbox === 'number' &&
57
+ Number.isFinite(rawInbox) &&
58
+ rawInbox > 0) {
57
59
  inboxCapacity = Math.floor(rawInbox);
58
60
  }
59
61
  else if (typeof rawInbox === 'string') {
@@ -14,9 +14,7 @@ const broadcast_channel_connection_grant_js_1 = require("../grants/broadcast-cha
14
14
  const logger = (0, logging_js_1.getLogger)('naylence.fame.connector.broadcast_channel_listener');
15
15
  const DEFAULT_CHANNEL = 'naylence-fabric';
16
16
  const DEFAULT_INBOX_CAPACITY = 2048;
17
- const RESPONSE_TYPE_MASK = core_1.FameResponseType.ACK |
18
- core_1.FameResponseType.REPLY |
19
- core_1.FameResponseType.STREAM;
17
+ const RESPONSE_TYPE_MASK = core_1.FameResponseType.ACK | core_1.FameResponseType.REPLY | core_1.FameResponseType.STREAM;
20
18
  const isBrowserEnvironment = () => typeof window !== 'undefined' &&
21
19
  typeof BroadcastChannel !== 'undefined' &&
22
20
  typeof MessageEvent !== 'undefined';
@@ -230,9 +228,7 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
230
228
  return null;
231
229
  }
232
230
  })();
233
- if (error instanceof zod_1.ZodError &&
234
- decoded &&
235
- decoded.length > 0) {
231
+ if (error instanceof zod_1.ZodError && decoded && decoded.length > 0) {
236
232
  try {
237
233
  const reparsed = JSON.parse(decoded);
238
234
  const candidate = reparsed.rtype;
@@ -69,7 +69,8 @@ class InPageConnectorFactory extends connector_factory_js_1.ConnectorFactory {
69
69
  const normalized = this._normalizeConfig(config);
70
70
  const options = (factoryArgs[0] ?? {});
71
71
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
72
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
72
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
73
+ normalizedLocalNodeFromConfig;
73
74
  if (!localNodeId) {
74
75
  throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
75
76
  }