dsh-mobile 0.5.3 → 0.5.5

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/lib/index.d.mts CHANGED
@@ -151,6 +151,9 @@ export declare class AccessController {
151
151
  renew(deviceToken: string): Promise<RenewalResult>;
152
152
  /** Validate a persistent device credential without consuming a Session slot. */
153
153
  probe(deviceToken: string): Promise<DeviceProbeResult>;
154
+ /** Validate a device credential without writing state or opening a Session. */
155
+ authorizeDevice(deviceToken: string): DeviceProbeResult;
156
+ private requireDevice;
154
157
  /** Resolve a short Session Cookie without revealing whether device or Session failed. */
155
158
  authorizeSession(sessionToken: string): SessionAuthorization;
156
159
  /** Require the Session-bound anti-CSRF value for an authenticated mutation. */
@@ -227,6 +230,24 @@ export declare class RequestTrustPolicy {
227
230
  }
228
231
  //#endregion
229
232
  //#region src/config.d.ts
233
+ /** Optional compression for exact, already authorized WebSocket paths. */
234
+ interface WebSocketCompressionConfig {
235
+ paths?: string[];
236
+ maxMessageBytes?: number;
237
+ maxQueuedBytes?: number;
238
+ thresholdBytes?: number;
239
+ concurrencyLimit?: number;
240
+ level?: number;
241
+ }
242
+ /** Validated compression settings; an empty path list keeps the raw transport. */
243
+ interface ResolvedWebSocketCompressionConfig {
244
+ readonly paths: readonly string[];
245
+ readonly maxMessageBytes: number;
246
+ readonly maxQueuedBytes: number;
247
+ readonly thresholdBytes: number;
248
+ readonly concurrencyLimit: number;
249
+ readonly level: number;
250
+ }
230
251
  /** TLS source accepted by the LAN listener. */
231
252
  interface ProvidedTlsConfig {
232
253
  readonly mode: 'provided';
@@ -265,6 +286,8 @@ interface PluginConfig {
265
286
  mobileCompatibilityFile?: string;
266
287
  /** Optional application-phase client package ids omitted only from the mobile boot graph. */
267
288
  excludedClientModules?: string[];
289
+ /** Compression is opt-in; it does not authorize additional WebSocket paths. */
290
+ websocketCompression?: WebSocketCompressionConfig;
268
291
  /** Stable public discovery identifier; it is not an authentication secret. */
269
292
  instanceId?: string;
270
293
  /** Managed CA certificate offered to the Android installer after fingerprint binding. */
@@ -306,6 +329,7 @@ interface ResolvedGatewayConfig {
306
329
  readonly mobileLayoutFile: string;
307
330
  readonly mobileCompatibilityFile: string;
308
331
  readonly excludedClientModules: readonly string[];
332
+ readonly websocketCompression: ResolvedWebSocketCompressionConfig;
309
333
  readonly instanceId: string;
310
334
  readonly pairingCaFile?: string;
311
335
  readonly tls: TlsConfig;
@@ -690,6 +714,7 @@ export declare class MobileAccessGateway {
690
714
  private authorize;
691
715
  private requireCsrf;
692
716
  private setSessionCookies;
717
+ private setBrowserDeviceBinding;
693
718
  private handlePair;
694
719
  private handleRenew;
695
720
  private handleNativePair;
@@ -1535,10 +1560,12 @@ export declare class OriginController implements RemoteProviderController {
1535
1560
  /**
1536
1561
  * Pinned cloudflared components fetched only after an explicit user action.
1537
1562
  *
1538
- * Unlike the cpolar archive each artifact IS the executable: there is nothing
1539
- * to unpack, so the download digest and the installed digest are the same pair.
1540
- * `--no-autoupdate` is passed at runtime as well, so the pinned bytes stay the
1541
- * bytes that were verified.
1563
+ * Cloudflare ships bare executables for Windows and Linux but a `.tgz` for
1564
+ * macOS, so an artifact carries two digests: the bytes on the wire
1565
+ * (`downloadBytes`/`downloadSha256`) and the executable that ends up installed
1566
+ * (`executableBytes`/`executableSha256`). For bare artifacts the two pairs are
1567
+ * identical. `--no-autoupdate` is passed at runtime as well, so the pinned
1568
+ * bytes stay the bytes that were verified.
1542
1569
  */
1543
1570
  interface CloudflaredArtifact {
1544
1571
  readonly version: string;
@@ -1548,7 +1575,19 @@ interface CloudflaredArtifact {
1548
1575
  readonly downloadBytes: number;
1549
1576
  readonly downloadSha256: string;
1550
1577
  readonly executableName: string;
1551
- }
1578
+ /** Bytes of the installed executable; equals `downloadBytes` for bare artifacts. */
1579
+ readonly executableBytes: number;
1580
+ readonly executableSha256: string;
1581
+ /** Set when the download is an archive rather than the executable itself. */
1582
+ readonly archive?: CloudflaredArchive;
1583
+ }
1584
+ interface CloudflaredArchive {
1585
+ readonly format: 'tgz';
1586
+ /** Member basename to install, e.g. `cloudflared`. */
1587
+ readonly member: string;
1588
+ }
1589
+ /** Pinned official cloudflared release metadata for supported desktop targets. */
1590
+ export declare const CLOUDFLARED_COMPONENT_RELEASES: Readonly<Record<string, CloudflaredArtifact>>;
1552
1591
  /**
1553
1592
  * Canonical release metadata. New code should select from
1554
1593
  * {@link CLOUDFLARED_COMPONENT_RELEASES} by platform and architecture; this
@@ -1578,6 +1617,7 @@ interface CloudflaredComponentManagerOptions {
1578
1617
  readonly platform?: NodeJS.Platform;
1579
1618
  readonly arch?: string;
1580
1619
  readonly fetchArtifact?: (url: string, signal: AbortSignal) => Promise<Uint8Array>;
1620
+ readonly extractArtifact?: (archive: string, destination: string, member: string) => Promise<void>;
1581
1621
  }
1582
1622
  /** Owns the optional cloudflared binary inside DSH Mobile state. */
1583
1623
  export declare class CloudflaredComponentManager {
@@ -1591,6 +1631,7 @@ export declare class CloudflaredComponentManager {
1591
1631
  private readonly arch;
1592
1632
  private readonly release;
1593
1633
  private readonly fetchArtifact;
1634
+ private readonly extractArtifact;
1594
1635
  private installed;
1595
1636
  private errorCode;
1596
1637
  private queue;