dsh-mobile 0.6.14 → 0.6.16
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/CHANGELOG.md +32 -0
- package/CONTRIBUTORS.md +22 -2
- package/README.en.md +8 -6
- package/README.md +8 -6
- package/SECURITY.md +5 -1
- package/THIRD_PARTY_NOTICES.md +30 -2
- package/apps/mobile/README.md +35 -5
- package/apps/mobile/README.zh-CN.md +35 -5
- package/apps/mobile/release.json +3 -3
- package/docs/ATTACH_EXISTING_FRPS.en.md +8 -0
- package/docs/ATTACH_EXISTING_FRPS.md +8 -0
- package/docs/SLOW_CONNECTIONS.en.md +11 -1
- package/docs/SLOW_CONNECTIONS.md +11 -1
- package/lib/client.js +846 -60
- package/lib/client.js.map +1 -1
- package/lib/extension-worker-runtime.mjs.map +1 -1
- package/lib/index.d.mts +28 -2
- package/lib/index.mjs +499 -50
- package/lib/index.mjs.map +1 -1
- package/lib/mobile-compat.js +1 -1
- package/lib/mobile-compat.js.map +1 -1
- package/package.json +9 -2
- package/packages/question-fixes/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -370,7 +370,7 @@ interface PluginConfig {
|
|
|
370
370
|
maxBodyBytes?: number;
|
|
371
371
|
/** Transport, upload, static-response and WebSocket-handshake idle timeout. */
|
|
372
372
|
upstreamTimeoutMs?: number;
|
|
373
|
-
/** Authenticated /api response idle timeout
|
|
373
|
+
/** Authenticated /api response and established DSH plugin-event stream idle timeout; zero disables it. */
|
|
374
374
|
upstreamApiTimeoutMs?: number;
|
|
375
375
|
rateLimitWindowMs?: number;
|
|
376
376
|
maxPairingAttempts?: number;
|
|
@@ -394,6 +394,8 @@ interface ResolvedGatewayConfig {
|
|
|
394
394
|
readonly excludedClientModules: readonly string[];
|
|
395
395
|
readonly websocketCompression: ResolvedWebSocketCompressionConfig;
|
|
396
396
|
readonly instanceId: string;
|
|
397
|
+
/** Plugin-wide installation identity, disclosed only after native authentication. */
|
|
398
|
+
readonly installationId?: string;
|
|
397
399
|
/** Identity returned only for authenticated legacy native credentials without a stored binding. */
|
|
398
400
|
readonly legacyInstanceId?: string;
|
|
399
401
|
readonly pairingCaFile?: string;
|
|
@@ -567,6 +569,21 @@ type HttpFailureEntry = ({
|
|
|
567
569
|
readonly suppressed?: number;
|
|
568
570
|
};
|
|
569
571
|
//#endregion
|
|
572
|
+
//#region src/upstream-auth-log.d.ts
|
|
573
|
+
/** Fixed outcomes of the Gateway's private DSH launch-token exchange. */
|
|
574
|
+
type UpstreamAuthOutcome = 'accepted' | 'invalid-target' | 'unexpected-status' | 'invalid-cookie' | 'timeout' | 'transport-error';
|
|
575
|
+
/** Exchange metadata only: no URL, header, Cookie, Token or raw error is retained. */
|
|
576
|
+
interface UpstreamAuthEntry {
|
|
577
|
+
readonly sequence: number;
|
|
578
|
+
readonly outcome: UpstreamAuthOutcome;
|
|
579
|
+
readonly stage: 'target' | 'request' | 'response' | 'cookie';
|
|
580
|
+
readonly durationMs: number;
|
|
581
|
+
/** Upstream HTTP status after headers arrive, not the phone-facing failure status. */
|
|
582
|
+
readonly status?: number;
|
|
583
|
+
/** Earlier exchanges with the same success/failure category omitted by sampling. */
|
|
584
|
+
readonly suppressed?: number;
|
|
585
|
+
}
|
|
586
|
+
//#endregion
|
|
570
587
|
//#region src/http-security.d.ts
|
|
571
588
|
export declare const DEVICE_COOKIE = "dsh_ma_device";
|
|
572
589
|
export declare const SESSION_COOKIE = "dsh_ma_session";
|
|
@@ -998,6 +1015,8 @@ export declare class MobileAccessGateway {
|
|
|
998
1015
|
private readonly activeRequests;
|
|
999
1016
|
private readonly activeWebSockets;
|
|
1000
1017
|
private readonly mobileBootBatches;
|
|
1018
|
+
private readonly mobileDocumentViews;
|
|
1019
|
+
private readonly mobileGraphTasks;
|
|
1001
1020
|
/** Cached upstream bundle byte sizes (HEAD probes), keyed by resource URL. */
|
|
1002
1021
|
private readonly bootEntrySizeCache;
|
|
1003
1022
|
private readonly extensionEventListeners;
|
|
@@ -1030,9 +1049,10 @@ export declare class MobileAccessGateway {
|
|
|
1030
1049
|
private readonly clientModuleRevocations;
|
|
1031
1050
|
private readonly authFailures;
|
|
1032
1051
|
private readonly httpFailures;
|
|
1052
|
+
private readonly upstreamAuthDiagnostics;
|
|
1033
1053
|
constructor(config: ResolvedGatewayConfig, store: DeviceStore, extensions?: MobileAccessService | undefined, upstreamAuthenticatedUrl?: string | undefined, extraWebSocketPaths?: {
|
|
1034
1054
|
has(pathname: string): boolean;
|
|
1035
|
-
} | undefined, blockedUpgradeLog?: BlockedUpgradePathLog | undefined, onDiscoveryDegraded?: ((source: 'broadcast' | 'mdns', code: string) => void) | undefined, clientModulePreferences?: ClientModulePreferenceStore, authFailureLog?: (entry: AuthFailureEntry) => void, httpFailureLog?: (entry: HttpFailureEntry) => void);
|
|
1055
|
+
} | undefined, blockedUpgradeLog?: BlockedUpgradePathLog | undefined, onDiscoveryDegraded?: ((source: 'broadcast' | 'mdns', code: string) => void) | undefined, clientModulePreferences?: ClientModulePreferenceStore, authFailureLog?: (entry: AuthFailureEntry) => void, httpFailureLog?: (entry: HttpFailureEntry) => void, upstreamAuthLog?: (entry: UpstreamAuthEntry) => void);
|
|
1036
1056
|
/** Initialize durable state, validate TLS, and bind the externally reachable listener. */
|
|
1037
1057
|
start(): Promise<void>;
|
|
1038
1058
|
/** Install a newly signed provided leaf for future TLS handshakes without dropping sessions. */
|
|
@@ -1075,6 +1095,8 @@ export declare class MobileAccessGateway {
|
|
|
1075
1095
|
private handleRenew;
|
|
1076
1096
|
/** CA-backed entries retain their pin; public entries project the authenticated credential's identity. */
|
|
1077
1097
|
private nativeResponseInstanceId;
|
|
1098
|
+
/** Older Apps require exact wire keys; expose this hint only to explicit opt-in clients after authentication. */
|
|
1099
|
+
private nativeResponseInstallationIdentity;
|
|
1078
1100
|
private handleNativePair;
|
|
1079
1101
|
private handleNativeRenew;
|
|
1080
1102
|
private handleNativeProbe;
|
|
@@ -1107,6 +1129,10 @@ export declare class MobileAccessGateway {
|
|
|
1107
1129
|
private clientModulePreferenceOperation;
|
|
1108
1130
|
private fetchAuthenticatedUpstreamIndex;
|
|
1109
1131
|
private proxyMobileIndex;
|
|
1132
|
+
private removeMobileDocumentView;
|
|
1133
|
+
private rememberMobileDocumentView;
|
|
1134
|
+
private requireMobileDocumentView;
|
|
1135
|
+
private projectMobileDocumentEvent;
|
|
1110
1136
|
private rememberMobileBootBatch;
|
|
1111
1137
|
/**
|
|
1112
1138
|
* Determine which layout-batch entries can share a merged boot batch and which
|