@zkpassport/sdk 0.17.0-beta.2 → 0.17.1

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.
@@ -106,6 +106,11 @@ type QueryBuilderResult = {
106
106
  * Called when the SDK successfully connects to the bridge with the mobile app.
107
107
  */
108
108
  onBridgeConnect: (callback: () => void) => void;
109
+ /**
110
+ * Called when the connection to the bridge is lost and the SDK has stopped
111
+ * trying to reconnect on its own. A later `onBridgeConnect` means it came back.
112
+ */
113
+ onBridgeConnectionLost: (callback: () => void) => void;
109
114
  /**
110
115
  * Called when the user has generated a proof.
111
116
  *
@@ -252,9 +257,9 @@ type QueryBuilder<T extends "online" | "offline" = "online"> = {
252
257
  facematch: (mode?: FacematchMode) => QueryBuilder;
253
258
  raw: (query: Query) => QueryBuilder<T>;
254
259
  /**
255
- * Applies an immutable policy fetched from the dashboard. The policy's query,
256
- * purpose and scope are locked; combining with builder methods (except
257
- * `.bind()`, which may follow it) or calling twice throws.
260
+ * Applies a policy fetched from the dashboard. The policy's query is locked, and its
261
+ * purpose and scope are used unless the request sets its own. Combining with builder
262
+ * methods (except `.bind()`, which may follow it) or calling twice throws.
258
263
  * @param id The policy id (e.g. `'pol_xyz'`).
259
264
  */
260
265
  policy: (id: string) => QueryBuilder<T>;
@@ -275,6 +280,8 @@ declare function generalCompare(fnName: "in" | "out" | "eq", key: IDCredential,
275
280
  requestId: string, requestIdToConfig: Record<string, Query>): void;
276
281
  declare function createOfflineQuery(): QueryBuilder<"offline">;
277
282
 
283
+ declare const VERSION: string;
284
+
278
285
  declare class ZKPassport {
279
286
  private domain;
280
287
  private domainProvided;
@@ -295,6 +302,7 @@ declare class ZKPassport {
295
302
  private onRequestReceivedCallbacks;
296
303
  private onGeneratingProofCallbacks;
297
304
  private onBridgeConnectCallbacks;
305
+ private onBridgeConnectionLostCallbacks;
298
306
  private onProofGeneratedCallbacks;
299
307
  private onSuccessCallbacks;
300
308
  private onResultCallbacks;
@@ -318,11 +326,11 @@ declare class ZKPassport {
318
326
  private assertCanApplyPolicy;
319
327
  /**
320
328
  * @notice Create a new request. To apply a policy, chain `.policy('<id>')` on
321
- * the returned builder; a policy locks the query and scope.
329
+ * the returned builder; a policy locks the query.
322
330
  * @param name Your service name. Defaults to the dashboard branding, then the domain.
323
331
  * @param logo Your service logo. Defaults to the dashboard branding.
324
332
  * @param purpose Explanation shown to the user. Defaults to the policy's purpose (if any), then a generic message.
325
- * @param scope Use-case scope (drives the nullifier). Defaults to the domain. Locked by `.policy()` (to the policy id).
333
+ * @param scope Use-case scope (drives the nullifier). Defaults to the policy id (if any), then the domain.
326
334
  * @param projectID The project ID of your service
327
335
  * @param validity How many seconds ago the proof checking the expiry date of the ID should have been generated
328
336
  * @param mode The proof mode (e.g. "fast" / "compressed").
@@ -441,4 +449,4 @@ declare class ZKPassport {
441
449
  clearAllRequests(): void;
442
450
  }
443
451
 
444
- export { type DashboardConfig as D, type OnSuccessVerdict as O, type Policy as P, type QueryBuilder as Q, type RequestSuccess as R, type SolidityProofVerificationData as S, type VerificationResult as V, ZKPassport as Z, type QueryBuilderResult as a, numericalCompare as b, createOfflineQuery as c, type OfflineQueryBuilderResult as d, type QueryResultError as e, type QueryResultErrors as f, generalCompare as g, type RequestedNullifierType as h, type SolidityServiceConfig as i, type SolidityVerifierParameters as j, type VerifierMode as k, normalizeCountry as n, rangeCompare as r };
452
+ export { type DashboardConfig as D, type OnSuccessVerdict as O, type Policy as P, type QueryBuilder as Q, type RequestSuccess as R, type SolidityProofVerificationData as S, VERSION as V, ZKPassport as Z, type QueryBuilderResult as a, numericalCompare as b, createOfflineQuery as c, type OfflineQueryBuilderResult as d, type QueryResultError as e, type QueryResultErrors as f, generalCompare as g, type RequestedNullifierType as h, type SolidityServiceConfig as i, type SolidityVerifierParameters as j, type VerificationResult as k, type VerifierMode as l, normalizeCountry as n, rangeCompare as r };