@atxp/client 0.2.22 → 0.4.0

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.
Files changed (191) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/ajv.js +8 -0
  4. package/dist/_virtual/ajv.js.map +1 -0
  5. package/dist/_virtual/cache.js +4 -0
  6. package/dist/_virtual/cache.js.map +1 -0
  7. package/dist/_virtual/index.js +4 -0
  8. package/dist/_virtual/index.js.map +1 -0
  9. package/dist/_virtual/uri.all.js +4 -0
  10. package/dist/_virtual/uri.all.js.map +1 -0
  11. package/dist/atxpAccount.js +4 -2
  12. package/dist/atxpAccount.js.map +1 -1
  13. package/dist/atxpClient.js +12 -10
  14. package/dist/atxpClient.js.map +1 -1
  15. package/dist/atxpFetcher.js +10 -8
  16. package/dist/atxpFetcher.js.map +1 -1
  17. package/dist/baseAccount.js +5 -3
  18. package/dist/baseAccount.js.map +1 -1
  19. package/dist/baseConstants.js +4 -0
  20. package/dist/baseConstants.js.map +1 -0
  21. package/dist/basePaymentMaker.js +15 -12
  22. package/dist/basePaymentMaker.js.map +1 -1
  23. package/dist/index.cjs +16198 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.ts +250 -10
  26. package/dist/index.js +16161 -10
  27. package/dist/index.js.map +1 -1
  28. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +668 -0
  29. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -0
  30. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +273 -0
  31. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -0
  32. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +378 -0
  33. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -0
  34. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js +162 -0
  35. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map +1 -0
  36. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +46 -0
  37. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map +1 -0
  38. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +192 -0
  39. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -0
  40. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +418 -0
  41. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
  42. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1313 -0
  43. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
  44. package/dist/node_modules/ajv/lib/ajv.js +531 -0
  45. package/dist/node_modules/ajv/lib/ajv.js.map +1 -0
  46. package/dist/node_modules/ajv/lib/cache.js +37 -0
  47. package/dist/node_modules/ajv/lib/cache.js.map +1 -0
  48. package/dist/node_modules/ajv/lib/compile/async.js +102 -0
  49. package/dist/node_modules/ajv/lib/compile/async.js.map +1 -0
  50. package/dist/node_modules/ajv/lib/compile/error_classes.js +46 -0
  51. package/dist/node_modules/ajv/lib/compile/error_classes.js.map +1 -0
  52. package/dist/node_modules/ajv/lib/compile/formats.js +154 -0
  53. package/dist/node_modules/ajv/lib/compile/formats.js.map +1 -0
  54. package/dist/node_modules/ajv/lib/compile/index.js +404 -0
  55. package/dist/node_modules/ajv/lib/compile/index.js.map +1 -0
  56. package/dist/node_modules/ajv/lib/compile/resolve.js +286 -0
  57. package/dist/node_modules/ajv/lib/compile/resolve.js.map +1 -0
  58. package/dist/node_modules/ajv/lib/compile/rules.js +79 -0
  59. package/dist/node_modules/ajv/lib/compile/rules.js.map +1 -0
  60. package/dist/node_modules/ajv/lib/compile/schema_obj.js +21 -0
  61. package/dist/node_modules/ajv/lib/compile/schema_obj.js.map +1 -0
  62. package/dist/node_modules/ajv/lib/compile/ucs2length.js +30 -0
  63. package/dist/node_modules/ajv/lib/compile/ucs2length.js.map +1 -0
  64. package/dist/node_modules/ajv/lib/compile/util.js +252 -0
  65. package/dist/node_modules/ajv/lib/compile/util.js.map +1 -0
  66. package/dist/node_modules/ajv/lib/data.js +59 -0
  67. package/dist/node_modules/ajv/lib/data.js.map +1 -0
  68. package/dist/node_modules/ajv/lib/definition_schema.js +49 -0
  69. package/dist/node_modules/ajv/lib/definition_schema.js.map +1 -0
  70. package/dist/node_modules/ajv/lib/dotjs/_limit.js +173 -0
  71. package/dist/node_modules/ajv/lib/dotjs/_limit.js.map +1 -0
  72. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +90 -0
  73. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js.map +1 -0
  74. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +95 -0
  75. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js.map +1 -0
  76. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +90 -0
  77. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js.map +1 -0
  78. package/dist/node_modules/ajv/lib/dotjs/allOf.js +52 -0
  79. package/dist/node_modules/ajv/lib/dotjs/allOf.js.map +1 -0
  80. package/dist/node_modules/ajv/lib/dotjs/anyOf.js +83 -0
  81. package/dist/node_modules/ajv/lib/dotjs/anyOf.js.map +1 -0
  82. package/dist/node_modules/ajv/lib/dotjs/comment.js +24 -0
  83. package/dist/node_modules/ajv/lib/dotjs/comment.js.map +1 -0
  84. package/dist/node_modules/ajv/lib/dotjs/const.js +62 -0
  85. package/dist/node_modules/ajv/lib/dotjs/const.js.map +1 -0
  86. package/dist/node_modules/ajv/lib/dotjs/contains.js +91 -0
  87. package/dist/node_modules/ajv/lib/dotjs/contains.js.map +1 -0
  88. package/dist/node_modules/ajv/lib/dotjs/custom.js +238 -0
  89. package/dist/node_modules/ajv/lib/dotjs/custom.js.map +1 -0
  90. package/dist/node_modules/ajv/lib/dotjs/dependencies.js +178 -0
  91. package/dist/node_modules/ajv/lib/dotjs/dependencies.js.map +1 -0
  92. package/dist/node_modules/ajv/lib/dotjs/enum.js +72 -0
  93. package/dist/node_modules/ajv/lib/dotjs/enum.js.map +1 -0
  94. package/dist/node_modules/ajv/lib/dotjs/format.js +160 -0
  95. package/dist/node_modules/ajv/lib/dotjs/format.js.map +1 -0
  96. package/dist/node_modules/ajv/lib/dotjs/if.js +113 -0
  97. package/dist/node_modules/ajv/lib/dotjs/if.js.map +1 -0
  98. package/dist/node_modules/ajv/lib/dotjs/index.js +68 -0
  99. package/dist/node_modules/ajv/lib/dotjs/index.js.map +1 -0
  100. package/dist/node_modules/ajv/lib/dotjs/items.js +150 -0
  101. package/dist/node_modules/ajv/lib/dotjs/items.js.map +1 -0
  102. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +90 -0
  103. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js.map +1 -0
  104. package/dist/node_modules/ajv/lib/dotjs/not.js +94 -0
  105. package/dist/node_modules/ajv/lib/dotjs/not.js.map +1 -0
  106. package/dist/node_modules/ajv/lib/dotjs/oneOf.js +83 -0
  107. package/dist/node_modules/ajv/lib/dotjs/oneOf.js.map +1 -0
  108. package/dist/node_modules/ajv/lib/dotjs/pattern.js +85 -0
  109. package/dist/node_modules/ajv/lib/dotjs/pattern.js.map +1 -0
  110. package/dist/node_modules/ajv/lib/dotjs/properties.js +345 -0
  111. package/dist/node_modules/ajv/lib/dotjs/properties.js.map +1 -0
  112. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +91 -0
  113. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js.map +1 -0
  114. package/dist/node_modules/ajv/lib/dotjs/ref.js +134 -0
  115. package/dist/node_modules/ajv/lib/dotjs/ref.js.map +1 -0
  116. package/dist/node_modules/ajv/lib/dotjs/required.js +276 -0
  117. package/dist/node_modules/ajv/lib/dotjs/required.js.map +1 -0
  118. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +96 -0
  119. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js.map +1 -0
  120. package/dist/node_modules/ajv/lib/dotjs/validate.js +492 -0
  121. package/dist/node_modules/ajv/lib/dotjs/validate.js.map +1 -0
  122. package/dist/node_modules/ajv/lib/keyword.js +159 -0
  123. package/dist/node_modules/ajv/lib/keyword.js.map +1 -0
  124. package/dist/node_modules/ajv/lib/refs/data.json.js +33 -0
  125. package/dist/node_modules/ajv/lib/refs/data.json.js.map +1 -0
  126. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js +254 -0
  127. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js.map +1 -0
  128. package/dist/node_modules/eventsource-parser/dist/index.js +104 -0
  129. package/dist/node_modules/eventsource-parser/dist/index.js.map +1 -0
  130. package/dist/node_modules/eventsource-parser/dist/stream.js +28 -0
  131. package/dist/node_modules/eventsource-parser/dist/stream.js.map +1 -0
  132. package/dist/node_modules/fast-deep-equal/index.js +56 -0
  133. package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
  134. package/dist/node_modules/fast-json-stable-stringify/index.js +69 -0
  135. package/dist/node_modules/fast-json-stable-stringify/index.js.map +1 -0
  136. package/dist/node_modules/json-schema-traverse/index.js +100 -0
  137. package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
  138. package/dist/node_modules/pkce-challenge/dist/index.browser.js +66 -0
  139. package/dist/node_modules/pkce-challenge/dist/index.browser.js.map +1 -0
  140. package/dist/node_modules/uri-js/dist/es5/uri.all.js +1418 -0
  141. package/dist/node_modules/uri-js/dist/es5/uri.all.js.map +1 -0
  142. package/dist/node_modules/zod/v3/ZodError.js +133 -0
  143. package/dist/node_modules/zod/v3/ZodError.js.map +1 -0
  144. package/dist/node_modules/zod/v3/errors.js +9 -0
  145. package/dist/node_modules/zod/v3/errors.js.map +1 -0
  146. package/dist/node_modules/zod/v3/helpers/errorUtil.js +9 -0
  147. package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  148. package/dist/node_modules/zod/v3/helpers/parseUtil.js +112 -0
  149. package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  150. package/dist/node_modules/zod/v3/helpers/util.js +136 -0
  151. package/dist/node_modules/zod/v3/helpers/util.js.map +1 -0
  152. package/dist/node_modules/zod/v3/locales/en.js +112 -0
  153. package/dist/node_modules/zod/v3/locales/en.js.map +1 -0
  154. package/dist/node_modules/zod/v3/types.js +3491 -0
  155. package/dist/node_modules/zod/v3/types.js.map +1 -0
  156. package/dist/oAuth.js +7 -6
  157. package/dist/oAuth.js.map +1 -1
  158. package/dist/solanaAccount.js +7 -4
  159. package/dist/solanaAccount.js.map +1 -1
  160. package/dist/solanaPaymentMaker.js +13 -11
  161. package/dist/solanaPaymentMaker.js.map +1 -1
  162. package/dist/types.js +5 -3
  163. package/dist/types.js.map +1 -1
  164. package/package.json +26 -10
  165. package/dist/atxpAccount.d.ts +0 -13
  166. package/dist/atxpAccount.d.ts.map +0 -1
  167. package/dist/atxpClient.d.ts +0 -14
  168. package/dist/atxpClient.d.ts.map +0 -1
  169. package/dist/atxpFetcher.d.ts +0 -72
  170. package/dist/atxpFetcher.d.ts.map +0 -1
  171. package/dist/baseAccount.d.ts +0 -10
  172. package/dist/baseAccount.d.ts.map +0 -1
  173. package/dist/basePaymentMaker.d.ts +0 -16
  174. package/dist/basePaymentMaker.d.ts.map +0 -1
  175. package/dist/clientTestHelpers.d.ts +0 -6
  176. package/dist/clientTestHelpers.d.ts.map +0 -1
  177. package/dist/clientTestHelpers.js +0 -94
  178. package/dist/clientTestHelpers.js.map +0 -1
  179. package/dist/index.d.ts.map +0 -1
  180. package/dist/oAuth.d.ts +0 -44
  181. package/dist/oAuth.d.ts.map +0 -1
  182. package/dist/setup.expo.d.ts +0 -2
  183. package/dist/setup.expo.d.ts.map +0 -1
  184. package/dist/setup.expo.js +0 -30
  185. package/dist/setup.expo.js.map +0 -1
  186. package/dist/solanaAccount.d.ts +0 -9
  187. package/dist/solanaAccount.d.ts.map +0 -1
  188. package/dist/solanaPaymentMaker.d.ts +0 -18
  189. package/dist/solanaPaymentMaker.d.ts.map +0 -1
  190. package/dist/types.d.ts +0 -70
  191. package/dist/types.d.ts.map +0 -1
