@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.
- package/dist/cjs/{index-PPMt5JWF.d.cts → index-BBgXLFAR.d.cts} +14 -6
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/popup.cjs +2 -2
- package/dist/cjs/popup.cjs.map +1 -1
- package/dist/cjs/popup.d.cts +63 -3
- package/dist/cjs/query.d.cts +1 -1
- package/dist/esm/{index-PPMt5JWF.d.ts → index-BBgXLFAR.d.ts} +14 -6
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/popup.d.ts +63 -3
- package/dist/esm/popup.js +2 -2
- package/dist/esm/popup.js.map +1 -1
- package/dist/esm/query.d.ts +1 -1
- package/package.json +3 -3
|
@@ -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
|
|
256
|
-
* purpose and scope are
|
|
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
|
|
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
|
|
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,
|
|
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 };
|