@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
@@ -5562,12 +5562,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5562
5562
  }
5563
5563
 
5564
5564
  // This file is auto-generated during build - do not edit manually
5565
- // Generated from package.json version: 0.3.6-test.108
5565
+ // Generated from package.json version: 0.3.7
5566
5566
  /**
5567
5567
  * The package version, injected at build time.
5568
5568
  * @internal
5569
5569
  */
5570
- const VERSION = '0.3.6-test.108';
5570
+ const VERSION = '0.3.7';
5571
5571
 
5572
5572
  /**
5573
5573
  * Fame errors module - Fame protocol specific error classes
@@ -11511,7 +11511,8 @@ const ensureBroadcastEnvironment = () => {
11511
11511
  };
11512
11512
  let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
11513
11513
  static generateConnectorId() {
11514
- const globalCrypto = globalThis.crypto;
11514
+ const globalCrypto = globalThis
11515
+ .crypto;
11515
11516
  if (globalCrypto?.randomUUID) {
11516
11517
  return globalCrypto.randomUUID();
11517
11518
  }
@@ -11566,7 +11567,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11566
11567
  this.listenerRegistered = false;
11567
11568
  this.visibilityChangeListenerRegistered = false;
11568
11569
  this.channelName =
11569
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
11570
+ typeof config.channelName === 'string' &&
11571
+ config.channelName.trim().length > 0
11570
11572
  ? config.channelName.trim()
11571
11573
  : DEFAULT_CHANNEL$7;
11572
11574
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -11608,7 +11610,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11608
11610
  channel: this.channelName,
11609
11611
  connector_id: this.connectorId,
11610
11612
  message_type: message && typeof message === 'object'
11611
- ? message.constructor?.name ?? typeof message
11613
+ ? (message.constructor
11614
+ ?.name ?? typeof message)
11612
11615
  : typeof message,
11613
11616
  has_sender_id: Boolean(message?.senderId),
11614
11617
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -11838,7 +11841,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11838
11841
  timestamp: new Date().toISOString(),
11839
11842
  });
11840
11843
  }
11841
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
11844
+ if (this.visibilityChangeListenerRegistered &&
11845
+ this.visibilityChangeHandler &&
11846
+ typeof document !== 'undefined') {
11842
11847
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
11843
11848
  this.visibilityChangeListenerRegistered = false;
11844
11849
  this.visibilityChangeHandler = undefined;
@@ -11866,7 +11871,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11866
11871
  return rawOrEnvelope;
11867
11872
  }
11868
11873
  _isWildcardTarget() {
11869
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
11874
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
11870
11875
  }
11871
11876
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
11872
11877
  if (this._isWildcardTarget()) {
@@ -11886,7 +11891,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11886
11891
  return true;
11887
11892
  }
11888
11893
  const expectedSender = this.targetNodeId;
11889
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
11894
+ if (expectedSender &&
11895
+ expectedSender !== '*' &&
11896
+ senderNodeId !== expectedSender) {
11890
11897
  logger$10.debug('broadcast_channel_message_rejected', {
11891
11898
  channel: this.channelName,
11892
11899
  connector_id: this.connectorId,
@@ -12060,14 +12067,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
12060
12067
  type,
12061
12068
  purpose,
12062
12069
  };
12063
- const channelValue = candidate.channelName ?? candidate['channel_name'];
12070
+ const channelValue = candidate.channelName ??
12071
+ candidate['channel_name'];
12064
12072
  if (channelValue !== undefined) {
12065
12073
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
12066
12074
  throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
12067
12075
  }
12068
12076
  result.channelName = channelValue.trim();
12069
12077
  }
12070
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
12078
+ const inboxValue = candidate.inboxCapacity ??
12079
+ candidate['inbox_capacity'];
12071
12080
  if (inboxValue !== undefined) {
12072
12081
  if (typeof inboxValue !== 'number' ||
12073
12082
  !Number.isFinite(inboxValue) ||
@@ -12076,7 +12085,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
12076
12085
  }
12077
12086
  result.inboxCapacity = Math.floor(inboxValue);
12078
12087
  }
12079
- const windowValue = candidate.initialWindow ?? candidate['initial_window'];
12088
+ const windowValue = candidate.initialWindow ??
12089
+ candidate['initial_window'];
12080
12090
  if (windowValue !== undefined) {
12081
12091
  if (typeof windowValue !== 'number' ||
12082
12092
  !Number.isFinite(windowValue) ||
@@ -12415,7 +12425,7 @@ class UpstreamSessionManager extends TaskSpawner {
12415
12425
  const callbackGrants = this.node.gatherSupportedCallbackGrants();
12416
12426
  logger$$.debug('callback_grants_before_augmentation', {
12417
12427
  count: callbackGrants.length,
12418
- types: callbackGrants.map(g => g.type),
12428
+ types: callbackGrants.map((g) => g.type),
12419
12429
  });
12420
12430
  // Check if we should create a broadcast callback grant before processing connection grants
12421
12431
  // This prevents adding duplicate broadcast grants
@@ -12429,11 +12439,12 @@ class UpstreamSessionManager extends TaskSpawner {
12429
12439
  });
12430
12440
  // Include admission client's connection grants as callback grants
12431
12441
  // This ensures DirectAdmissionClient grants are available for grant selection
12432
- if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
12442
+ if (welcome.frame.connectionGrants &&
12443
+ Array.isArray(welcome.frame.connectionGrants)) {
12433
12444
  for (const grant of welcome.frame.connectionGrants) {
12434
12445
  if (grant && typeof grant === 'object') {
12435
12446
  // Avoid duplicates by checking if grant already exists
12436
- const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
12447
+ const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
12437
12448
  if (!isDuplicate) {
12438
12449
  callbackGrants.push(grant);
12439
12450
  logger$$.debug('added_connection_grant_as_callback', {
@@ -12450,7 +12461,8 @@ class UpstreamSessionManager extends TaskSpawner {
12450
12461
  }
12451
12462
  // Add broadcast grant after connection grants to ensure we don't duplicate
12452
12463
  // any broadcast grants that may have been in connectionGrants
12453
- if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
12464
+ if (broadcastCallbackGrant &&
12465
+ this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
12454
12466
  callbackGrants.push(broadcastCallbackGrant);
12455
12467
  logger$$.debug('added_broadcast_callback_grant');
12456
12468
  }
@@ -12459,7 +12471,7 @@ class UpstreamSessionManager extends TaskSpawner {
12459
12471
  }
12460
12472
  logger$$.debug('callback_grants_after_augmentation', {
12461
12473
  count: callbackGrants.length,
12462
- types: callbackGrants.map(g => g.type),
12474
+ types: callbackGrants.map((g) => g.type),
12463
12475
  });
12464
12476
  const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
12465
12477
  this.targetSystemId = attachInfo.targetSystemId ?? null;
@@ -12701,7 +12713,8 @@ class UpstreamSessionManager extends TaskSpawner {
12701
12713
  continue;
12702
12714
  }
12703
12715
  // Reset ack time if just resumed from pause (prevents immediate timeout)
12704
- if (previousState === ConnectorState.PAUSED && currentState === ConnectorState.STARTED) {
12716
+ if (previousState === ConnectorState.PAUSED &&
12717
+ currentState === ConnectorState.STARTED) {
12705
12718
  logger$$.debug('connector_just_resumed_resetting_ack_time', {
12706
12719
  previous_state: previousState,
12707
12720
  current_state: currentState,
@@ -14269,7 +14282,8 @@ class DefaultNodeAttachClient {
14269
14282
  const interimHandler = async (envelope, context) => {
14270
14283
  if (this.inHandshake) {
14271
14284
  // Filter: only buffer frames related to our systemId or frames without systemId info
14272
- const frameSystemId = envelope.frame?.systemId;
14285
+ const frameSystemId = envelope.frame
14286
+ ?.systemId;
14273
14287
  if (!frameSystemId || frameSystemId === this.expectedSystemId) {
14274
14288
  this.buffer.push(envelope);
14275
14289
  }
@@ -14465,7 +14479,8 @@ class DefaultNodeAttachClient {
14465
14479
  const deadline = Date.now() + this.timeoutMs;
14466
14480
  while (Date.now() < deadline) {
14467
14481
  // Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
14468
- if (connector.state !== ConnectorState.STARTED && connector.state !== ConnectorState.PAUSED) {
14482
+ if (connector.state !== ConnectorState.STARTED &&
14483
+ connector.state !== ConnectorState.PAUSED) {
14469
14484
  let errorMessage = 'Connector closed while waiting for NodeAttachAck';
14470
14485
  if (connector.closeCode !== undefined) {
14471
14486
  errorMessage += ` (code=${connector.closeCode}`;
@@ -14489,7 +14504,8 @@ class DefaultNodeAttachClient {
14489
14504
  if (envelope.frame.type === 'NodeAttach') {
14490
14505
  logger$Y.debug('handshake_ignoring_concurrent_attach', {
14491
14506
  frame_type: envelope.frame.type,
14492
- frame_system_id: envelope.frame?.systemId ?? 'unknown',
14507
+ frame_system_id: envelope.frame?.systemId ??
14508
+ 'unknown',
14493
14509
  });
14494
14510
  }
14495
14511
  else {
@@ -15216,7 +15232,8 @@ function createFsShim() {
15216
15232
  else if (options &&
15217
15233
  typeof options === 'object' &&
15218
15234
  'encoding' in options &&
15219
- typeof options.encoding === 'string') {
15235
+ typeof options.encoding ===
15236
+ 'string') {
15220
15237
  encoding = options.encoding;
15221
15238
  }
15222
15239
  const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
@@ -21635,7 +21652,8 @@ class InPageConnector extends BaseAsyncConnector {
21635
21652
  this.listenerRegistered = false;
21636
21653
  this.visibilityChangeListenerRegistered = false;
21637
21654
  this.channelName =
21638
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
21655
+ typeof config.channelName === 'string' &&
21656
+ config.channelName.trim().length > 0
21639
21657
  ? config.channelName.trim()
21640
21658
  : DEFAULT_CHANNEL$6;
21641
21659
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -21674,7 +21692,8 @@ class InPageConnector extends BaseAsyncConnector {
21674
21692
  channel: this.channelName,
21675
21693
  connector_id: this.connectorId,
21676
21694
  message_type: message && typeof message === 'object'
21677
- ? message.constructor?.name ?? typeof message
21695
+ ? (message.constructor
21696
+ ?.name ?? typeof message)
21678
21697
  : typeof message,
21679
21698
  has_sender_id: Boolean(message?.senderId),
21680
21699
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -21683,7 +21702,8 @@ class InPageConnector extends BaseAsyncConnector {
21683
21702
  return;
21684
21703
  }
21685
21704
  const busMessage = message;
21686
- const senderId = typeof busMessage.senderId === 'string' && busMessage.senderId.length > 0
21705
+ const senderId = typeof busMessage.senderId === 'string' &&
21706
+ busMessage.senderId.length > 0
21687
21707
  ? busMessage.senderId
21688
21708
  : null;
21689
21709
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
@@ -21934,7 +21954,9 @@ class InPageConnector extends BaseAsyncConnector {
21934
21954
  timestamp: new Date().toISOString(),
21935
21955
  });
21936
21956
  }
21937
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
21957
+ if (this.visibilityChangeListenerRegistered &&
21958
+ this.visibilityChangeHandler &&
21959
+ typeof document !== 'undefined') {
21938
21960
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
21939
21961
  this.visibilityChangeListenerRegistered = false;
21940
21962
  this.visibilityChangeHandler = undefined;
@@ -21951,7 +21973,7 @@ class InPageConnector extends BaseAsyncConnector {
21951
21973
  return rawOrEnvelope;
21952
21974
  }
21953
21975
  _isWildcardTarget() {
21954
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
21976
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
21955
21977
  }
21956
21978
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
21957
21979
  if (this._isWildcardTarget()) {
@@ -21971,7 +21993,9 @@ class InPageConnector extends BaseAsyncConnector {
21971
21993
  return true;
21972
21994
  }
21973
21995
  const expectedSender = this.targetNodeId;
21974
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
21996
+ if (expectedSender &&
21997
+ expectedSender !== '*' &&
21998
+ senderNodeId !== expectedSender) {
21975
21999
  logger$J.debug('inpage_message_rejected', {
21976
22000
  channel: this.channelName,
21977
22001
  connector_id: this.connectorId,
@@ -22373,8 +22397,8 @@ class CertificateManagerFactory extends AbstractResourceFactory {
22373
22397
  }
22374
22398
  }
22375
22399
 
22376
- 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.";
22377
- const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = "TrustStoreProviderFactory";
22400
+ 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.';
22401
+ const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
22378
22402
  class TrustStoreProviderFactory extends AbstractResourceFactory {
22379
22403
  createUnconfiguredProvider(reason) {
22380
22404
  return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
@@ -26103,7 +26127,8 @@ class DefaultSecurityManager {
26103
26127
  const hasSignature = Boolean(envelope.sec?.sig);
26104
26128
  if (!hasSignature) {
26105
26129
  const nodeSid = node.sid;
26106
- const envelopeSid = envelope.sid;
26130
+ const envelopeSid = envelope
26131
+ .sid;
26107
26132
  const isLocalUnsignedSelfEnvelope = localContext.originType === DeliveryOriginType.LOCAL &&
26108
26133
  typeof nodeSid === 'string' &&
26109
26134
  nodeSid.length > 0 &&
@@ -29347,14 +29372,16 @@ function normalizeInPageConnectionGrant(candidate) {
29347
29372
  type,
29348
29373
  purpose,
29349
29374
  };
29350
- const channelValue = candidate.channelName ?? candidate['channel_name'];
29375
+ const channelValue = candidate.channelName ??
29376
+ candidate['channel_name'];
29351
29377
  if (channelValue !== undefined) {
29352
29378
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
29353
29379
  throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
29354
29380
  }
29355
29381
  result.channelName = channelValue.trim();
29356
29382
  }
29357
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
29383
+ const inboxValue = candidate.inboxCapacity ??
29384
+ candidate['inbox_capacity'];
29358
29385
  if (inboxValue !== undefined) {
29359
29386
  if (typeof inboxValue !== 'number' ||
29360
29387
  !Number.isFinite(inboxValue) ||
@@ -30160,7 +30187,9 @@ function normalizeConfig$p(config) {
30160
30187
  : DEFAULT_CHANNEL$5;
30161
30188
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30162
30189
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$5;
30163
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30190
+ if (typeof rawInbox === 'number' &&
30191
+ Number.isFinite(rawInbox) &&
30192
+ rawInbox > 0) {
30164
30193
  inboxCapacity = Math.floor(rawInbox);
30165
30194
  }
30166
30195
  else if (typeof rawInbox === 'string') {
@@ -30188,9 +30217,7 @@ class InPageListenerFactory extends TransportListenerFactory {
30188
30217
  }
30189
30218
  async create(config, ...factoryArgs) {
30190
30219
  const normalized = normalizeConfig$p(config);
30191
- const [{ InPageListener }] = await Promise.all([
30192
- getInPageListenerModule(),
30193
- ]);
30220
+ const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
30194
30221
  void factoryArgs;
30195
30222
  return new InPageListener({
30196
30223
  channelName: normalized.channelName,
@@ -30223,7 +30250,9 @@ function normalizeConfig$o(config) {
30223
30250
  : DEFAULT_CHANNEL$4;
30224
30251
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30225
30252
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$4;
30226
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30253
+ if (typeof rawInbox === 'number' &&
30254
+ Number.isFinite(rawInbox) &&
30255
+ rawInbox > 0) {
30227
30256
  inboxCapacity = Math.floor(rawInbox);
30228
30257
  }
30229
30258
  else if (typeof rawInbox === 'string') {
@@ -30628,7 +30657,8 @@ class InPageConnectorFactory extends ConnectorFactory {
30628
30657
  const normalized = this._normalizeConfig(config);
30629
30658
  const options = (factoryArgs[0] ?? {});
30630
30659
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
30631
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
30660
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
30661
+ normalizedLocalNodeFromConfig;
30632
30662
  if (!localNodeId) {
30633
30663
  throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
30634
30664
  }
@@ -30804,10 +30834,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30804
30834
  type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
30805
30835
  };
30806
30836
  const channelCandidate = record.channelName ?? record['channel_name'];
30807
- if (typeof channelCandidate === 'string' && channelCandidate.trim().length > 0) {
30837
+ if (typeof channelCandidate === 'string' &&
30838
+ channelCandidate.trim().length > 0) {
30808
30839
  config.channelName = channelCandidate.trim();
30809
30840
  }
30810
- const inboxCandidate = record.inboxCapacity ?? record['inbox_capacity'];
30841
+ const inboxCandidate = record.inboxCapacity ??
30842
+ record['inbox_capacity'];
30811
30843
  if (typeof inboxCandidate === 'number' &&
30812
30844
  Number.isFinite(inboxCandidate) &&
30813
30845
  inboxCandidate > 0) {
@@ -30831,9 +30863,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30831
30863
  throw new Error('BroadcastChannelConnectorFactory requires a configuration');
30832
30864
  }
30833
30865
  const normalized = this._normalizeConfig(config);
30834
- const options = (factoryArgs[0] ?? {});
30866
+ const options = (factoryArgs[0] ??
30867
+ {});
30835
30868
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
30836
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
30869
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
30870
+ normalizedLocalNodeFromConfig;
30837
30871
  if (!localNodeId) {
30838
30872
  throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
30839
30873
  }
@@ -32441,7 +32475,9 @@ class InPageListener extends TransportListener {
32441
32475
  typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
32442
32476
  ? channelCandidate.trim()
32443
32477
  : DEFAULT_CHANNEL$1;
32444
- const normalizedCapacity = typeof inboxCandidate === 'number' && Number.isFinite(inboxCandidate) && inboxCandidate > 0
32478
+ const normalizedCapacity = typeof inboxCandidate === 'number' &&
32479
+ Number.isFinite(inboxCandidate) &&
32480
+ inboxCandidate > 0
32445
32481
  ? Math.floor(inboxCandidate)
32446
32482
  : DEFAULT_INBOX_CAPACITY$1;
32447
32483
  this._inboxCapacity = normalizedCapacity;
@@ -32716,7 +32752,8 @@ class InPageListener extends TransportListener {
32716
32752
  if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
32717
32753
  return inPageGrantToConnectorConfig(grant);
32718
32754
  }
32719
- if (typeof grant?.toConnectorConfig === 'function') {
32755
+ if (typeof grant
32756
+ ?.toConnectorConfig === 'function') {
32720
32757
  return grant.toConnectorConfig();
32721
32758
  }
32722
32759
  throw new Error(`Unsupported grant type: ${grant.type}`);
@@ -32856,9 +32893,7 @@ var inpageListener = /*#__PURE__*/Object.freeze({
32856
32893
  const logger$n = getLogger('naylence.fame.connector.broadcast_channel_listener');
32857
32894
  const DEFAULT_CHANNEL = 'naylence-fabric';
32858
32895
  const DEFAULT_INBOX_CAPACITY = 2048;
32859
- const RESPONSE_TYPE_MASK = FameResponseType.ACK |
32860
- FameResponseType.REPLY |
32861
- FameResponseType.STREAM;
32896
+ const RESPONSE_TYPE_MASK = FameResponseType.ACK | FameResponseType.REPLY | FameResponseType.STREAM;
32862
32897
  const isBrowserEnvironment$1 = () => typeof window !== 'undefined' &&
32863
32898
  typeof BroadcastChannel !== 'undefined' &&
32864
32899
  typeof MessageEvent !== 'undefined';
@@ -33072,9 +33107,7 @@ class BroadcastChannelListener extends TransportListener {
33072
33107
  return null;
33073
33108
  }
33074
33109
  })();
