dsh-mobile 0.6.3 → 0.6.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
@@ -465,8 +465,8 @@ export declare class JsonMobileAccessControlStore implements MobileAccessControl
465
465
  private readonly file;
466
466
  private readonly initiallyEnabled;
467
467
  constructor(file: string, initiallyEnabled: boolean);
468
- /** Avoid writing an absent already-disabled state without changing recovery of existing files. */
469
- disableIfPresent(): Promise<void>;
468
+ /** Disable an existing preference, returning the state only after private-file preparation completes. */
469
+ disableIfPresent(): Promise<MobileAccessControlState>;
470
470
  load(): Promise<MobileAccessControlState>;
471
471
  save(state: MobileAccessControlState): Promise<void>;
472
472
  }
@@ -1150,6 +1150,85 @@ export declare class FrpComponentManager {
1150
1150
  private enqueue;
1151
1151
  }
1152
1152
  //#endregion
1153
+ //#region src/cpolar-component.d.ts
1154
+ /** Pinned cpolar components fetched only after an explicit user action. */
1155
+ interface CpolarArtifact {
1156
+ readonly version: string;
1157
+ readonly platform: NodeJS.Platform;
1158
+ readonly arch: string;
1159
+ readonly downloadUrl: string;
1160
+ readonly downloadBytes: number;
1161
+ readonly downloadSha256: string;
1162
+ readonly executableName: string;
1163
+ readonly executableBytes: number;
1164
+ readonly executableSha256: string;
1165
+ /** Windows ships an MSI inside a zip; Linux ships the binary in a tarball. */
1166
+ readonly archiveKind: 'msi-zip' | 'tar.gz';
1167
+ }
1168
+ /** Pinned official cpolar release metadata for supported desktop targets. */
1169
+ export declare const CPOLAR_COMPONENT_RELEASES: Readonly<Record<string, CpolarArtifact>>;
1170
+ /**
1171
+ * Canonical release metadata. New code should select from
1172
+ * {@link CPOLAR_COMPONENT_RELEASES} by platform and architecture; this alias
1173
+ * preserves the original Windows x64 entry for existing callers.
1174
+ */
1175
+ export declare const CPOLAR_COMPONENT_RELEASE: CpolarArtifact;
1176
+ /** Public, credential-free description of the managed cpolar component. */
1177
+ interface CpolarComponentStatus {
1178
+ readonly supported: boolean;
1179
+ readonly installed: boolean;
1180
+ readonly configured: boolean;
1181
+ readonly version: string;
1182
+ readonly downloadBytes: number;
1183
+ readonly installedBytes: number;
1184
+ readonly sourceUrl: string;
1185
+ readonly downloadPage: string;
1186
+ readonly signupUrl: string;
1187
+ readonly dashboardUrl: string;
1188
+ readonly termsUrl: string;
1189
+ readonly storagePath: string;
1190
+ readonly errorCode?: string;
1191
+ }
1192
+ interface CpolarComponentManagerOptions {
1193
+ readonly stateDirectory: string;
1194
+ readonly platform?: NodeJS.Platform;
1195
+ readonly arch?: string;
1196
+ readonly fetchArtifact?: (url: string, signal: AbortSignal) => Promise<Uint8Array>;
1197
+ readonly extractArtifact?: (archive: string, destination: string) => Promise<void>;
1198
+ }
1199
+ /** Owns the optional cpolar binary and account configuration inside DSH Mobile state. */
1200
+ export declare class CpolarComponentManager {
1201
+ readonly executable: string;
1202
+ readonly configFile: string;
1203
+ readonly componentRoot: string;
1204
+ readonly componentStorage: string;
1205
+ readonly stateRoot: string;
1206
+ readonly logRoot: string;
1207
+ private readonly stagingRoot;
1208
+ private readonly stateDirectory;
1209
+ private readonly platform;
1210
+ private readonly arch;
1211
+ private readonly release;
1212
+ private readonly fetchArtifact;
1213
+ private readonly extractArtifact;
1214
+ private installed;
1215
+ private configured;
1216
+ private errorCode;
1217
+ private queue;
1218
+ constructor(options: CpolarComponentManagerOptions);
1219
+ /** Inspect the managed binary and configuration without using global cpolar state. */
1220
+ initialize(): Promise<void>;
1221
+ /** Return a safe status that never includes the account token. */
1222
+ status(): CpolarComponentStatus;
1223
+ /** Download and verify cpolar, reading archive data without running installer actions. */
1224
+ install(): Promise<CpolarComponentStatus>;
1225
+ /** Store only the cpolar token in a private, self-update-disabled configuration. */
1226
+ configure(authtoken: unknown): Promise<CpolarComponentStatus>;
1227
+ /** Remove every cpolar file owned by DSH Mobile without touching global state. */
1228
+ purge(): Promise<CpolarComponentStatus>;
1229
+ private enqueue;
1230
+ }
1231
+ //#endregion
1153
1232
  //#region src/frp-template.d.ts
1154
1233
  /** Loopback-only HTTP vhost port used between Caddy and frps. */
1155
1234
  export declare const FRP_VHOST_HTTP_PORT = 7080;
@@ -1612,7 +1691,12 @@ interface RemoteProviderStatus {
1612
1691
  }
1613
1692
  /** Lifecycle shared by selectable remote providers. */
1614
1693
  interface RemoteProviderController {
1615
- initialize(): Promise<void>;
1694
+ /**
1695
+ * Initialize from the current startup preparation, without retaining a permission-success cache.
1696
+ * @param initialState - Fresh state prepared by this controller's own store; omission reads that store.
1697
+ * @returns Completion of the normal provider initialization and optional startup.
1698
+ */
1699
+ initialize(initialState?: MobileAccessControlState): Promise<void>;
1616
1700
  gateway(): MobileAccessGateway | undefined;
1617
1701
  status(): RemoteProviderStatus;
1618
1702
  setEnabled(enabled: boolean): Promise<RemoteProviderStatus>;
@@ -1720,7 +1804,7 @@ export declare class FrpController implements RemoteProviderController {
1720
1804
  private ingressCertificateTimer;
1721
1805
  constructor(options: FrpControllerOptions);
1722
1806
  /** Restore the remembered FRP switch without changing LAN or other providers. */
1723
- initialize(): Promise<void>;
1807
+ initialize(initialState?: MobileAccessControlState): Promise<void>;
1724
1808
  /** Return the active FRP-backed DSH gateway. */
1725
1809
  gateway(): MobileAccessGateway | undefined;
1726
1810
  /** Return state safe for the desktop control UI. */
@@ -2085,7 +2169,7 @@ export declare class CloudflaredController implements RemoteProviderController {
2085
2169
  private startupRounds;
2086
2170
  constructor(options: CloudflaredControllerOptions);
2087
2171
  /** Restore the remembered cloudflared switch independently from LAN and other providers. */
2088
- initialize(): Promise<void>;
2172
+ initialize(initialState?: MobileAccessControlState): Promise<void>;
2089
2173
  /** Return the active cloudflared-backed DSH gateway. */
2090
2174
  gateway(): MobileAccessGateway | undefined;
2091
2175
  /** Return state safe for the desktop control UI. */