@@ -0,0 +1,134 @@
1
+ var ref;
2
+ var hasRequiredRef;
3
+
4
+ function requireRef () {
5
+ if (hasRequiredRef) return ref;
6
+ hasRequiredRef = 1;
7
+ ref = function generate_ref(it, $keyword, $ruleType) {
8
+ var out = ' ';
9
+ var $lvl = it.level;
10
+ var $dataLvl = it.dataLevel;
11
+ var $schema = it.schema[$keyword];
12
+ var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
13
+ var $breakOnError = !it.opts.allErrors;
14
+ var $data = 'data' + ($dataLvl || '');
15
+ var $valid = 'valid' + $lvl;
16
+ var $async, $refCode;
17
+ if ($schema == '#' || $schema == '#/') {
18
+ if (it.isRoot) {
19
+ $async = it.async;
20
+ $refCode = 'validate';
21
+ } else {
22
+ $async = it.root.schema.$async === true;
23
+ $refCode = 'root.refVal[0]';
24
+ }
25
+ } else {
26
+ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
27
+ if ($refVal === undefined) {
28
+ var $message = it.MissingRefError.message(it.baseId, $schema);
29
+ if (it.opts.missingRefs == 'fail') {
30
+ it.logger.error($message);
31
+ var $$outStack = $$outStack || [];
32
+ $$outStack.push(out);
33
+ out = ''; /* istanbul ignore else */
34
+ if (it.createErrors !== false) {
35
+ out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
36
+ if (it.opts.messages !== false) {
37
+ out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
38
+ }
39
+ if (it.opts.verbose) {
40
+ out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
41
+ }
42
+ out += ' } ';
43
+ } else {
44
+ out += ' {} ';
45
+ }
46
+ var __err = out;
47
+ out = $$outStack.pop();
48
+ if (!it.compositeRule && $breakOnError) {
49
+ /* istanbul ignore if */
50
+ if (it.async) {
51
+ out += ' throw new ValidationError([' + (__err) + ']); ';
52
+ } else {
53
+ out += ' validate.errors = [' + (__err) + ']; return false; ';
54
+ }
55
+ } else {
56
+ out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
57
+ }
58
+ if ($breakOnError) {
59
+ out += ' if (false) { ';
60
+ }
61
+ } else if (it.opts.missingRefs == 'ignore') {
62
+ it.logger.warn($message);
63
+ if ($breakOnError) {
64
+ out += ' if (true) { ';
65
+ }
66
+ } else {
67
+ throw new it.MissingRefError(it.baseId, $schema, $message);
68
+ }
69
+ } else if ($refVal.inline) {
70
+ var $it = it.util.copy(it);
71
+ $it.level++;
72
+ var $nextValid = 'valid' + $it.level;
73
+ $it.schema = $refVal.schema;
74
+ $it.schemaPath = '';
75
+ $it.errSchemaPath = $schema;
76
+ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
77
+ out += ' ' + ($code) + ' ';
78
+ if ($breakOnError) {
79
+ out += ' if (' + ($nextValid) + ') { ';
80
+ }
81
+ } else {
82
+ $async = $refVal.$async === true || (it.async && $refVal.$async !== false);
83
+ $refCode = $refVal.code;
84
+ }
85
+ }
86
+ if ($refCode) {
87
+ var $$outStack = $$outStack || [];
88
+ $$outStack.push(out);
89
+ out = '';
90
+ if (it.opts.passContext) {
91
+ out += ' ' + ($refCode) + '.call(this, ';
92
+ } else {
93
+ out += ' ' + ($refCode) + '( ';
94
+ }
95
+ out += ' ' + ($data) + ', (dataPath || \'\')';
96
+ if (it.errorPath != '""') {
97
+ out += ' + ' + (it.errorPath);
98
+ }
99
+ var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
100
+ $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
101
+ out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';
102
+ var __callValidate = out;
103
+ out = $$outStack.pop();
104
+ if ($async) {
105
+ if (!it.async) throw new Error('async schema referenced by sync schema');
106
+ if ($breakOnError) {
107
+ out += ' var ' + ($valid) + '; ';
108
+ }
109
+ out += ' try { await ' + (__callValidate) + '; ';
110
+ if ($breakOnError) {
111
+ out += ' ' + ($valid) + ' = true; ';
112
+ }
113
+ out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
114
+ if ($breakOnError) {
115
+ out += ' ' + ($valid) + ' = false; ';
116
+ }
117
+ out += ' } ';
118
+ if ($breakOnError) {
119
+ out += ' if (' + ($valid) + ') { ';
120
+ }
121
+ } else {
122
+ out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
123
+ if ($breakOnError) {
124
+ out += ' else { ';
125
+ }
126
+ }
127
+ }
128
+ return out;
129
+ };
130
+ return ref;
131
+ }
132
+
133
+ export { requireRef as __require };
134
+ //# sourceMappingURL=ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref.js","sources":["../../../../../../../node_modules/ajv/lib/dotjs/ref.js"],"sourcesContent":["'use strict';\nmodule.exports = function generate_ref(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $async, $refCode;\n if ($schema == '#' || $schema == '#/') {\n if (it.isRoot) {\n $async = it.async;\n $refCode = 'validate';\n } else {\n $async = it.root.schema.$async === true;\n $refCode = 'root.refVal[0]';\n }\n } else {\n var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);\n if ($refVal === undefined) {\n var $message = it.MissingRefError.message(it.baseId, $schema);\n if (it.opts.missingRefs == 'fail') {\n it.logger.error($message);\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('$ref') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \\'' + (it.util.escapeQuotes($schema)) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'can\\\\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n } else if (it.opts.missingRefs == 'ignore') {\n it.logger.warn($message);\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n throw new it.MissingRefError(it.baseId, $schema, $message);\n }\n } else if ($refVal.inline) {\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $refVal.schema;\n $it.schemaPath = '';\n $it.errSchemaPath = $schema;\n var $code = it.validate($it).replace(/validate\\.schema/g, $refVal.code);\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n }\n } else {\n $async = $refVal.$async === true || (it.async && $refVal.$async !== false);\n $refCode = $refVal.code;\n }\n }\n if ($refCode) {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n if (it.opts.passContext) {\n out += ' ' + ($refCode) + '.call(this, ';\n } else {\n out += ' ' + ($refCode) + '( ';\n }\n out += ' ' + ($data) + ', (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';\n var __callValidate = out;\n out = $$outStack.pop();\n if ($async) {\n if (!it.async) throw new Error('async schema referenced by sync schema');\n if ($breakOnError) {\n out += ' var ' + ($valid) + '; ';\n }\n out += ' try { await ' + (__callValidate) + '; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = true; ';\n }\n out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';\n if ($breakOnError) {\n out += ' ' + ($valid) + ' = false; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($valid) + ') { ';\n }\n } else {\n out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n }\n }\n return out;\n}\n"],"names":[],"mappings":";;;;;;AACA,CAAA,GAAc,GAAG,SAAS,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;GAC9D,IAAI,GAAG,GAAG,GAAG;AACf,GAAE,IAAI,I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AChD,IAAI,aAAa,EAAE;AACzB,SAAQ,GAAG,IAAI,GAAG,IAAI,MAAM,CAAC,GAAG,WAAW;AAC3C,OAAA;OACM,GAAG,IAAI,2KAA2K;OAClL,IAAI,aAAa,EAAE;AACzB,SAAQ,GAAG,IAAI,GAAG,IAAI,MAAM,CAAC,GAAG,YAAY;AAC5C,OAAA;OACM,GAAG,IAAI,KAAK;OACZ,IAAI,aAAa,EAAE;AACzB,SAAQ,GAAG,IAAI,OAAO,IAAI,MAAM,CAAC,GAAG,MAAM;AAC1C,OAAA;AACA,KAAA,CAAK,MAAM;AACX,OAAM,GAAG,IAAI,QAAQ,IAAI,cAAc,CAAC,GAAG,sCAAsC,IAAI,QAAQ,CAAC,GAAG,yCAAyC,IAAI,QAAQ,CAAC,GAAG,uCAAuC;OAC3L,IAAI,aAAa,EAAE;SACjB,GAAG,IAAI,UAAU;AACzB,OAAA;AACA,KAAA;AACA,GAAA;AACA,GAAE,OAAO,GAAG;AACZ,CAAA;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,276 @@
1
+ var required;
2
+ var hasRequiredRequired;
3
+
4
+ function requireRequired () {
5
+ if (hasRequiredRequired) return required;
6
+ hasRequiredRequired = 1;
7
+ required = function generate_required(it, $keyword, $ruleType) {
8
+ var out = ' ';
9
+ var $lvl = it.level;
10
+ var $dataLvl = it.dataLevel;
11
+ var $schema = it.schema[$keyword];
12
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
13
+ var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
14
+ var $breakOnError = !it.opts.allErrors;
15
+ var $data = 'data' + ($dataLvl || '');
16
+ var $valid = 'valid' + $lvl;
17
+ var $isData = it.opts.$data && $schema && $schema.$data;
18
+ if ($isData) {
19
+ out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
20
+ }
21
+ var $vSchema = 'schema' + $lvl;
22
+ if (!$isData) {
23
+ if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
24
+ var $required = [];
25
+ var arr1 = $schema;
26
+ if (arr1) {
27
+ var $property, i1 = -1,
28
+ l1 = arr1.length - 1;
29
+ while (i1 < l1) {
30
+ $property = arr1[i1 += 1];
31
+ var $propertySch = it.schema.properties[$property];
32
+ if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
33
+ $required[$required.length] = $property;
34
+ }
35
+ }
36
+ }
37
+ } else {
38
+ var $required = $schema;
39
+ }
40
+ }
41
+ if ($isData || $required.length) {
42
+ var $currentErrorPath = it.errorPath,
43
+ $loopRequired = $isData || $required.length >= it.opts.loopRequired,
44
+ $ownProperties = it.opts.ownProperties;
45
+ if ($breakOnError) {
46
+ out += ' var missing' + ($lvl) + '; ';
47
+ if ($loopRequired) {
48
+ if (!$isData) {
49
+ out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
50
+ }
51
+ var $i = 'i' + $lvl,
52
+ $propertyPath = 'schema' + $lvl + '[' + $i + ']',
53
+ $missingProperty = '\' + ' + $propertyPath + ' + \'';
54
+ if (it.opts._errorDataPathProperty) {
55
+ it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
56
+ }
57
+ out += ' var ' + ($valid) + ' = true; ';
58
+ if ($isData) {
59
+ out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
60
+ }
61
+ out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
62
+ if ($ownProperties) {
63
+ out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
64
+ }
65
+ out += '; if (!' + ($valid) + ') break; } ';
66
+ if ($isData) {
67
+ out += ' } ';
68
+ }
69
+ out += ' if (!' + ($valid) + ') { ';
70
+ var $$outStack = $$outStack || [];
71
+ $$outStack.push(out);
72
+ out = ''; /* istanbul ignore else */
73
+ if (it.createErrors !== false) {
74
+ out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
75
+ if (it.opts.messages !== false) {
76
+ out += ' , message: \'';
77
+ if (it.opts._errorDataPathProperty) {
78
+ out += 'is a required property';
79
+ } else {
80
+ out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
81
+ }
82
+ out += '\' ';
83
+ }
84
+ if (it.opts.verbose) {
85
+ out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
86
+ }
87
+ out += ' } ';
88
+ } else {
89
+ out += ' {} ';
90
+ }
91
+ var __err = out;
92
+ out = $$outStack.pop();
93
+ if (!it.compositeRule && $breakOnError) {
94
+ /* istanbul ignore if */
95
+ if (it.async) {
96
+ out += ' throw new ValidationError([' + (__err) + ']); ';
97
+ } else {
98
+ out += ' validate.errors = [' + (__err) + ']; return false; ';
99
+ }
100
+ } else {
101
+ out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
102
+ }
103
+ out += ' } else { ';
104
+ } else {
105
+ out += ' if ( ';
106
+ var arr2 = $required;
107
+ if (arr2) {
108
+ var $propertyKey, $i = -1,
109
+ l2 = arr2.length - 1;
110
+ while ($i < l2) {
111
+ $propertyKey = arr2[$i += 1];
112
+ if ($i) {
113
+ out += ' || ';
114
+ }
115
+ var $prop = it.util.getProperty($propertyKey),
116
+ $useData = $data + $prop;
117
+ out += ' ( ( ' + ($useData) + ' === undefined ';
118
+ if ($ownProperties) {
119
+ out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
120
+ }
121
+ out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
122
+ }
123
+ }
124
+ out += ') { ';
125
+ var $propertyPath = 'missing' + $lvl,
126
+ $missingProperty = '\' + ' + $propertyPath + ' + \'';
127
+ if (it.opts._errorDataPathProperty) {
128
+ it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
129
+ }
130
+ var $$outStack = $$outStack || [];
131
+ $$outStack.push(out);
132
+ out = ''; /* istanbul ignore else */
133
+ if (it.createErrors !== false) {
134
+ out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
135
+ if (it.opts.messages !== false) {
136
+ out += ' , message: \'';
137
+ if (it.opts._errorDataPathProperty) {
138
+ out += 'is a required property';
139
+ } else {
140
+ out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
141
+ }
142
+ out += '\' ';
143
+ }
144
+ if (it.opts.verbose) {
145
+ out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
146
+ }
147
+ out += ' } ';
148
+ } else {
149
+ out += ' {} ';
150
+ }
151
+ var __err = out;
152
+ out = $$outStack.pop();
153
+ if (!it.compositeRule && $breakOnError) {
154
+ /* istanbul ignore if */
155
+ if (it.async) {
156
+ out += ' throw new ValidationError([' + (__err) + ']); ';
157
+ } else {
158
+ out += ' validate.errors = [' + (__err) + ']; return false; ';
159
+ }
160
+ } else {
161
+ out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
162
+ }
163
+ out += ' } else { ';
164
+ }
165
+ } else {
166
+ if ($loopRequired) {
167
+ if (!$isData) {
168
+ out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
169
+ }
170
+ var $i = 'i' + $lvl,
171
+ $propertyPath = 'schema' + $lvl + '[' + $i + ']',
172
+ $missingProperty = '\' + ' + $propertyPath + ' + \'';
173
+ if (it.opts._errorDataPathProperty) {
174
+ it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
175
+ }
176
+ if ($isData) {
177
+ out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */
178
+ if (it.createErrors !== false) {
179
+ out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
180
+ if (it.opts.messages !== false) {
181
+ out += ' , message: \'';
182
+ if (it.opts._errorDataPathProperty) {
183
+ out += 'is a required property';
184
+ } else {
185
+ out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
186
+ }
187
+ out += '\' ';
188
+ }
189
+ if (it.opts.verbose) {
190
+ out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
191
+ }
192
+ out += ' } ';
193
+ } else {
194
+ out += ' {} ';
195
+ }
196
+ out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
197
+ }
198
+ out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
199
+ if ($ownProperties) {
200
+ out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
201
+ }
202
+ out += ') { var err = '; /* istanbul ignore else */
203
+ if (it.createErrors !== false) {
204
+ out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
205
+ if (it.opts.messages !== false) {
206
+ out += ' , message: \'';
207
+ if (it.opts._errorDataPathProperty) {
208
+ out += 'is a required property';
209
+ } else {
210
+ out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
211
+ }
212
+ out += '\' ';
213
+ }
214
+ if (it.opts.verbose) {
215
+ out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
216
+ }
217
+ out += ' } ';
218
+ } else {
219
+ out += ' {} ';
220
+ }
221
+ out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
222
+ if ($isData) {
223
+ out += ' } ';
224
+ }
225
+ } else {
226
+ var arr3 = $required;
227
+ if (arr3) {
228
+ var $propertyKey, i3 = -1,
229
+ l3 = arr3.length - 1;
230
+ while (i3 < l3) {
231
+ $propertyKey = arr3[i3 += 1];
232
+ var $prop = it.util.getProperty($propertyKey),
233
+ $missingProperty = it.util.escapeQuotes($propertyKey),
234
+ $useData = $data + $prop;
235
+ if (it.opts._errorDataPathProperty) {
236
+ it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
237
+ }
238
+ out += ' if ( ' + ($useData) + ' === undefined ';
239
+ if ($ownProperties) {
240
+ out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
241
+ }
242
+ out += ') { var err = '; /* istanbul ignore else */
243
+ if (it.createErrors !== false) {
244
+ out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
245
+ if (it.opts.messages !== false) {
246
+ out += ' , message: \'';
247
+ if (it.opts._errorDataPathProperty) {
248
+ out += 'is a required property';
249
+ } else {
250
+ out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
251
+ }
252
+ out += '\' ';
253
+ }
254
+ if (it.opts.verbose) {
255
+ out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
256
+ }
257
+ out += ' } ';
258
+ } else {
259
+ out += ' {} ';
260
+ }
261
+ out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
262
+ }
263
+ }
264
+ }
265
+ }
266
+ it.errorPath = $currentErrorPath;
267
+ } else if ($breakOnError) {
268
+ out += ' if (true) {';
269
+ }
270
+ return out;
271
+ };
272
+ return required;
273
+ }
274
+
275
+ export { requireRequired as __require };
276
+ //# sourceMappingURL=required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required.js","sources":["../../../../../../../node_modules/ajv/lib/dotjs/required.js"],"sourcesContent":["'use strict';\nmodule.exports = function generate_required(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $vSchema = 'schema' + $lvl;\n if (!$isData) {\n if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {\n var $required = [];\n var arr1 = $schema;\n if (arr1) {\n var $property, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $property = arr1[i1 += 1];\n var $propertySch = it.schema.properties[$property];\n if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {\n $required[$required.length] = $property;\n }\n }\n }\n } else {\n var $required = $schema;\n }\n }\n if ($isData || $required.length) {\n var $currentErrorPath = it.errorPath,\n $loopRequired = $isData || $required.length >= it.opts.loopRequired,\n $ownProperties = it.opts.ownProperties;\n if ($breakOnError) {\n out += ' var missing' + ($lvl) + '; ';\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n out += ' var ' + ($valid) + ' = true; ';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += '; if (!' + ($valid) + ') break; } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n } else {\n out += ' if ( ';\n var arr2 = $required;\n if (arr2) {\n var $propertyKey, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $propertyKey = arr2[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ') { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n }\n } else {\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n if ($isData) {\n out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';\n if ($isData) {\n out += ' } ';\n }\n } else {\n var arr3 = $required;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n }\n it.errorPath = $currentErrorPath;\n } else if ($breakOnError) {\n out += ' if (true) {';\n }\n return out;\n}\n"],"names":[],"mappings":";;;;;;AACA,CAAA,QAAc,GAAG,SAAS,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;GACnE,IAAI,GAAG,GAAG,GAAG;AACf,GAAE,IAAI,IAAI,GAAG,EAAE,CAAC,KAAK;AACrB,GAAE,IAAI,QAAQ,GAAG,EAAE,CAAC,SAAS;GAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;AACnC,GAAE,IAAI,WAAW,GAAG,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW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4BAA4B,IAAI,WAAW,CAAC,GAAG,kCAAkC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,WAAW,IAAI,KAAK,CAAC,GAAG,GAAG;AACxJ,eAAA;eACc,GAAG,IAAI,KAAK;AAC1B,aAAA,CAAa,MAAM;eACL,GAAG,IAAI,MAAM;AAC3B,aAAA;aACY,GAAG,IAAI,gFAAgF;AACnG,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,KAAI,EAAE,CAAC,SAAS,GAAG,iBAAiB;GACpC,CAAG,MAAM,IAAI,aAAa,EAAE;KACxB,GAAG,IAAI,cAAc;AACzB,GAAA;AACA,GAAE,OAAO,GAAG;AACZ,CAAA;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,96 @@
1
+ var uniqueItems;
2
+ var hasRequiredUniqueItems;
3
+
4
+ function requireUniqueItems () {
5
+ if (hasRequiredUniqueItems) return uniqueItems;
6
+ hasRequiredUniqueItems = 1;
7
+ uniqueItems = function generate_uniqueItems(it, $keyword, $ruleType) {
8
+ var out = ' ';
9
+ var $lvl = it.level;
10
+ var $dataLvl = it.dataLevel;
11
+ var $schema = it.schema[$keyword];
12
+ var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
13
+ var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
14
+ var $breakOnError = !it.opts.allErrors;
15
+ var $data = 'data' + ($dataLvl || '');
16
+ var $valid = 'valid' + $lvl;
17
+ var $isData = it.opts.$data && $schema && $schema.$data,
18
+ $schemaValue;
19
+ if ($isData) {
20
+ out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
21
+ $schemaValue = 'schema' + $lvl;
22
+ } else {
23
+ $schemaValue = $schema;
24
+ }
25
+ if (($schema || $isData) && it.opts.uniqueItems !== false) {
26
+ if ($isData) {
27
+ out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
28
+ }
29
+ out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';
30
+ var $itemType = it.schema.items && it.schema.items.type,
31
+ $typeIsArray = Array.isArray($itemType);
32
+ if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {
33
+ out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';
34
+ } else {
35
+ out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
36
+ var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
37
+ out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
38
+ if ($typeIsArray) {
39
+ out += ' if (typeof item == \'string\') item = \'"\' + item; ';
40
+ }
41
+ out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';
42
+ }
43
+ out += ' } ';
44
+ if ($isData) {
45
+ out += ' } ';
46
+ }
47
+ out += ' if (!' + ($valid) + ') { ';
48
+ var $$outStack = $$outStack || [];
49
+ $$outStack.push(out);
50
+ out = ''; /* istanbul ignore else */
51
+ if (it.createErrors !== false) {
52
+ out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
53
+ if (it.opts.messages !== false) {
54
+ out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
55
+ }
56
+ if (it.opts.verbose) {
57
+ out += ' , schema: ';
58
+ if ($isData) {
59
+ out += 'validate.schema' + ($schemaPath);
60
+ } else {
61
+ out += '' + ($schema);
62
+ }
63
+ out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
64
+ }
65
+ out += ' } ';
66
+ } else {
67
+ out += ' {} ';
68
+ }
69
+ var __err = out;
70
+ out = $$outStack.pop();
71
+ if (!it.compositeRule && $breakOnError) {
72
+ /* istanbul ignore if */
73
+ if (it.async) {
74
+ out += ' throw new ValidationError([' + (__err) + ']); ';
75
+ } else {
76
+ out += ' validate.errors = [' + (__err) + ']; return false; ';
77
+ }
78
+ } else {
79
+ out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
80
+ }
81
+ out += ' } ';
82
+ if ($breakOnError) {
83
+ out += ' else { ';
84
+ }
85
+ } else {
86
+ if ($breakOnError) {
87
+ out += ' if (true) { ';
88
+ }
89
+ }
90
+ return out;
91
+ };
92
+ return uniqueItems;
93
+ }
94
+
95
+ export { requireUniqueItems as __require };
96
+ //# sourceMappingURL=uniqueItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniqueItems.js","sources":["../../../../../../../node_modules/ajv/lib/dotjs/uniqueItems.js"],"sourcesContent":["'use strict';\nmodule.exports = function generate_uniqueItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (($schema || $isData) && it.opts.uniqueItems !== false) {\n if ($isData) {\n out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'boolean\\') ' + ($valid) + ' = false; else { ';\n }\n out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';\n var $itemType = it.schema.items && it.schema.items.type,\n $typeIsArray = Array.isArray($itemType);\n if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {\n out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';\n } else {\n out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';\n var $method = 'checkDataType' + ($typeIsArray ? 's' : '');\n out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';\n if ($typeIsArray) {\n out += ' if (typeof item == \\'string\\') item = \\'\"\\' + item; ';\n }\n out += ' if (typeof itemIndices[item] == \\'number\\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';\n }\n out += ' } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('uniqueItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have duplicate items (items ## \\' + j + \\' and \\' + i + \\' are identical)\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n"],"names":[],"mappings":";;;;;;AACA,CAAA,WAAc,GAAG,SAAS,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;GACtE,IAAI,GAAG,GAAG,GAAG;AACf,GAAE,IAAI,IAAI,GAAG,EAAE,CAAC,KAAK;AACrB,GAAE,IAAI,QAAQ,GAAG,EAAE,CAAC,SAAS;GAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;AACnC,GAAE,IAAI,WAAW,GAAG,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;GAC/D,IAAI,cAAc,GAAG,EAAE,CAAC,aAAa,GAAG,GAAG,GAAG,QAAQ;GACtD,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS;GACtC,IAAI,KAAK,GAAG,MAAM,IAAI,QAAQ,IAAI,EAAE,CAAC;AACvC,GAAE,IAAI,MAAM,GAAG,OAAO,GAAG,IAAI;AAC7B,GAAE,IAAI,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK;AACzD,KAAI,YAAY;GACd,IAAI,OAAO,EAAE;KACX,GAAG,IAAI,aAAa,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,C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