@0xpolygonid/js-sdk 1.9.1 → 1.9.2
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/browser/esm/index.js +13 -8
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +13 -8
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/proof/common.js +11 -3
- package/dist/node/cjs/proof/proof-service.js +1 -4
- package/dist/node/cjs/storage/filters/jsonQuery.js +1 -1
- package/dist/node/esm/proof/common.js +12 -4
- package/dist/node/esm/proof/proof-service.js +1 -4
- package/dist/node/esm/storage/filters/jsonQuery.js +1 -1
- package/package.json +1 -1
|
@@ -59969,7 +59969,7 @@ class FilterQuery {
|
|
|
59969
59969
|
}
|
|
59970
59970
|
const credentialPathValue = resolvePath(credential, this.path);
|
|
59971
59971
|
if ((credentialPathValue === null || credentialPathValue === undefined) &&
|
|
59972
|
-
this.operatorFunc !==
|
|
59972
|
+
this.operatorFunc !== comparatorOptions.$exists) {
|
|
59973
59973
|
return false;
|
|
59974
59974
|
}
|
|
59975
59975
|
if (this.isReverseParams) {
|
|
@@ -62393,12 +62393,14 @@ const parseQueryMetadata = async (propertyQuery, ldContextJSON, credentialType,
|
|
|
62393
62393
|
throw new Error(`field does not exist in the schema ${e.message}`);
|
|
62394
62394
|
}
|
|
62395
62395
|
}
|
|
62396
|
-
if (propertyQuery.operatorValue) {
|
|
62396
|
+
if (propertyQuery.operatorValue !== undefined) {
|
|
62397
62397
|
if (!isValidOperation(query.datatype, propertyQuery.operator)) {
|
|
62398
62398
|
throw new Error(`operator ${propertyQuery.operator} is not supported for datatype ${query.datatype}`);
|
|
62399
62399
|
}
|
|
62400
|
-
|
|
62401
|
-
|
|
62400
|
+
query.values =
|
|
62401
|
+
propertyQuery.operator === Operators.EXISTS
|
|
62402
|
+
? transformExistsValue(propertyQuery.operatorValue)
|
|
62403
|
+
: await transformQueryValueToBigInts(propertyQuery.operatorValue, query.datatype);
|
|
62402
62404
|
}
|
|
62403
62405
|
return query;
|
|
62404
62406
|
};
|
|
@@ -62418,6 +62420,12 @@ const transformQueryValueToBigInts = async (value, ldType) => {
|
|
|
62418
62420
|
}
|
|
62419
62421
|
return values;
|
|
62420
62422
|
};
|
|
62423
|
+
const transformExistsValue = (value) => {
|
|
62424
|
+
if (typeof value == 'boolean') {
|
|
62425
|
+
return [BigInt(value)];
|
|
62426
|
+
}
|
|
62427
|
+
throw new Error('exists operator value must be true or false');
|
|
62428
|
+
};
|
|
62421
62429
|
|
|
62422
62430
|
/* eslint-disable require-await */
|
|
62423
62431
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -63886,10 +63894,7 @@ class ProofService {
|
|
|
63886
63894
|
query.valueProof = new ValueProof();
|
|
63887
63895
|
query.valueProof.mtp = proof;
|
|
63888
63896
|
query.valueProof.path = queryMetadata.claimPathKey;
|
|
63889
|
-
const mtEntry = await mtValue?.mtEntry();
|
|
63890
|
-
if (!mtEntry) {
|
|
63891
|
-
throw new Error(`can't merklize credential: no merkle tree entry found`);
|
|
63892
|
-
}
|
|
63897
|
+
const mtEntry = (await mtValue?.mtEntry()) ?? 0n;
|
|
63893
63898
|
query.valueProof.value = mtEntry;
|
|
63894
63899
|
if (!queryMetadata.fieldName) {
|
|
63895
63900
|
query.values = [mtEntry];
|