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