@0xpolygonid/js-sdk 1.9.3 → 1.9.4
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 +18 -10
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +19 -9
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/proof/verifiers/pub-signals-verifier.js +4 -1
- package/dist/node/cjs/proof/verifiers/query.js +16 -9
- package/dist/node/esm/proof/verifiers/pub-signals-verifier.js +5 -2
- package/dist/node/esm/proof/verifiers/query.js +14 -9
- package/dist/types/proof/verifiers/query.d.ts +2 -0
- package/package.json +4 -3
|
@@ -85747,14 +85747,7 @@ var PolygonIdSdk = (function (exports) {
|
|
|
85747
85747
|
if (!query.skipClaimRevocationCheck && outputs.isRevocationChecked === 0) {
|
|
85748
85748
|
throw new Error(`check revocation is required`);
|
|
85749
85749
|
}
|
|
85750
|
-
|
|
85751
|
-
if (queriesMetadata.length > circuitValidationData.maxQueriesCount) {
|
|
85752
|
-
throw new Error(`circuit ${circuitId} supports only ${circuitValidator[circuitId].maxQueriesCount} queries`);
|
|
85753
|
-
}
|
|
85754
|
-
const notSupportedOpIndx = queriesMetadata.findIndex((i) => !circuitValidationData.supportedOperations.includes(i.operator));
|
|
85755
|
-
if (notSupportedOpIndx > -1) {
|
|
85756
|
-
throw new Error(`circuit ${circuitId} not support ${queriesMetadata[notSupportedOpIndx].operator} operator`);
|
|
85757
|
-
}
|
|
85750
|
+
checkCircuitQueriesLength(circuitId, queriesMetadata);
|
|
85758
85751
|
// verify timestamp
|
|
85759
85752
|
let acceptedProofGenerationDelay = defaultProofGenerationDelayOpts;
|
|
85760
85753
|
if (opts?.acceptedProofGenerationDelay) {
|
|
@@ -85766,6 +85759,18 @@ var PolygonIdSdk = (function (exports) {
|
|
|
85766
85759
|
}
|
|
85767
85760
|
return;
|
|
85768
85761
|
}
|
|
85762
|
+
function checkCircuitQueriesLength(circuitId, queriesMetadata) {
|
|
85763
|
+
const circuitValidationData = circuitValidator[circuitId];
|
|
85764
|
+
if (queriesMetadata.length > circuitValidationData.maxQueriesCount) {
|
|
85765
|
+
throw new Error(`circuit ${circuitId} supports only ${circuitValidator[circuitId].maxQueriesCount} queries`);
|
|
85766
|
+
}
|
|
85767
|
+
}
|
|
85768
|
+
function checkCircuitOperator(circuitId, operator) {
|
|
85769
|
+
const circuitValidationData = circuitValidator[circuitId];
|
|
85770
|
+
if (!circuitValidationData.supportedOperations.includes(operator)) {
|
|
85771
|
+
throw new Error(`circuit ${circuitId} not support ${getOperatorNameByValue(operator)} operator`);
|
|
85772
|
+
}
|
|
85773
|
+
}
|
|
85769
85774
|
function verifyFieldValueInclusionV2(outputs, metadata) {
|
|
85770
85775
|
if (outputs.operator == QueryOperators.$noop) {
|
|
85771
85776
|
return;
|
|
@@ -86064,8 +86069,10 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86064
86069
|
const queriesMetadata = await parseQueriesMetadata(query.type, JSON.stringify(context), query.credentialSubject, {
|
|
86065
86070
|
documentLoader: loader
|
|
86066
86071
|
});
|
|
86067
|
-
|
|
86072
|
+
const circuitId = exports.CircuitId.AtomicQueryV3;
|
|
86073
|
+
await checkQueryRequest(query, queriesMetadata, context, outs, circuitId, this._documentLoader, opts);
|
|
86068
86074
|
const queryMetadata = queriesMetadata[0]; // only one query is supported
|
|
86075
|
+
checkCircuitOperator(circuitId, outs.operator);
|
|
86069
86076
|
// validate selective disclosure
|
|
86070
86077
|
if (queryMetadata.operator === exports.Operators.SD) {
|
|
86071
86078
|
try {
|
|
@@ -86285,6 +86292,7 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86285
86292
|
});
|
|
86286
86293
|
await checkQueryRequest(query, queriesMetadata, context, outs, circuitId, this._documentLoader, opts);
|
|
86287
86294
|
const queryMetadata = queriesMetadata[0]; // only one query is supported
|
|
86295
|
+
checkCircuitOperator(circuitId, outs.operator);
|
|
86288
86296
|
// validate selective disclosure
|
|
86289
86297
|
if (queryMetadata.operator === exports.Operators.SD) {
|
|
86290
86298
|
try {
|
|
@@ -88001,6 +88009,8 @@ var PolygonIdSdk = (function (exports) {
|
|
|
88001
88009
|
exports.calculateCoreSchemaHash = calculateCoreSchemaHash;
|
|
88002
88010
|
exports.calculateQueryHashV2 = calculateQueryHashV2;
|
|
88003
88011
|
exports.calculateQueryHashV3 = calculateQueryHashV3;
|
|
88012
|
+
exports.checkCircuitOperator = checkCircuitOperator;
|
|
88013
|
+
exports.checkCircuitQueriesLength = checkCircuitQueriesLength;
|
|
88004
88014
|
exports.checkDataInField = checkDataInField;
|
|
88005
88015
|
exports.checkQueryRequest = checkQueryRequest;
|
|
88006
88016
|
exports.circuitValidator = circuitValidator;
|