@0xpolygonid/js-sdk 1.20.1 → 1.20.3
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 +348 -328
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +8 -11
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/circuits/atomic-query-sig-v2-on-chain.js +7 -10
- package/dist/node/cjs/iden3comm/handlers/common.js +1 -1
- package/dist/node/esm/circuits/atomic-query-sig-v2-on-chain.js +7 -10
- package/dist/node/esm/iden3comm/handlers/common.js +1 -1
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/auth.d.ts +28 -4
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +2 -2
- package/package.json +1 -1
|
@@ -21038,162 +21038,169 @@ var codegen = {};
|
|
|
21038
21038
|
|
|
21039
21039
|
var code$1 = {};
|
|
21040
21040
|
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
exports
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
|
|
21082
|
-
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21091
|
-
|
|
21092
|
-
|
|
21093
|
-
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
|
|
21115
|
-
|
|
21116
|
-
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
|
|
21131
|
-
|
|
21132
|
-
|
|
21133
|
-
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
-
|
|
21159
|
-
|
|
21160
|
-
|
|
21161
|
-
|
|
21162
|
-
|
|
21163
|
-
|
|
21164
|
-
|
|
21165
|
-
|
|
21166
|
-
|
|
21167
|
-
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
|
|
21173
|
-
|
|
21174
|
-
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
|
|
21185
|
-
|
|
21186
|
-
|
|
21187
|
-
|
|
21188
|
-
|
|
21189
|
-
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
|
|
21195
|
-
|
|
21196
|
-
|
|
21041
|
+
var hasRequiredCode$1;
|
|
21042
|
+
|
|
21043
|
+
function requireCode$1 () {
|
|
21044
|
+
if (hasRequiredCode$1) return code$1;
|
|
21045
|
+
hasRequiredCode$1 = 1;
|
|
21046
|
+
(function (exports) {
|
|
21047
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21048
|
+
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
21049
|
+
class _CodeOrName {
|
|
21050
|
+
}
|
|
21051
|
+
exports._CodeOrName = _CodeOrName;
|
|
21052
|
+
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
21053
|
+
class Name extends _CodeOrName {
|
|
21054
|
+
constructor(s) {
|
|
21055
|
+
super();
|
|
21056
|
+
if (!exports.IDENTIFIER.test(s))
|
|
21057
|
+
throw new Error("CodeGen: name must be a valid identifier");
|
|
21058
|
+
this.str = s;
|
|
21059
|
+
}
|
|
21060
|
+
toString() {
|
|
21061
|
+
return this.str;
|
|
21062
|
+
}
|
|
21063
|
+
emptyStr() {
|
|
21064
|
+
return false;
|
|
21065
|
+
}
|
|
21066
|
+
get names() {
|
|
21067
|
+
return { [this.str]: 1 };
|
|
21068
|
+
}
|
|
21069
|
+
}
|
|
21070
|
+
exports.Name = Name;
|
|
21071
|
+
class _Code extends _CodeOrName {
|
|
21072
|
+
constructor(code) {
|
|
21073
|
+
super();
|
|
21074
|
+
this._items = typeof code === "string" ? [code] : code;
|
|
21075
|
+
}
|
|
21076
|
+
toString() {
|
|
21077
|
+
return this.str;
|
|
21078
|
+
}
|
|
21079
|
+
emptyStr() {
|
|
21080
|
+
if (this._items.length > 1)
|
|
21081
|
+
return false;
|
|
21082
|
+
const item = this._items[0];
|
|
21083
|
+
return item === "" || item === '""';
|
|
21084
|
+
}
|
|
21085
|
+
get str() {
|
|
21086
|
+
var _a;
|
|
21087
|
+
return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
|
|
21088
|
+
}
|
|
21089
|
+
get names() {
|
|
21090
|
+
var _a;
|
|
21091
|
+
return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
|
|
21092
|
+
if (c instanceof Name)
|
|
21093
|
+
names[c.str] = (names[c.str] || 0) + 1;
|
|
21094
|
+
return names;
|
|
21095
|
+
}, {})));
|
|
21096
|
+
}
|
|
21097
|
+
}
|
|
21098
|
+
exports._Code = _Code;
|
|
21099
|
+
exports.nil = new _Code("");
|
|
21100
|
+
function _(strs, ...args) {
|
|
21101
|
+
const code = [strs[0]];
|
|
21102
|
+
let i = 0;
|
|
21103
|
+
while (i < args.length) {
|
|
21104
|
+
addCodeArg(code, args[i]);
|
|
21105
|
+
code.push(strs[++i]);
|
|
21106
|
+
}
|
|
21107
|
+
return new _Code(code);
|
|
21108
|
+
}
|
|
21109
|
+
exports._ = _;
|
|
21110
|
+
const plus = new _Code("+");
|
|
21111
|
+
function str(strs, ...args) {
|
|
21112
|
+
const expr = [safeStringify(strs[0])];
|
|
21113
|
+
let i = 0;
|
|
21114
|
+
while (i < args.length) {
|
|
21115
|
+
expr.push(plus);
|
|
21116
|
+
addCodeArg(expr, args[i]);
|
|
21117
|
+
expr.push(plus, safeStringify(strs[++i]));
|
|
21118
|
+
}
|
|
21119
|
+
optimize(expr);
|
|
21120
|
+
return new _Code(expr);
|
|
21121
|
+
}
|
|
21122
|
+
exports.str = str;
|
|
21123
|
+
function addCodeArg(code, arg) {
|
|
21124
|
+
if (arg instanceof _Code)
|
|
21125
|
+
code.push(...arg._items);
|
|
21126
|
+
else if (arg instanceof Name)
|
|
21127
|
+
code.push(arg);
|
|
21128
|
+
else
|
|
21129
|
+
code.push(interpolate(arg));
|
|
21130
|
+
}
|
|
21131
|
+
exports.addCodeArg = addCodeArg;
|
|
21132
|
+
function optimize(expr) {
|
|
21133
|
+
let i = 1;
|
|
21134
|
+
while (i < expr.length - 1) {
|
|
21135
|
+
if (expr[i] === plus) {
|
|
21136
|
+
const res = mergeExprItems(expr[i - 1], expr[i + 1]);
|
|
21137
|
+
if (res !== undefined) {
|
|
21138
|
+
expr.splice(i - 1, 3, res);
|
|
21139
|
+
continue;
|
|
21140
|
+
}
|
|
21141
|
+
expr[i++] = "+";
|
|
21142
|
+
}
|
|
21143
|
+
i++;
|
|
21144
|
+
}
|
|
21145
|
+
}
|
|
21146
|
+
function mergeExprItems(a, b) {
|
|
21147
|
+
if (b === '""')
|
|
21148
|
+
return a;
|
|
21149
|
+
if (a === '""')
|
|
21150
|
+
return b;
|
|
21151
|
+
if (typeof a == "string") {
|
|
21152
|
+
if (b instanceof Name || a[a.length - 1] !== '"')
|
|
21153
|
+
return;
|
|
21154
|
+
if (typeof b != "string")
|
|
21155
|
+
return `${a.slice(0, -1)}${b}"`;
|
|
21156
|
+
if (b[0] === '"')
|
|
21157
|
+
return a.slice(0, -1) + b.slice(1);
|
|
21158
|
+
return;
|
|
21159
|
+
}
|
|
21160
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
|
|
21161
|
+
return `"${a}${b.slice(1)}`;
|
|
21162
|
+
return;
|
|
21163
|
+
}
|
|
21164
|
+
function strConcat(c1, c2) {
|
|
21165
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
|
|
21166
|
+
}
|
|
21167
|
+
exports.strConcat = strConcat;
|
|
21168
|
+
// TODO do not allow arrays here
|
|
21169
|
+
function interpolate(x) {
|
|
21170
|
+
return typeof x == "number" || typeof x == "boolean" || x === null
|
|
21171
|
+
? x
|
|
21172
|
+
: safeStringify(Array.isArray(x) ? x.join(",") : x);
|
|
21173
|
+
}
|
|
21174
|
+
function stringify(x) {
|
|
21175
|
+
return new _Code(safeStringify(x));
|
|
21176
|
+
}
|
|
21177
|
+
exports.stringify = stringify;
|
|
21178
|
+
function safeStringify(x) {
|
|
21179
|
+
return JSON.stringify(x)
|
|
21180
|
+
.replace(/\u2028/g, "\\u2028")
|
|
21181
|
+
.replace(/\u2029/g, "\\u2029");
|
|
21182
|
+
}
|
|
21183
|
+
exports.safeStringify = safeStringify;
|
|
21184
|
+
function getProperty(key) {
|
|
21185
|
+
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
|
|
21186
|
+
}
|
|
21187
|
+
exports.getProperty = getProperty;
|
|
21188
|
+
//Does best effort to format the name properly
|
|
21189
|
+
function getEsmExportName(key) {
|
|
21190
|
+
if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
|
|
21191
|
+
return new _Code(`${key}`);
|
|
21192
|
+
}
|
|
21193
|
+
throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
|
|
21194
|
+
}
|
|
21195
|
+
exports.getEsmExportName = getEsmExportName;
|
|
21196
|
+
function regexpCode(rx) {
|
|
21197
|
+
return new _Code(rx.toString());
|
|
21198
|
+
}
|
|
21199
|
+
exports.regexpCode = regexpCode;
|
|
21200
|
+
|
|
21201
|
+
} (code$1));
|
|
21202
|
+
return code$1;
|
|
21203
|
+
}
|
|
21197
21204
|
|
|
21198
21205
|
var scope = {};
|
|
21199
21206
|
|
|
@@ -21205,7 +21212,7 @@ function requireScope () {
|
|
|
21205
21212
|
(function (exports) {
|
|
21206
21213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21207
21214
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
21208
|
-
const code_1 =
|
|
21215
|
+
const code_1 = requireCode$1();
|
|
21209
21216
|
class ValueError extends Error {
|
|
21210
21217
|
constructor(name) {
|
|
21211
21218
|
super(`CodeGen: "code" for ${name} not defined`);
|
|
@@ -21357,9 +21364,9 @@ function requireCodegen () {
|
|
|
21357
21364
|
(function (exports) {
|
|
21358
21365
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21359
21366
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
|
|
21360
|
-
const code_1 =
|
|
21367
|
+
const code_1 = requireCode$1();
|
|
21361
21368
|
const scope_1 = requireScope();
|
|
21362
|
-
var code_2 =
|
|
21369
|
+
var code_2 = requireCode$1();
|
|
21363
21370
|
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } });
|
|
21364
21371
|
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } });
|
|
21365
21372
|
Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } });
|
|
@@ -22061,7 +22068,7 @@ var util = {};
|
|
|
22061
22068
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22062
22069
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
|
|
22063
22070
|
const codegen_1 = requireCodegen();
|
|
22064
|
-
const code_1 =
|
|
22071
|
+
const code_1 = requireCode$1();
|
|
22065
22072
|
// TODO refactor to use Set
|
|
22066
22073
|
function toHash(arr) {
|
|
22067
22074
|
const hash = {};
|
|
@@ -22494,29 +22501,37 @@ rules.getRules = getRules;
|
|
|
22494
22501
|
|
|
22495
22502
|
var applicability = {};
|
|
22496
22503
|
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
function
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
}
|
|
22503
|
-
applicability.schemaHasRulesForType =
|
|
22504
|
-
function
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
|
|
22504
|
+
var hasRequiredApplicability;
|
|
22505
|
+
|
|
22506
|
+
function requireApplicability () {
|
|
22507
|
+
if (hasRequiredApplicability) return applicability;
|
|
22508
|
+
hasRequiredApplicability = 1;
|
|
22509
|
+
Object.defineProperty(applicability, "__esModule", { value: true });
|
|
22510
|
+
applicability.shouldUseRule = applicability.shouldUseGroup = applicability.schemaHasRulesForType = void 0;
|
|
22511
|
+
function schemaHasRulesForType({ schema, self }, type) {
|
|
22512
|
+
const group = self.RULES.types[type];
|
|
22513
|
+
return group && group !== true && shouldUseGroup(schema, group);
|
|
22514
|
+
}
|
|
22515
|
+
applicability.schemaHasRulesForType = schemaHasRulesForType;
|
|
22516
|
+
function shouldUseGroup(schema, group) {
|
|
22517
|
+
return group.rules.some((rule) => shouldUseRule(schema, rule));
|
|
22518
|
+
}
|
|
22519
|
+
applicability.shouldUseGroup = shouldUseGroup;
|
|
22520
|
+
function shouldUseRule(schema, rule) {
|
|
22521
|
+
var _a;
|
|
22522
|
+
return (schema[rule.keyword] !== undefined ||
|
|
22523
|
+
((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
|
|
22524
|
+
}
|
|
22525
|
+
applicability.shouldUseRule = shouldUseRule;
|
|
22526
|
+
|
|
22527
|
+
return applicability;
|
|
22512
22528
|
}
|
|
22513
|
-
applicability.shouldUseRule = shouldUseRule;
|
|
22514
22529
|
|
|
22515
22530
|
(function (exports) {
|
|
22516
22531
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22517
22532
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
|
|
22518
22533
|
const rules_1 = rules;
|
|
22519
|
-
const applicability_1 =
|
|
22534
|
+
const applicability_1 = requireApplicability();
|
|
22520
22535
|
const errors_1 = requireErrors();
|
|
22521
22536
|
const codegen_1 = requireCodegen();
|
|
22522
22537
|
const util_1 = util;
|
|
@@ -22764,135 +22779,143 @@ var keyword = {};
|
|
|
22764
22779
|
|
|
22765
22780
|
var code = {};
|
|
22766
22781
|
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22775
|
-
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
}
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
}
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22788
|
-
}
|
|
22789
|
-
code.
|
|
22790
|
-
function
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
|
|
22800
|
-
}
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
}
|
|
22806
|
-
code.
|
|
22807
|
-
function
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
}
|
|
22811
|
-
code.
|
|
22812
|
-
function
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
|
-
|
|
22850
|
-
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
|
|
22855
|
-
|
|
22856
|
-
|
|
22857
|
-
|
|
22858
|
-
|
|
22859
|
-
|
|
22860
|
-
|
|
22861
|
-
|
|
22862
|
-
|
|
22863
|
-
|
|
22864
|
-
|
|
22865
|
-
|
|
22866
|
-
|
|
22867
|
-
|
|
22868
|
-
|
|
22869
|
-
|
|
22870
|
-
|
|
22871
|
-
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22782
|
+
var hasRequiredCode;
|
|
22783
|
+
|
|
22784
|
+
function requireCode () {
|
|
22785
|
+
if (hasRequiredCode) return code;
|
|
22786
|
+
hasRequiredCode = 1;
|
|
22787
|
+
Object.defineProperty(code, "__esModule", { value: true });
|
|
22788
|
+
code.validateUnion = code.validateArray = code.usePattern = code.callValidateCode = code.schemaProperties = code.allSchemaProperties = code.noPropertyInData = code.propertyInData = code.isOwnProperty = code.hasPropFunc = code.reportMissingProp = code.checkMissingProp = code.checkReportMissingProp = void 0;
|
|
22789
|
+
const codegen_1 = requireCodegen();
|
|
22790
|
+
const util_1 = util;
|
|
22791
|
+
const names_1 = requireNames();
|
|
22792
|
+
const util_2 = util;
|
|
22793
|
+
function checkReportMissingProp(cxt, prop) {
|
|
22794
|
+
const { gen, data, it } = cxt;
|
|
22795
|
+
gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
|
|
22796
|
+
cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);
|
|
22797
|
+
cxt.error();
|
|
22798
|
+
});
|
|
22799
|
+
}
|
|
22800
|
+
code.checkReportMissingProp = checkReportMissingProp;
|
|
22801
|
+
function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
|
|
22802
|
+
return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));
|
|
22803
|
+
}
|
|
22804
|
+
code.checkMissingProp = checkMissingProp;
|
|
22805
|
+
function reportMissingProp(cxt, missing) {
|
|
22806
|
+
cxt.setParams({ missingProperty: missing }, true);
|
|
22807
|
+
cxt.error();
|
|
22808
|
+
}
|
|
22809
|
+
code.reportMissingProp = reportMissingProp;
|
|
22810
|
+
function hasPropFunc(gen) {
|
|
22811
|
+
return gen.scopeValue("func", {
|
|
22812
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
22813
|
+
ref: Object.prototype.hasOwnProperty,
|
|
22814
|
+
code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,
|
|
22815
|
+
});
|
|
22816
|
+
}
|
|
22817
|
+
code.hasPropFunc = hasPropFunc;
|
|
22818
|
+
function isOwnProperty(gen, data, property) {
|
|
22819
|
+
return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;
|
|
22820
|
+
}
|
|
22821
|
+
code.isOwnProperty = isOwnProperty;
|
|
22822
|
+
function propertyInData(gen, data, property, ownProperties) {
|
|
22823
|
+
const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
|
|
22824
|
+
return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
|
|
22825
|
+
}
|
|
22826
|
+
code.propertyInData = propertyInData;
|
|
22827
|
+
function noPropertyInData(gen, data, property, ownProperties) {
|
|
22828
|
+
const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;
|
|
22829
|
+
return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
|
|
22830
|
+
}
|
|
22831
|
+
code.noPropertyInData = noPropertyInData;
|
|
22832
|
+
function allSchemaProperties(schemaMap) {
|
|
22833
|
+
return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
|
|
22834
|
+
}
|
|
22835
|
+
code.allSchemaProperties = allSchemaProperties;
|
|
22836
|
+
function schemaProperties(it, schemaMap) {
|
|
22837
|
+
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
|
|
22838
|
+
}
|
|
22839
|
+
code.schemaProperties = schemaProperties;
|
|
22840
|
+
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
|
|
22841
|
+
const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
|
|
22842
|
+
const valCxt = [
|
|
22843
|
+
[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
|
|
22844
|
+
[names_1.default.parentData, it.parentData],
|
|
22845
|
+
[names_1.default.parentDataProperty, it.parentDataProperty],
|
|
22846
|
+
[names_1.default.rootData, names_1.default.rootData],
|
|
22847
|
+
];
|
|
22848
|
+
if (it.opts.dynamicRef)
|
|
22849
|
+
valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
|
|
22850
|
+
const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;
|
|
22851
|
+
return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;
|
|
22852
|
+
}
|
|
22853
|
+
code.callValidateCode = callValidateCode;
|
|
22854
|
+
const newRegExp = (0, codegen_1._) `new RegExp`;
|
|
22855
|
+
function usePattern({ gen, it: { opts } }, pattern) {
|
|
22856
|
+
const u = opts.unicodeRegExp ? "u" : "";
|
|
22857
|
+
const { regExp } = opts.code;
|
|
22858
|
+
const rx = regExp(pattern, u);
|
|
22859
|
+
return gen.scopeValue("pattern", {
|
|
22860
|
+
key: rx.toString(),
|
|
22861
|
+
ref: rx,
|
|
22862
|
+
code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,
|
|
22863
|
+
});
|
|
22864
|
+
}
|
|
22865
|
+
code.usePattern = usePattern;
|
|
22866
|
+
function validateArray(cxt) {
|
|
22867
|
+
const { gen, data, keyword, it } = cxt;
|
|
22868
|
+
const valid = gen.name("valid");
|
|
22869
|
+
if (it.allErrors) {
|
|
22870
|
+
const validArr = gen.let("valid", true);
|
|
22871
|
+
validateItems(() => gen.assign(validArr, false));
|
|
22872
|
+
return validArr;
|
|
22873
|
+
}
|
|
22874
|
+
gen.var(valid, true);
|
|
22875
|
+
validateItems(() => gen.break());
|
|
22876
|
+
return valid;
|
|
22877
|
+
function validateItems(notValid) {
|
|
22878
|
+
const len = gen.const("len", (0, codegen_1._) `${data}.length`);
|
|
22879
|
+
gen.forRange("i", 0, len, (i) => {
|
|
22880
|
+
cxt.subschema({
|
|
22881
|
+
keyword,
|
|
22882
|
+
dataProp: i,
|
|
22883
|
+
dataPropType: util_1.Type.Num,
|
|
22884
|
+
}, valid);
|
|
22885
|
+
gen.if((0, codegen_1.not)(valid), notValid);
|
|
22886
|
+
});
|
|
22887
|
+
}
|
|
22888
|
+
}
|
|
22889
|
+
code.validateArray = validateArray;
|
|
22890
|
+
function validateUnion(cxt) {
|
|
22891
|
+
const { gen, schema, keyword, it } = cxt;
|
|
22892
|
+
/* istanbul ignore if */
|
|
22893
|
+
if (!Array.isArray(schema))
|
|
22894
|
+
throw new Error("ajv implementation error");
|
|
22895
|
+
const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
|
|
22896
|
+
if (alwaysValid && !it.opts.unevaluated)
|
|
22897
|
+
return;
|
|
22898
|
+
const valid = gen.let("valid", false);
|
|
22899
|
+
const schValid = gen.name("_valid");
|
|
22900
|
+
gen.block(() => schema.forEach((_sch, i) => {
|
|
22901
|
+
const schCxt = cxt.subschema({
|
|
22902
|
+
keyword,
|
|
22903
|
+
schemaProp: i,
|
|
22904
|
+
compositeRule: true,
|
|
22905
|
+
}, schValid);
|
|
22906
|
+
gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);
|
|
22907
|
+
const merged = cxt.mergeValidEvaluated(schCxt, schValid);
|
|
22908
|
+
// can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
|
|
22909
|
+
// or if all properties and items were evaluated (it.props === true && it.items === true)
|
|
22910
|
+
if (!merged)
|
|
22911
|
+
gen.if((0, codegen_1.not)(valid));
|
|
22912
|
+
}));
|
|
22913
|
+
cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
|
|
22914
|
+
}
|
|
22915
|
+
code.validateUnion = validateUnion;
|
|
22916
|
+
|
|
22917
|
+
return code;
|
|
22894
22918
|
}
|
|
22895
|
-
code.validateUnion = validateUnion;
|
|
22896
22919
|
|
|
22897
22920
|
var hasRequiredKeyword;
|
|
22898
22921
|
|
|
@@ -22903,7 +22926,7 @@ function requireKeyword () {
|
|
|
22903
22926
|
keyword.validateKeywordUsage = keyword.validSchemaType = keyword.funcKeywordCode = keyword.macroKeywordCode = void 0;
|
|
22904
22927
|
const codegen_1 = requireCodegen();
|
|
22905
22928
|
const names_1 = requireNames();
|
|
22906
|
-
const code_1 =
|
|
22929
|
+
const code_1 = requireCode();
|
|
22907
22930
|
const errors_1 = requireErrors();
|
|
22908
22931
|
function macroKeywordCode(cxt, def) {
|
|
22909
22932
|
const { gen, keyword, schema, parentSchema, it } = cxt;
|
|
@@ -23421,7 +23444,7 @@ function requireValidate () {
|
|
|
23421
23444
|
validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
|
|
23422
23445
|
const boolSchema_1 = requireBoolSchema();
|
|
23423
23446
|
const dataType_1 = dataType;
|
|
23424
|
-
const applicability_1 =
|
|
23447
|
+
const applicability_1 = requireApplicability();
|
|
23425
23448
|
const dataType_2 = dataType;
|
|
23426
23449
|
const defaults_1 = requireDefaults();
|
|
23427
23450
|
const keyword_1 = requireKeyword();
|
|
@@ -26307,7 +26330,7 @@ var ref = {};
|
|
|
26307
26330
|
Object.defineProperty(ref, "__esModule", { value: true });
|
|
26308
26331
|
ref.callRef = ref.getValidate = void 0;
|
|
26309
26332
|
const ref_error_1 = requireRef_error();
|
|
26310
|
-
const code_1$8 =
|
|
26333
|
+
const code_1$8 = requireCode();
|
|
26311
26334
|
const codegen_1$p = requireCodegen();
|
|
26312
26335
|
const names_1$4 = requireNames();
|
|
26313
26336
|
const compile_1$2 = compile;
|
|
@@ -26553,7 +26576,7 @@ limitLength.default = def$x;
|
|
|
26553
26576
|
var pattern = {};
|
|
26554
26577
|
|
|
26555
26578
|
Object.defineProperty(pattern, "__esModule", { value: true });
|
|
26556
|
-
const code_1$7 =
|
|
26579
|
+
const code_1$7 = requireCode();
|
|
26557
26580
|
const codegen_1$l = requireCodegen();
|
|
26558
26581
|
const error$h = {
|
|
26559
26582
|
message: ({ schemaCode }) => (0, codegen_1$l.str) `must match pattern "${schemaCode}"`,
|
|
@@ -26603,7 +26626,7 @@ limitProperties.default = def$v;
|
|
|
26603
26626
|
var required = {};
|
|
26604
26627
|
|
|
26605
26628
|
Object.defineProperty(required, "__esModule", { value: true });
|
|
26606
|
-
const code_1$6 =
|
|
26629
|
+
const code_1$6 = requireCode();
|
|
26607
26630
|
const codegen_1$j = requireCodegen();
|
|
26608
26631
|
const util_1$l = util;
|
|
26609
26632
|
const error$f = {
|
|
@@ -26945,7 +26968,7 @@ Object.defineProperty(items, "__esModule", { value: true });
|
|
|
26945
26968
|
items.validateTuple = void 0;
|
|
26946
26969
|
const codegen_1$d = requireCodegen();
|
|
26947
26970
|
const util_1$g = util;
|
|
26948
|
-
const code_1$5 =
|
|
26971
|
+
const code_1$5 = requireCode();
|
|
26949
26972
|
const def$o = {
|
|
26950
26973
|
keyword: "items",
|
|
26951
26974
|
type: "array",
|
|
@@ -27008,7 +27031,7 @@ var items2020 = {};
|
|
|
27008
27031
|
Object.defineProperty(items2020, "__esModule", { value: true });
|
|
27009
27032
|
const codegen_1$c = requireCodegen();
|
|
27010
27033
|
const util_1$f = util;
|
|
27011
|
-
const code_1$4 =
|
|
27034
|
+
const code_1$4 = requireCode();
|
|
27012
27035
|
const additionalItems_1$1 = additionalItems;
|
|
27013
27036
|
const error$9 = {
|
|
27014
27037
|
message: ({ params: { len } }) => (0, codegen_1$c.str) `must NOT have more than ${len} items`,
|
|
@@ -27137,7 +27160,7 @@ var dependencies = {};
|
|
|
27137
27160
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
|
|
27138
27161
|
const codegen_1 = requireCodegen();
|
|
27139
27162
|
const util_1 = util;
|
|
27140
|
-
const code_1 =
|
|
27163
|
+
const code_1 = requireCode();
|
|
27141
27164
|
exports.error = {
|
|
27142
27165
|
message: ({ params: { property, depsCount, deps } }) => {
|
|
27143
27166
|
const property_ies = depsCount === 1 ? "property" : "properties";
|
|
@@ -27261,7 +27284,7 @@ propertyNames.default = def$k;
|
|
|
27261
27284
|
var additionalProperties = {};
|
|
27262
27285
|
|
|
27263
27286
|
Object.defineProperty(additionalProperties, "__esModule", { value: true });
|
|
27264
|
-
const code_1$3 =
|
|
27287
|
+
const code_1$3 = requireCode();
|
|
27265
27288
|
const codegen_1$9 = requireCodegen();
|
|
27266
27289
|
const names_1$3 = requireNames();
|
|
27267
27290
|
const util_1$c = util;
|
|
@@ -27369,7 +27392,7 @@ var properties$g = {};
|
|
|
27369
27392
|
|
|
27370
27393
|
Object.defineProperty(properties$g, "__esModule", { value: true });
|
|
27371
27394
|
const validate_1 = requireValidate();
|
|
27372
|
-
const code_1$2 =
|
|
27395
|
+
const code_1$2 = requireCode();
|
|
27373
27396
|
const util_1$b = util;
|
|
27374
27397
|
const additionalProperties_1$1 = additionalProperties;
|
|
27375
27398
|
const def$i = {
|
|
@@ -27423,7 +27446,7 @@ properties$g.default = def$i;
|
|
|
27423
27446
|
var patternProperties = {};
|
|
27424
27447
|
|
|
27425
27448
|
Object.defineProperty(patternProperties, "__esModule", { value: true });
|
|
27426
|
-
const code_1$1 =
|
|
27449
|
+
const code_1$1 = requireCode();
|
|
27427
27450
|
const codegen_1$8 = requireCodegen();
|
|
27428
27451
|
const util_1$a = util;
|
|
27429
27452
|
const util_2 = util;
|
|
@@ -27526,7 +27549,7 @@ not.default = def$g;
|
|
|
27526
27549
|
var anyOf = {};
|
|
27527
27550
|
|
|
27528
27551
|
Object.defineProperty(anyOf, "__esModule", { value: true });
|
|
27529
|
-
const code_1 =
|
|
27552
|
+
const code_1 = requireCode();
|
|
27530
27553
|
const def$f = {
|
|
27531
27554
|
keyword: "anyOf",
|
|
27532
27555
|
schemaType: "array",
|
|
@@ -50815,6 +50838,9 @@ class AtomicQuerySigV2OnChainInputs extends BaseConfig {
|
|
|
50815
50838
|
this.query.valueProof.validate();
|
|
50816
50839
|
}
|
|
50817
50840
|
const valueProof = this.query?.valueProof ?? new ValueProof();
|
|
50841
|
+
const treeState = this.skipClaimRevocationCheck
|
|
50842
|
+
? this.claim.signatureProof?.issuerAuthNonRevProof.treeState
|
|
50843
|
+
: this.claim.nonRevProof?.treeState;
|
|
50818
50844
|
const s = {
|
|
50819
50845
|
requestID: this.requestID.toString(),
|
|
50820
50846
|
userGenesisID: this.id.bigInt().toString(),
|
|
@@ -50822,16 +50848,10 @@ class AtomicQuerySigV2OnChainInputs extends BaseConfig {
|
|
|
50822
50848
|
claimSubjectProfileNonce: this.claimSubjectProfileNonce?.toString(),
|
|
50823
50849
|
issuerID: this.claim.issuerID?.bigInt().toString(),
|
|
50824
50850
|
issuerClaim: this.claim.claim?.marshalJson(),
|
|
50825
|
-
issuerClaimNonRevClaimsTreeRoot:
|
|
50826
|
-
|
|
50827
|
-
|
|
50828
|
-
|
|
50829
|
-
?.bigInt()
|
|
50830
|
-
.toString(),
|
|
50831
|
-
issuerClaimNonRevRootsTreeRoot: this.claim.nonRevProof?.treeState?.rootOfRoots
|
|
50832
|
-
?.bigInt()
|
|
50833
|
-
.toString(),
|
|
50834
|
-
issuerClaimNonRevState: this.claim.nonRevProof?.treeState?.state?.bigInt().toString(),
|
|
50851
|
+
issuerClaimNonRevClaimsTreeRoot: treeState?.claimsRoot?.bigInt().toString(),
|
|
50852
|
+
issuerClaimNonRevRevTreeRoot: treeState?.revocationRoot?.bigInt().toString(),
|
|
50853
|
+
issuerClaimNonRevRootsTreeRoot: treeState?.rootOfRoots?.bigInt().toString(),
|
|
50854
|
+
issuerClaimNonRevState: treeState?.state?.bigInt().toString(),
|
|
50835
50855
|
issuerClaimNonRevMtp: this.claim.nonRevProof?.proof &&
|
|
50836
50856
|
prepareSiblingsStr(this.claim.nonRevProof.proof, this.getMTLevel()),
|
|
50837
50857
|
issuerClaimSignatureR8x: this.claim.signatureProof && this.claim.signatureProof.signature.R8[0].toString(),
|
|
@@ -57166,7 +57186,7 @@ var CredentialOfferStatus;
|
|
|
57166
57186
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
57167
57187
|
*
|
|
57168
57188
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
57169
|
-
* @returns A Map<number, { query:
|
|
57189
|
+
* @returns A Map<number, { query: ZeroKnowledgeProofQuery; linkNonce: number }> representing the grouped queries.
|
|
57170
57190
|
*/
|
|
57171
57191
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
57172
57192
|
const groupId = proofReq.query.groupId;
|