33075
- if (error instanceof ZodError &&
33076
- decoded &&
33077
- decoded.length > 0) {
33110
+ if (error instanceof ZodError && decoded && decoded.length > 0) {
33078
33111
  try {
33079
33112
  const reparsed = JSON.parse(decoded);
33080
33113
  const candidate = reparsed.rtype;
@@ -34179,7 +34212,9 @@ function parseCookies(cookieHeader) {
34179
34212
  if (!cookieHeader) {
34180
34213
  return {};
34181
34214
  }
34182
- return cookieHeader.split(';').reduce((acc, entry) => {
34215
+ return cookieHeader
34216
+ .split(';')
34217
+ .reduce((acc, entry) => {
34183
34218
  const [rawName, ...rawValueParts] = entry.split('=');
34184
34219
  const name = rawName?.trim();
34185
34220
  if (!name) {
@@ -34327,10 +34362,7 @@ function setNoCacheHeaders(res) {
34327
34362
  res.set('Pragma', 'no-cache');
34328
34363
  }
34329
34364
  function respondInvalidClient(res) {
34330
- res
34331
- .status(401)
34332
- .set('WWW-Authenticate', 'Basic')
34333
- .json({
34365
+ res.status(401).set('WWW-Authenticate', 'Basic').json({
34334
34366
  error: 'invalid_client',
34335
34367
  error_description: 'Invalid client credentials',
34336
34368
  });
@@ -34367,10 +34399,10 @@ function createOAuth2TokenRouter(options) {
34367
34399
  DEFAULT_JWT_ALGORITHM$1;
34368
34400
  const allowedScopes = getAllowedScopes$1(configAllowedScopes);
34369
34401
  const resolvedTokenTtlSec = tokenTtlSec ?? 3600;
34370
- const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ??
34371
- (configEnablePkce ?? true);
34402
+ const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ?? configEnablePkce ?? true;
34372
34403
  const allowPublicClients = coerceBoolean(process.env[ENV_VAR_ALLOW_PUBLIC_CLIENTS]) ??
34373
- (configAllowPublicClients ?? true);
34404
+ configAllowPublicClients ??
34405
+ true;
34374
34406
  const authorizationCodeTtlSec = ensurePositiveInteger(coerceNumber$1(process.env[ENV_VAR_AUTHORIZATION_CODE_TTL]) ??
34375
34407
  configAuthorizationCodeTtlSec) ?? DEFAULT_AUTHORIZATION_CODE_TTL_SEC;
34376
34408
  const devLoginExplicitlyEnabled = coerceBoolean(process.env[ENV_VAR_ENABLE_DEV_LOGIN]) ??
@@ -34385,7 +34417,8 @@ function createOAuth2TokenRouter(options) {
34385
34417
  configDevLoginCookieName ??
34386
34418
  DEFAULT_SESSION_COOKIE_NAME;
34387
34419
  const devLoginSecureCookie = coerceBoolean(process.env[ENV_VAR_SESSION_SECURE_COOKIE]) ??
34388
- (configDevLoginSecureCookie ?? false);
34420
+ configDevLoginSecureCookie ??
34421
+ false;
34389
34422
  const devLoginTitle = coerceString$2(process.env[ENV_VAR_LOGIN_TITLE]) ??
34390
34423
  configDevLoginTitle ??
34391
34424
  DEFAULT_LOGIN_TITLE;
@@ -37452,19 +37485,23 @@ function normalizeConfig$a(config) {
37452
37485
  normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
37453
37486
  }
37454
37487
  const audienceCandidate = candidate.audience ?? candidate.aud;
37455
- if (typeof audienceCandidate === 'string' && audienceCandidate.trim().length > 0) {
37488
+ if (typeof audienceCandidate === 'string' &&
37489
+ audienceCandidate.trim().length > 0) {
37456
37490
  normalized.audience = audienceCandidate.trim();
37457
37491
  }
37458
37492
  const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
37459
- if (typeof codeChallengeMethod === 'string' && codeChallengeMethod.trim().length > 0) {
37493
+ if (typeof codeChallengeMethod === 'string' &&
37494
+ codeChallengeMethod.trim().length > 0) {
37460
37495
  normalized.codeChallengeMethod = codeChallengeMethod.trim();
37461
37496
  }
37462
37497
  const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
37463
- if (typeof codeVerifierLength === 'number' && Number.isFinite(codeVerifierLength)) {
37498
+ if (typeof codeVerifierLength === 'number' &&
37499
+ Number.isFinite(codeVerifierLength)) {
37464
37500
  normalized.codeVerifierLength = codeVerifierLength;
37465
37501
  }
37466
37502
  const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
37467
- if (typeof clockSkewSeconds === 'number' && Number.isFinite(clockSkewSeconds)) {
37503
+ if (typeof clockSkewSeconds === 'number' &&
37504
+ Number.isFinite(clockSkewSeconds)) {
37468
37505
  normalized.clockSkewSeconds = clockSkewSeconds;
37469
37506
  }
37470
37507
  const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
@@ -37509,8 +37546,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
37509
37546
  options.audience = normalized.audience;
37510
37547
  }
37511
37548
  if (normalized.codeChallengeMethod) {
37512
- options.codeChallengeMethod = normalized.codeChallengeMethod
37513
- .toUpperCase();
37549
+ options.codeChallengeMethod =
37550
+ normalized.codeChallengeMethod.toUpperCase();
37514
37551
  }
37515
37552
  if (normalized.codeVerifierLength) {
37516
37553
  options.codeVerifierLength = normalized.codeVerifierLength;
@@ -39268,14 +39305,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
39268
39305
 
39269
39306
  const FACTORY_META$d = {
39270
39307
  base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
39271
- key: "NoopTrustStoreProvider",
39308
+ key: 'NoopTrustStoreProvider',
39272
39309
  isDefault: true,
39273
39310
  priority: 10,
39274
39311
  };
39275
39312
  class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
39276
39313
  constructor() {
39277
39314
  super(...arguments);
39278
- this.type = "NoopTrustStoreProvider";
39315
+ this.type = 'NoopTrustStoreProvider';
39279
39316
  this.isDefault = true;
39280
39317
  this.priority = 10;
39281
39318
  }
@@ -41513,8 +41550,7 @@ function normalizeOptions$2(raw) {
41513
41550
  const scopes = normalizeScopes(camel.scopes) ??
41514
41551
  normalizeScopes(snake.scopes ?? snake.scope) ??
41515
41552
  DEFAULT_SCOPES.slice();
41516
- const audience = coerceString(camel.audience) ??
41517
- coerceString(snake.audience ?? snake.aud);
41553
+ const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
41518
41554
  const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
41519
41555
  const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
41520
41556
  coerceNumber(snake.clock_skew_seconds) ??
@@ -3,7 +3,7 @@ export { InPageConnector, INPAGE_CONNECTOR_TYPE, type InPageConnectorConfig, } f
3
3
  export { BroadcastChannelConnector, BROADCAST_CHANNEL_CONNECTOR_TYPE, type BroadcastChannelConnectorConfig, } from './naylence/fame/connector/broadcast-channel-connector.js';
4
4
  export { InPageConnectorFactory, type InPageConnectorFactoryConfig, FACTORY_META as INPAGE_CONNECTOR_FACTORY_META, } from './naylence/fame/connector/inpage-connector-factory.js';
5
5
  export { BroadcastChannelConnectorFactory, type BroadcastChannelConnectorFactoryConfig, FACTORY_META as BROADCAST_CHANNEL_CONNECTOR_FACTORY_META, } from './naylence/fame/connector/broadcast-channel-connector-factory.js';
6
- export { InPageListener, } from './naylence/fame/connector/inpage-listener.js';
6
+ export { InPageListener } from './naylence/fame/connector/inpage-listener.js';
7
7
  export { InPageListenerFactory, type InPageListenerFactoryConfig, FACTORY_META as INPAGE_LISTENER_FACTORY_META, } from './naylence/fame/connector/inpage-listener-factory.js';
8
- export { BroadcastChannelListener, } from './naylence/fame/connector/broadcast-channel-listener.js';
8
+ export { BroadcastChannelListener } from './naylence/fame/connector/broadcast-channel-listener.js';
9
9
  export { BroadcastChannelListenerFactory, type BroadcastChannelListenerFactoryConfig, FACTORY_META as BROADCAST_CHANNEL_LISTENER_FACTORY_META, } from './naylence/fame/connector/broadcast-channel-listener-factory.js';
@@ -19,12 +19,12 @@ export { InPageConnector, INPAGE_CONNECTOR_TYPE, type InPageConnectorConfig, } f
19
19
  export { BroadcastChannelConnector, BROADCAST_CHANNEL_CONNECTOR_TYPE, type BroadcastChannelConnectorConfig, } from './broadcast-channel-connector.js';
20
20
  export { _NoopFlowController } from './noop-flow-controller.js';
21
21
  export { TransportListener } from './transport-listener.js';
22
- export { TransportListenerFactory, TRANSPORT_LISTENER_FACTORY_BASE_TYPE } from './transport-listener-factory.js';
22
+ export { TransportListenerFactory, TRANSPORT_LISTENER_FACTORY_BASE_TYPE, } from './transport-listener-factory.js';
23
23
  export type { TransportListenerFactory as TransportListenerFactoryType } from './transport-listener-factory.js';
24
24
  export type { TransportListenerConfig } from './transport-listener-config.js';
25
25
  export type { HttpServer, HttpRouter } from './http-server.js';
26
26
  export { DefaultHttpServer } from './default-http-server.js';
27
27
  export { WebSocketListener, getWebsocketListenerInstance, } from './websocket-listener.js';
28
28
  export { HttpListener, getHttpListenerInstance } from './http-listener.js';
29
- export { InPageListener, getInPageListenerInstance } from './inpage-listener.js';
29
+ export { InPageListener, getInPageListenerInstance, } from './inpage-listener.js';
30
30
  export { BroadcastChannelListener, getBroadcastChannelListenerInstance, } from './broadcast-channel-listener.js';
@@ -57,7 +57,7 @@ export * from './signing/envelope-signer.js';
57
57
  export * from './signing/envelope-verifier.js';
58
58
  export { SigningConfig as SigningConfigClass, type SigningConfigOptions, } from './signing/signing-config.js';
59
59
  export { canonicalJson, decodeBase64Url, frameDigest, immutableHeaders, } from './signing/eddsa-signer-verifier.js';
60
- export { encodeUtf8, } from './signing/eddsa-utils.js';
60
+ export { encodeUtf8 } from './signing/eddsa-utils.js';
61
61
  export { EdDSAEnvelopeSigner, type EdDSAEnvelopeSignerOptions, } from './signing/eddsa-envelope-signer.js';
62
62
  export * from './crypto/providers/crypto-provider.js';
63
63
  export * from './crypto/providers/default-crypto-provider.js';
@@ -1,7 +1,7 @@
1
- import { TrustStoreProviderFactory, type TrustStoreProviderConfig } from "./trust-store-provider-factory.js";
2
- import type { TrustStoreProvider } from "./trust-store-provider.js";
1
+ import { TrustStoreProviderFactory, type TrustStoreProviderConfig } from './trust-store-provider-factory.js';
2
+ import type { TrustStoreProvider } from './trust-store-provider.js';
3
3
  export interface NoopTrustStoreProviderConfig extends TrustStoreProviderConfig {
4
- readonly type: "NoopTrustStoreProvider";
4
+ readonly type: 'NoopTrustStoreProvider';
5
5
  }
6
6
  export declare const FACTORY_META: {
7
7
  readonly base: "TrustStoreProviderFactory";
@@ -1,6 +1,6 @@
1
- import type { CreateResourceOptions, ResourceConfig } from "@naylence/factory";
2
- import { AbstractResourceFactory } from "@naylence/factory";
3
- import type { TrustAnchor, TrustStoreProvider } from "./trust-store-provider.js";
1
+ import type { CreateResourceOptions, ResourceConfig } from '@naylence/factory';
2
+ import { AbstractResourceFactory } from '@naylence/factory';
3
+ import type { TrustAnchor, TrustStoreProvider } from './trust-store-provider.js';
4
4
  export interface TrustStoreProviderConfig extends ResourceConfig {
5
5
  readonly type: string;
6
6
  }
@@ -8,7 +8,7 @@ export interface TrustStoreProviderDependencies {
8
8
  readonly env?: Record<string, unknown> | null;
9
9
  readonly [key: string]: unknown;
10
10
  }
11
- export interface CreateTrustStoreProviderOptions extends Omit<CreateResourceOptions, "factoryArgs"> {
11
+ export interface CreateTrustStoreProviderOptions extends Omit<CreateResourceOptions, 'factoryArgs'> {
12
12
  readonly factoryArgs?: unknown[];
13
13
  readonly dependencies?: TrustStoreProviderDependencies;
14
14
  }
@@ -16,7 +16,7 @@ export interface TrustStoreProvider {
16
16
  onUpdate?(callback: () => void): () => void;
17
17
  initialize?(): Promise<void> | void;
18
18
  }
19
- export type TrustBundleSourceType = "INLINE_PEM" | "DATA_PEM" | "FILE" | "HTTPS_BUNDLE";
19
+ export type TrustBundleSourceType = 'INLINE_PEM' | 'DATA_PEM' | 'FILE' | 'HTTPS_BUNDLE';
20
20
  export interface TrustBundlePins {
21
21
  readonly hashPins?: readonly string[];
22
22
  readonly allowedSpkis?: readonly string[];
@@ -24,19 +24,19 @@ export interface TrustBundlePins {
24
24
  readonly refreshIntervalMs?: number;
25
25
  }
26
26
  export interface InlinePemSource {
27
- readonly type: "INLINE_PEM";
27
+ readonly type: 'INLINE_PEM';
28
28
  readonly pem: string;
29
29
  }
30
30
  export interface DataPemSource {
31
- readonly type: "DATA_PEM";
31
+ readonly type: 'DATA_PEM';
32
32
  readonly dataUri: string;
33
33
  }
34
34
  export interface FilePemSource {
35
- readonly type: "FILE";
35
+ readonly type: 'FILE';
36
36
  readonly path: string;
37
37
  }
38
38
  export interface HttpsBundleSource extends TrustBundlePins {
39
- readonly type: "HTTPS_BUNDLE";
39
+ readonly type: 'HTTPS_BUNDLE';
40
40
  readonly url: string;
41
41
  }
42
42
  export type TrustBundleSource = InlinePemSource | DataPemSource | FilePemSource | HttpsBundleSource;
@@ -2,4 +2,4 @@
2
2
  * The package version, injected at build time.
3
3
  * @internal
4
4
  */
5
- export declare const VERSION = "0.3.6-test.108";
5
+ export declare const VERSION = "0.3.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naylence/runtime",
3
- "version": "0.3.6-test.108",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "description": "Naylence Runtime - Complete TypeScript runtime",
6
6
  "author": "Naylence Dev <naylencedev@gmail.com>",