@ismael1361/router 1.0.6 → 1.0.8
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/Middlewares.d.ts +18 -1
- package/dist/Middlewares.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/router.d.ts +1 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/swagger-markdown/index.d.ts +10 -0
- package/dist/swagger-markdown/index.d.ts.map +1 -0
- package/dist/swagger-markdown/lib/anchor.d.ts +6 -0
- package/dist/swagger-markdown/lib/anchor.d.ts.map +1 -0
- package/dist/swagger-markdown/lib/inArray.d.ts +9 -0
- package/dist/swagger-markdown/lib/inArray.d.ts.map +1 -0
- package/dist/swagger-markdown/models/schema.d.ts +28 -0
- package/dist/swagger-markdown/models/schema.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/contact.d.ts +8 -0
- package/dist/swagger-markdown/transformers/contact.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/dataTypes.d.ts +9 -0
- package/dist/swagger-markdown/transformers/dataTypes.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/definitions.d.ts +14 -0
- package/dist/swagger-markdown/transformers/definitions.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/externalDocs.d.ts +4 -0
- package/dist/swagger-markdown/transformers/externalDocs.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/info.d.ts +11 -0
- package/dist/swagger-markdown/transformers/info.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/license.d.ts +8 -0
- package/dist/swagger-markdown/transformers/license.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/path.d.ts +9 -0
- package/dist/swagger-markdown/transformers/path.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/pathParameters.d.ts +4 -0
- package/dist/swagger-markdown/transformers/pathParameters.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/pathResponses.d.ts +9 -0
- package/dist/swagger-markdown/transformers/pathResponses.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/security.d.ts +4 -0
- package/dist/swagger-markdown/transformers/security.d.ts.map +1 -0
- package/dist/swagger-markdown/transformers/securityDefinitions.d.ts +6 -0
- package/dist/swagger-markdown/transformers/securityDefinitions.d.ts.map +1 -0
- package/dist/type.d.ts +34 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +3 -2
- package/resources/markdown-style.css +298 -0
- package/resources/openapisnippet.min.js +1500 -0
|
@@ -0,0 +1,1500 @@
|
|
|
1
|
+
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
+
"use strict";const OpenAPIToHar=require("./openapi-to-har.js"),HTTPSnippet=require("httpsnippet"),getEndpointSnippets=function(e,t,n,i,r){void 0===r&&(r={});const o=OpenAPIToHar.getEndpoint(e,t,n,r),p=[];for(const e of o){const t=new HTTPSnippet(e);p.push(...getSnippetsForTargets(i,t,e.comment?e.comment:void 0))}return{method:o[0].method,url:o[0].url,description:o[0].description,resource:getResourceName(o[0].url),snippets:p}},getSnippets=function(e,t){const n=OpenAPIToHar.getAll(e),i=[];for(let e in n){const r=n[e],o=[];for(const e of r.hars){const n=new HTTPSnippet(e);o.push(...getSnippetsForTargets(t,n,e.comment))}i.push({method:r.method,url:r.url,description:r.description,resource:getResourceName(r.url),snippets:o})}return i.sort((e,t)=>e.resource<t.resource?-1:e.resource>t.resource?1:getMethodOrder(e.method.toLowerCase(),t.method.toLowerCase())),i},getMethodOrder=function(e,t){const n=["get","post","put","delete","patch"];return-1===n.indexOf(e)?1:-1===n.indexOf(t)?-1:n.indexOf(e)<n.indexOf(t)?-1:n.indexOf(e)>n.indexOf(t)?1:0},getResourceName=function(e){const t=e.split("/");for(let e=t.length-1;e>=0;e--){const n=t[e];if(""!==n&&!/^{/.test(n))return n}},formatTarget=function(e){const t=e.split("_")[0],n=capitalizeFirstLetter(t);let i=e.split("_")[1];const r=HTTPSnippet.availableTargets();let o=!1,p=!1;for(let e in r){const n=r[e];if(t===n.key)if(o=!0,void 0===i)i=n.default,p=!0;else for(let e in n.clients){if(i===n.clients[e].key){p=!0;break}}}return o&&p?{title:void 0!==i?n+" + "+capitalizeFirstLetter(i):n,language:t,library:i}:null},getSnippetsForTargets=function(e,t,n){const i=[];for(let r in e){const o=formatTarget(e[r]);if(!o)throw new Error("Invalid target: "+e[r]);i.push({id:e[r],...void 0!==n&&{mimeType:n},title:o.title,content:t.convert(o.language,void 0!==o.library?o.library:null)})}return i},capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};if(module.exports={getSnippets:getSnippets,getEndpointSnippets:getEndpointSnippets},"undefined"!=typeof window){let e=window.OpenAPISnippets||{};e={getSnippets:getSnippets,getEndpointSnippets:getEndpointSnippets},window.OpenAPISnippets=e}
|
|
3
|
+
|
|
4
|
+
},{"./openapi-to-har.js":192,"httpsnippet":86}],2:[function(require,module,exports){
|
|
5
|
+
"use strict";var compileSchema=require("./compile"),resolve=require("./compile/resolve"),Cache=require("./cache"),SchemaObject=require("./compile/schema_obj"),stableStringify=require("fast-json-stable-stringify"),formats=require("./compile/formats"),rules=require("./compile/rules"),$dataMetaSchema=require("./data"),util=require("./compile/util");module.exports=Ajv,Ajv.prototype.validate=validate,Ajv.prototype.compile=compile,Ajv.prototype.addSchema=addSchema,Ajv.prototype.addMetaSchema=addMetaSchema,Ajv.prototype.validateSchema=validateSchema,Ajv.prototype.getSchema=getSchema,Ajv.prototype.removeSchema=removeSchema,Ajv.prototype.addFormat=addFormat,Ajv.prototype.errorsText=errorsText,Ajv.prototype._addSchema=_addSchema,Ajv.prototype._compile=_compile,Ajv.prototype.compileAsync=require("./compile/async");var customKeyword=require("./keyword");Ajv.prototype.addKeyword=customKeyword.add,Ajv.prototype.getKeyword=customKeyword.get,Ajv.prototype.removeKeyword=customKeyword.remove,Ajv.prototype.validateKeyword=customKeyword.validate;var errorClasses=require("./compile/error_classes");Ajv.ValidationError=errorClasses.Validation,Ajv.MissingRefError=errorClasses.MissingRef,Ajv.$dataMetaSchema=$dataMetaSchema;var META_SCHEMA_ID="http://json-schema.org/draft-07/schema",META_IGNORE_OPTIONS=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],META_SUPPORT_DATA=["/properties"];function Ajv(e){if(!(this instanceof Ajv))return new Ajv(e);e=this._opts=util.copy(e)||{},setLogger(this),this._schemas={},this._refs={},this._fragments={},this._formats=formats(e.format),this._cache=e.cache||new Cache,this._loadingSchemas={},this._compilations=[],this.RULES=rules(),this._getId=chooseGetId(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=stableStringify),this._metaOpts=getMetaSchemaOptions(this),e.formats&&addInitialFormats(this),e.keywords&&addInitialKeywords(this),addDefaultMetaSchema(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),addInitialSchemas(this)}function validate(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var o=r(t);return!0!==r.$async&&(this.errors=r.errors),o}function compile(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)}function addSchema(e,t,r,a){if(Array.isArray(e)){for(var o=0;o<e.length;o++)this.addSchema(e[o],void 0,r,a);return this}var s=this._getId(e);if(void 0!==s&&"string"!=typeof s)throw new Error("schema id must be string");return checkUnique(this,t=resolve.normalizeId(t||s)),this._schemas[t]=this._addSchema(e,r,a,!0),this}function addMetaSchema(e,t,r){return this.addSchema(e,t,r,!0),this}function validateSchema(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(!(r=r||this._opts.defaultMeta||defaultMeta(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var a=this.validate(r,e);if(!a&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return a}function defaultMeta(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(META_SCHEMA_ID)?META_SCHEMA_ID:void 0,e._opts.defaultMeta}function getSchema(e){var t=_getSchemaObj(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return _getSchemaFragment(this,e)}}function _getSchemaFragment(e,t){var r=resolve.schema.call(e,{schema:{}},t);if(r){var a=r.schema,o=r.root,s=r.baseId,i=compileSchema.call(e,a,o,void 0,s);return e._fragments[t]=new SchemaObject({ref:t,fragment:!0,schema:a,root:o,baseId:s,validate:i}),i}}function _getSchemaObj(e,t){return t=resolve.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function removeSchema(e){if(e instanceof RegExp)return _removeAllSchemas(this,this._schemas,e),_removeAllSchemas(this,this._refs,e),this;switch(typeof e){case"undefined":return _removeAllSchemas(this,this._schemas),_removeAllSchemas(this,this._refs),this._cache.clear(),this;case"string":var t=_getSchemaObj(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,a=r?r(e):e;this._cache.del(a);var o=this._getId(e);o&&(o=resolve.normalizeId(o),delete this._schemas[o],delete this._refs[o])}return this}function _removeAllSchemas(e,t,r){for(var a in t){var o=t[a];o.meta||r&&!r.test(a)||(e._cache.del(o.cacheKey),delete t[a])}}function _addSchema(e,t,r,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var o=this._opts.serialize,s=o?o(e):e,i=this._cache.get(s);if(i)return i;a=a||!1!==this._opts.addUsedSchema;var c=resolve.normalizeId(this._getId(e));c&&a&&checkUnique(this,c);var h,d=!1!==this._opts.validateSchema&&!t;d&&!(h=c&&c==resolve.normalizeId(e.$schema))&&this.validateSchema(e,!0);var n=resolve.ids.call(this,e),m=new SchemaObject({id:c,schema:e,localRefs:n,cacheKey:s,meta:r});return"#"!=c[0]&&a&&(this._refs[c]=m),this._cache.put(s,m),d&&h&&this.validateSchema(e,!0),m}function _compile(e,t){if(e.compiling)return e.validate=o,o.schema=e.schema,o.errors=null,o.root=t||o,!0===e.schema.$async&&(o.$async=!0),o;var r,a;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{a=compileSchema.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=a,e.refs=a.refs,e.refVal=a.refVal,e.root=a.root,a;function o(){var t=e.validate,r=t.apply(this,arguments);return o.errors=t.errors,r}}function chooseGetId(e){switch(e.schemaId){case"auto":return _get$IdOrId;case"id":return _getId;default:return _get$Id}}function _getId(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function _get$Id(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function _get$IdOrId(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function errorsText(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,a=void 0===t.dataVar?"data":t.dataVar,o="",s=0;s<e.length;s++){var i=e[s];i&&(o+=a+i.dataPath+" "+i.message+r)}return o.slice(0,-r.length)}function addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this}function addDefaultMetaSchema(e){var t;if(e._opts.$data&&(t=require("./refs/data.json"),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var r=require("./refs/json-schema-draft-07.json");e._opts.$data&&(r=$dataMetaSchema(r,META_SUPPORT_DATA)),e.addMetaSchema(r,META_SCHEMA_ID,!0),e._refs["http://json-schema.org/schema"]=META_SCHEMA_ID}}function addInitialSchemas(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}function addInitialFormats(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}function addInitialKeywords(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}function checkUnique(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function getMetaSchemaOptions(e){for(var t=util.copy(e._opts),r=0;r<META_IGNORE_OPTIONS.length;r++)delete t[META_IGNORE_OPTIONS[r]];return t}function setLogger(e){var t=e._opts.logger;if(!1===t)e.logger={log:noop,warn:noop,error:noop};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}function noop(){}
|
|
6
|
+
|
|
7
|
+
},{"./cache":3,"./compile":7,"./compile/async":4,"./compile/error_classes":5,"./compile/formats":6,"./compile/resolve":8,"./compile/rules":9,"./compile/schema_obj":10,"./compile/util":12,"./data":13,"./keyword":41,"./refs/data.json":42,"./refs/json-schema-draft-07.json":44,"fast-json-stable-stringify":56}],3:[function(require,module,exports){
|
|
8
|
+
"use strict";var Cache=module.exports=function(){this._cache={}};Cache.prototype.put=function(t,e){this._cache[t]=e},Cache.prototype.get=function(t){return this._cache[t]},Cache.prototype.del=function(t){delete this._cache[t]},Cache.prototype.clear=function(){this._cache={}};
|
|
9
|
+
|
|
10
|
+
},{}],4:[function(require,module,exports){
|
|
11
|
+
"use strict";var MissingRefError=require("./error_classes").MissingRef;function compileAsync(n,e,t){var r=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof e&&(t=e,e=void 0);var o=i(n).then(function(){var t=r._addSchema(n,void 0,e);return t.validate||function n(t){try{return r._compile(t)}catch(n){if(n instanceof MissingRefError)return function o(n){var o=n.missingSchema;if(s(o))throw new Error("Schema "+o+" is loaded but "+n.missingRef+" cannot be resolved");var c=r._loadingSchemas[o];c||(c=r._loadingSchemas[o]=r._opts.loadSchema(o)).then(a,a);return c.then(function(n){if(!s(o))return i(n).then(function(){s(o)||r.addSchema(n,o,void 0,e)})}).then(function(){return function n(t){try{return r._compile(t)}catch(n){if(n instanceof MissingRefError)return o(n);throw n}function o(o){var c=o.missingSchema;if(h(c))throw new Error("Schema "+c+" is loaded but "+o.missingRef+" cannot be resolved");var a=r._loadingSchemas[c];return a||(a=r._loadingSchemas[c]=r._opts.loadSchema(c)).then(s,s),a.then(function(n){if(!h(c))return i(n).then(function(){h(c)||r.addSchema(n,c,void 0,e)})}).then(function(){return n(t)});function s(){delete r._loadingSchemas[c]}function h(n){return r._refs[n]||r._schemas[n]}}}(t)});function a(){delete r._loadingSchemas[o]}function s(n){return r._refs[n]||r._schemas[n]}}(n);throw n}function o(o){var c=o.missingSchema;if(h(c))throw new Error("Schema "+c+" is loaded but "+o.missingRef+" cannot be resolved");var a=r._loadingSchemas[c];return a||(a=r._loadingSchemas[c]=r._opts.loadSchema(c)).then(s,s),a.then(function(n){if(!h(c))return i(n).then(function(){h(c)||r.addSchema(n,c,void 0,e)})}).then(function(){return n(t)});function s(){delete r._loadingSchemas[c]}function h(n){return r._refs[n]||r._schemas[n]}}}(t)});return t&&o.then(function(n){t(null,n)},t),o;function i(n){var e=n.$schema;return e&&!r.getSchema(e)?compileAsync.call(r,{$ref:e},!0):Promise.resolve()}}module.exports=compileAsync;
|
|
12
|
+
|
|
13
|
+
},{"./error_classes":5}],5:[function(require,module,exports){
|
|
14
|
+
"use strict";var resolve=require("./resolve");function ValidationError(r){this.message="validation failed",this.errors=r,this.ajv=this.validation=!0}function MissingRefError(r,e,s){this.message=s||MissingRefError.message(r,e),this.missingRef=resolve.url(r,e),this.missingSchema=resolve.normalizeId(resolve.fullPath(this.missingRef))}function errorSubclass(r){return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}module.exports={Validation:errorSubclass(ValidationError),MissingRef:errorSubclass(MissingRefError)},MissingRefError.message=function(r,e){return"can't resolve reference "+e+" from id "+r};
|
|
15
|
+
|
|
16
|
+
},{"./resolve":8}],6:[function(require,module,exports){
|
|
17
|
+
"use strict";var util=require("./util"),DATE=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,DAYS=[0,31,28,31,30,31,30,31,31,30,31,30,31],TIME=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,HOSTNAME=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,URI=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,URIREF=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,URITEMPLATE=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,URL=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,UUID=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,JSON_POINTER=/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function formats(a){return a="full"==a?"full":"fast",util.copy(formats[a])}function isLeapYear(a){return a%4==0&&(a%100!=0||a%400==0)}function date(a){var d=a.match(DATE);if(!d)return!1;var F=+d[1],u=+d[2],f=+d[3];return u>=1&&u<=12&&f>=1&&f<=(2==u&&isLeapYear(F)?29:DAYS[u])}function time(a,d){var F=a.match(TIME);if(!F)return!1;var u=F[1],f=F[2],D=F[3],e=F[5];return(u<=23&&f<=59&&D<=59||23==u&&59==f&&60==D)&&(!d||e)}module.exports=formats,formats.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":URITEMPLATE,url:URL,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:HOSTNAME,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:UUID,"json-pointer":JSON_POINTER,"json-pointer-uri-fragment":JSON_POINTER_URI_FRAGMENT,"relative-json-pointer":RELATIVE_JSON_POINTER},formats.full={date:date,time:time,"date-time":date_time,uri:uri,"uri-reference":URIREF,"uri-template":URITEMPLATE,url:URL,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:HOSTNAME,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:UUID,"json-pointer":JSON_POINTER,"json-pointer-uri-fragment":JSON_POINTER_URI_FRAGMENT,"relative-json-pointer":RELATIVE_JSON_POINTER};var DATE_TIME_SEPARATOR=/t|\s/i;function date_time(a){var d=a.split(DATE_TIME_SEPARATOR);return 2==d.length&&date(d[0])&&time(d[1],!0)}var NOT_URI_FRAGMENT=/\/|:/;function uri(a){return NOT_URI_FRAGMENT.test(a)&&URI.test(a)}var Z_ANCHOR=/[^\\]\\Z/;function regex(a){if(Z_ANCHOR.test(a))return!1;try{return new RegExp(a),!0}catch(a){return!1}}
|
|
18
|
+
|
|
19
|
+
},{"./util":12}],7:[function(require,module,exports){
|
|
20
|
+
"use strict";var resolve=require("./resolve"),util=require("./util"),errorClasses=require("./error_classes"),stableStringify=require("fast-json-stable-stringify"),validateGenerator=require("../dotjs/validate"),ucs2length=util.ucs2length,equal=require("fast-deep-equal"),ValidationError=errorClasses.Validation;function compile(e,r,t,o){var i=this,a=this._opts,n=[void 0],l={},s=[],c={},u=[],f={},d=[];r=r||{schema:e,refVal:n,refs:l};var v=checkCompiling.call(this,e,r,o),h=this._compilations[v.index];if(v.compiling)return h.callValidate=function e(){var r=h.validate;var t=r.apply(this,arguments);e.errors=r.errors;return t};var m=this._formats,p=this.RULES;try{var g=C(e,r,t,o);h.validate=g;var y=h.callValidate;return y&&(y.schema=g.schema,y.errors=null,y.refs=g.refs,y.refVal=g.refVal,y.root=g.root,y.$async=g.$async,a.sourceCode&&(y.source=g.source)),g}finally{endCompiling.call(this,e,r,o)}function C(e,t,o,c){var f=!t||t&&t.schema==e;if(t.schema!=r.schema)return compile.call(i,e,t,o,c);var v,h=!0===e.$async,g=validateGenerator({isTop:!0,schema:e,isRoot:f,baseId:c,root:t,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:errorClasses.MissingRef,RULES:p,validate:validateGenerator,util:util,resolve:resolve,resolveRef:V,usePattern:S,useDefault:b,useCustomRule:E,opts:a,formats:m,logger:i.logger,self:i});g=vars(n,refValCode)+vars(s,patternCode)+vars(u,defaultCode)+vars(d,customRuleCode)+g,a.processCode&&(g=a.processCode(g,e));try{v=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g)(i,p,m,r,n,u,d,equal,ucs2length,ValidationError),n[0]=v}catch(e){throw i.logger.error("Error compiling schema, function code:",g),e}return v.schema=e,v.errors=null,v.refs=l,v.refVal=n,v.root=f?v:t,h&&(v.$async=!0),!0===a.sourceCode&&(v.source={code:g,patterns:s,defaults:u}),v}function V(e,o,s){o=resolve.url(e,o);var c,u,f=l[o];if(void 0!==f)return w(c=n[f],u="refVal["+f+"]");if(!s&&r.refs){var d=r.refs[o];if(void 0!==d)return w(c=r.refVal[d],u=R(o,c))}u=R(o);var v=resolve.call(i,C,r,o);if(void 0===v){var h=t&&t[o];h&&(v=resolve.inlineRef(h,a.inlineRefs)?h:compile.call(i,h,r,t,e))}if(void 0!==v)return function(e,r){var t=l[e];n[t]=r}(o,v),w(v,u);!function(e){delete l[e]}(o)}function R(e,r){var t=n.length;return n[t]=r,l[e]=t,"refVal"+t}function w(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function S(e){var r=c[e];return void 0===r&&(r=c[e]=s.length,s[r]=e),"pattern"+r}function b(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return util.toQuotedString(e);case"object":if(null===e)return"null";var r=stableStringify(e),t=f[r];return void 0===t&&(t=f[r]=u.length,u[t]=e),"default"+t}}function E(e,r,t,o){if(!1!==i._opts.validateSchema){var n=e.definition.dependencies;if(n&&!n.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+n.join(","));var l=e.definition.validateSchema;if(l)if(!l(r)){var s="keyword schema is invalid: "+i.errorsText(l.errors);if("log"!=i._opts.validateSchema)throw new Error(s);i.logger.error(s)}}var c,u=e.definition.compile,f=e.definition.inline,v=e.definition.macro;if(u)c=u.call(i,r,t,o);else if(v)c=v.call(i,r,t,o),!1!==a.validateSchema&&i.validateSchema(c,!0);else if(f)c=f.call(i,o,e.keyword,r,t);else if(!(c=e.definition.validate))return;if(void 0===c)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=d.length;return d[h]=c,{code:"customRule"+h,validate:c}}}function checkCompiling(e,r,t){var o=compIndex.call(this,e,r,t);return o>=0?{index:o,compiling:!0}:(o=this._compilations.length,this._compilations[o]={schema:e,root:r,baseId:t},{index:o,compiling:!1})}function endCompiling(e,r,t){var o=compIndex.call(this,e,r,t);o>=0&&this._compilations.splice(o,1)}function compIndex(e,r,t){for(var o=0;o<this._compilations.length;o++){var i=this._compilations[o];if(i.schema==e&&i.root==r&&i.baseId==t)return o}return-1}function patternCode(e,r){return"var pattern"+e+" = new RegExp("+util.toQuotedString(r[e])+");"}function defaultCode(e){return"var default"+e+" = defaults["+e+"];"}function refValCode(e,r){return void 0===r[e]?"":"var refVal"+e+" = refVal["+e+"];"}function customRuleCode(e){return"var customRule"+e+" = customRules["+e+"];"}function vars(e,r){if(!e.length)return"";for(var t="",o=0;o<e.length;o++)t+=r(o,e);return t}module.exports=compile;
|
|
21
|
+
|
|
22
|
+
},{"../dotjs/validate":40,"./error_classes":5,"./resolve":8,"./util":12,"fast-deep-equal":55,"fast-json-stable-stringify":56}],8:[function(require,module,exports){
|
|
23
|
+
"use strict";var URI=require("uri-js"),equal=require("fast-deep-equal"),util=require("./util"),SchemaObject=require("./schema_obj"),traverse=require("json-schema-traverse");function resolve(e,r,t){var i=this._refs[t];if("string"==typeof i){if(!this._refs[i])return resolve.call(this,e,r,i);i=this._refs[i]}if((i=i||this._schemas[t])instanceof SchemaObject)return inlineRef(i.schema,this._opts.inlineRefs)?i.schema:i.validate||this._compile(i);var s,a,n,o=resolveSchema.call(this,r,t);return o&&(s=o.schema,r=o.root,n=o.baseId),s instanceof SchemaObject?a=s.validate||e.call(this,s.schema,r,void 0,n):void 0!==s&&(a=inlineRef(s,this._opts.inlineRefs)?s:e.call(this,s,r,void 0,n)),a}function resolveSchema(e,r){var t=URI.parse(r),i=_getFullPath(t),s=getFullPath(this._getId(e.schema));if(0===Object.keys(e.schema).length||i!==s){var a=normalizeId(i),n=this._refs[a];if("string"==typeof n)return resolveRecursive.call(this,e,n,t);if(n instanceof SchemaObject)n.validate||this._compile(n),e=n;else{if(!((n=this._schemas[a])instanceof SchemaObject))return;if(n.validate||this._compile(n),a==normalizeId(r))return{schema:n,root:e,baseId:s};e=n}if(!e.schema)return;s=getFullPath(this._getId(e.schema))}return getJsonPointer.call(this,t,s,e.schema,e)}function resolveRecursive(e,r,t){var i=resolveSchema.call(this,e,r);if(i){var s=i.schema,a=i.baseId;e=i.root;var n=this._getId(s);return n&&(a=resolveUrl(a,n)),getJsonPointer.call(this,t,a,s,e)}}module.exports=resolve,resolve.normalizeId=normalizeId,resolve.fullPath=getFullPath,resolve.url=resolveUrl,resolve.ids=resolveIds,resolve.inlineRef=inlineRef,resolve.schema=resolveSchema;var PREVENT_SCOPE_CHANGE=util.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,r,t,i){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),a=1;a<s.length;a++){var n=s[a];if(n){if(void 0===(t=t[n=util.unescapeFragment(n)]))break;var o;if(!PREVENT_SCOPE_CHANGE[n]&&((o=this._getId(t))&&(r=resolveUrl(r,o)),t.$ref)){var l=resolveUrl(r,t.$ref),c=resolveSchema.call(this,i,l);c&&(t=c.schema,i=c.root,r=c.baseId)}}}return void 0!==t&&t!==i.schema?{schema:t,root:i,baseId:r}:void 0}}var SIMPLE_INLINED=util.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function inlineRef(e,r){return!1!==r&&(void 0===r||!0===r?checkNoRef(e):r?countKeys(e)<=r:void 0)}function checkNoRef(e){var r;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if("object"==typeof(r=e[t])&&!checkNoRef(r))return!1}else for(var i in e){if("$ref"==i)return!1;if("object"==typeof(r=e[i])&&!checkNoRef(r))return!1}return!0}function countKeys(e){var r,t=0;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(r=e[i])&&(t+=countKeys(r)),t==1/0)return 1/0}else for(var s in e){if("$ref"==s)return 1/0;if(SIMPLE_INLINED[s])t++;else if("object"==typeof(r=e[s])&&(t+=countKeys(r)+1),t==1/0)return 1/0}return t}function getFullPath(e,r){return!1!==r&&(e=normalizeId(e)),_getFullPath(URI.parse(e))}function _getFullPath(e){return URI.serialize(e).split("#")[0]+"#"}var TRAILING_SLASH_HASH=/#\/?$/;function normalizeId(e){return e?e.replace(TRAILING_SLASH_HASH,""):""}function resolveUrl(e,r){return r=normalizeId(r),URI.resolve(e,r)}function resolveIds(e){var r=normalizeId(this._getId(e)),t={"":r},i={"":getFullPath(r,!1)},s={},a=this;return traverse(e,{allKeys:!0},function(e,r,n,o,l,c,f){if(""!==r){var h=a._getId(e),u=t[o],m=i[o]+"/"+l;if(void 0!==f&&(m+="/"+("number"==typeof f?f:util.escapeFragment(f))),"string"==typeof h){h=u=normalizeId(u?URI.resolve(u,h):h);var v=a._refs[h];if("string"==typeof v&&(v=a._refs[v]),v&&v.schema){if(!equal(e,v.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=normalizeId(m))if("#"==h[0]){if(s[h]&&!equal(e,s[h]))throw new Error('id "'+h+'" resolves to more than one schema');s[h]=e}else a._refs[h]=m}t[r]=u,i[r]=m}}),s}
|
|
24
|
+
|
|
25
|
+
},{"./schema_obj":10,"./util":12,"fast-deep-equal":55,"json-schema-traverse":152,"uri-js":185}],9:[function(require,module,exports){
|
|
26
|
+
"use strict";var ruleModules=require("../dotjs"),toHash=require("./util").toHash;module.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=toHash(t),e.types=toHash(["number","integer","string","array","object","boolean","null"]),e.forEach(function(r){r.rules=r.rules.map(function(r){var n;if("object"==typeof r){var o=Object.keys(r)[0];n=r[o],r=o,n.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:ruleModules[r],implements:n}}),e.all.$comment={keyword:"$comment",code:ruleModules.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=toHash(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e};
|
|
27
|
+
|
|
28
|
+
},{"../dotjs":29,"./util":12}],10:[function(require,module,exports){
|
|
29
|
+
"use strict";var util=require("./util");function SchemaObject(t){util.copy(t,this)}module.exports=SchemaObject;
|
|
30
|
+
|
|
31
|
+
},{"./util":12}],11:[function(require,module,exports){
|
|
32
|
+
"use strict";module.exports=function(r){for(var t,e=0,o=r.length,c=0;c<o;)e++,(t=r.charCodeAt(c++))>=55296&&t<=56319&&c<o&&56320==(64512&(t=r.charCodeAt(c)))&&c++;return e};
|
|
33
|
+
|
|
34
|
+
},{}],12:[function(require,module,exports){
|
|
35
|
+
"use strict";function copy(e,r){for(var t in r=r||{},e)r[t]=e[t];return r}function checkDataType(e,r,t,n){var a=n?" !== ":" === ",o=n?" || ":" && ",c=n?"!":"",s=n?"":"!";switch(e){case"null":return r+a+"null";case"array":return c+"Array.isArray("+r+")";case"object":return"("+c+r+o+"typeof "+r+a+'"object"'+o+s+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+a+'"number"'+o+s+"("+r+" % 1)"+o+r+a+r+(t?o+c+"isFinite("+r+")":"")+")";case"number":return"(typeof "+r+a+'"'+e+'"'+(t?o+c+"isFinite("+r+")":"")+")";default:return"typeof "+r+a+'"'+e+'"'}}function checkDataTypes(e,r,t){switch(e.length){case 1:return checkDataType(e[0],r,t,!0);default:var n="",a=toHash(e);for(var o in a.array&&a.object&&(n=a.null?"(":"(!"+r+" || ",n+="typeof "+r+' !== "object")',delete a.null,delete a.array,delete a.object),a.number&&delete a.integer,a)n+=(n?" && ":"")+checkDataType(o,r,t,!0);return n}}module.exports={copy:copy,checkDataType:checkDataType,checkDataTypes:checkDataTypes,coerceToTypes:coerceToTypes,toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,equal:require("fast-deep-equal"),ucs2length:require("./ucs2length"),varOccurences:varOccurences,varReplace:varReplace,schemaHasRules:schemaHasRules,schemaHasRulesExcept:schemaHasRulesExcept,schemaUnknownRules:schemaUnknownRules,toQuotedString:toQuotedString,getPathExpr:getPathExpr,getPath:getPath,getData:getData,unescapeFragment:unescapeFragment,unescapeJsonPointer:unescapeJsonPointer,escapeFragment:escapeFragment,escapeJsonPointer:escapeJsonPointer};var COERCE_TO_TYPES=toHash(["string","number","integer","boolean","null"]);function coerceToTypes(e,r){if(Array.isArray(r)){for(var t=[],n=0;n<r.length;n++){var a=r[n];COERCE_TO_TYPES[a]?t[t.length]=a:"array"===e&&"array"===a&&(t[t.length]=a)}if(t.length)return t}else{if(COERCE_TO_TYPES[r])return[r];if("array"===e&&"array"===r)return["array"]}}function toHash(e){for(var r={},t=0;t<e.length;t++)r[e[t]]=!0;return r}var IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i,SINGLE_QUOTE=/'|\\/g;function getProperty(e){return"number"==typeof e?"["+e+"]":IDENTIFIER.test(e)?"."+e:"['"+escapeQuotes(e)+"']"}function escapeQuotes(e){return e.replace(SINGLE_QUOTE,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function varOccurences(e,r){r+="[^0-9]";var t=e.match(new RegExp(r,"g"));return t?t.length:0}function varReplace(e,r,t){return r+="([^0-9])",t=t.replace(/\$/g,"$$$$"),e.replace(new RegExp(r,"g"),t+"$1")}function schemaHasRules(e,r){if("boolean"==typeof e)return!e;for(var t in e)if(r[t])return!0}function schemaHasRulesExcept(e,r,t){if("boolean"==typeof e)return!e&&"not"!=t;for(var n in e)if(n!=t&&r[n])return!0}function schemaUnknownRules(e,r){if("boolean"!=typeof e)for(var t in e)if(!r[t])return t}function toQuotedString(e){return"'"+escapeQuotes(e)+"'"}function getPathExpr(e,r,t,n){return joinPaths(e,t?"'/' + "+r+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'")}function getPath(e,r,t){return joinPaths(e,toQuotedString(t?"/"+escapeJsonPointer(r):getProperty(r)))}var JSON_POINTER=/^\/(?:[^~]|~0|~1)*$/,RELATIVE_JSON_POINTER=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(e,r,t){var n,a,o,c;if(""===e)return"rootData";if("/"==e[0]){if(!JSON_POINTER.test(e))throw new Error("Invalid JSON-pointer: "+e);a=e,o="rootData"}else{if(!(c=e.match(RELATIVE_JSON_POINTER)))throw new Error("Invalid JSON-pointer: "+e);if(n=+c[1],"#"==(a=c[2])){if(n>=r)throw new Error("Cannot access property/index "+n+" levels up, current level is "+r);return t[r-n]}if(n>r)throw new Error("Cannot access data "+n+" levels up, current level is "+r);if(o="data"+(r-n||""),!a)return o}for(var s=o,u=a.split("/"),i=0;i<u.length;i++){var p=u[i];p&&(s+=" && "+(o+=getProperty(unescapeJsonPointer(p))))}return s}function joinPaths(e,r){return'""'==e?r:(e+" + "+r).replace(/([^\\])' \+ '/g,"$1")}function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}function escapeJsonPointer(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}
|
|
36
|
+
|
|
37
|
+
},{"./ucs2length":11,"fast-deep-equal":55}],13:[function(require,module,exports){
|
|
38
|
+
"use strict";var KEYWORDS=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];module.exports=function(e,t){for(var i=0;i<t.length;i++){e=JSON.parse(JSON.stringify(e));var r,m=t[i].split("/"),a=e;for(r=1;r<m.length;r++)a=a[m[r]];for(r=0;r<KEYWORDS.length;r++){var n=KEYWORDS[r],s=a[n];s&&(a[n]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e};
|
|
39
|
+
|
|
40
|
+
},{}],14:[function(require,module,exports){
|
|
41
|
+
"use strict";var metaSchema=require("./refs/json-schema-draft-07.json");module.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:metaSchema.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:metaSchema.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}};
|
|
42
|
+
|
|
43
|
+
},{"./refs/json-schema-draft-07.json":44}],15:[function(require,module,exports){
|
|
44
|
+
"use strict";module.exports=function(e,r,a){var t,s=" ",o=e.level,i=e.dataLevel,m=e.schema[r],h=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,d="data"+(i||""),n=e.opts.$data&&m&&m.$data;n?(s+=" var schema"+o+" = "+e.util.getData(m.$data,i,e.dataPathArr)+"; ",t="schema"+o):t=m;var c="maximum"==r,v=c?"exclusiveMaximum":"exclusiveMinimum",p=e.schema[v],f=e.opts.$data&&p&&p.$data,b=c?"<":">",P=c?">":"<",E=void 0;if(!n&&"number"!=typeof m&&void 0!==m)throw new Error(r+" must be number");if(!f&&void 0!==p&&"number"!=typeof p&&"boolean"!=typeof p)throw new Error(v+" must be number or boolean");if(f){var y=e.util.getData(p.$data,i,e.dataPathArr),x="exclusive"+o,w="exclType"+o,g="exclIsNumber"+o,S="' + "+(k="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+y+"; ",s+=" var "+x+"; var "+w+" = typeof "+(y="schemaExcl"+o)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ";var $;E=v;($=$||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(E||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+v+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var M=s;s=$.pop(),!e.compositeRule&&l?e.async?s+=" throw new ValidationError(["+M+"]); ":s+=" validate.errors = ["+M+"]; return false; ":s+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",n&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),s+=" "+w+" == 'number' ? ( ("+x+" = "+t+" === undefined || "+y+" "+b+"= "+t+") ? "+d+" "+P+"= "+y+" : "+d+" "+P+" "+t+" ) : ( ("+x+" = "+y+" === true) ? "+d+" "+P+"= "+t+" : "+d+" "+P+" "+t+" ) || "+d+" !== "+d+") { var op"+o+" = "+x+" ? '"+b+"' : '"+b+"='; ",void 0===m&&(E=v,u=e.errSchemaPath+"/"+v,t=y,n=f)}else{S=b;if((g="number"==typeof p)&&n){var k="'"+S+"'";s+=" if ( ",n&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),s+=" ( "+t+" === undefined || "+p+" "+b+"= "+t+" ? "+d+" "+P+"= "+p+" : "+d+" "+P+" "+t+" ) || "+d+" !== "+d+") { "}else{g&&void 0===m?(x=!0,E=v,u=e.errSchemaPath+"/"+v,t=p,P+="="):(g&&(t=Math[c?"min":"max"](p,m)),p===(!g||t)?(x=!0,E=v,u=e.errSchemaPath+"/"+v,P+="="):(x=!1,S+="="));k="'"+S+"'";s+=" if ( ",n&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),s+=" "+d+" "+P+" "+t+" || "+d+" !== "+d+") { "}}E=E||r,($=$||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(E||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+k+", limit: "+t+", exclusive: "+x+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=n?"' + "+t:t+"'"),e.opts.verbose&&(s+=" , schema: ",s+=n?"validate.schema"+h:""+m,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";M=s;return s=$.pop(),!e.compositeRule&&l?e.async?s+=" throw new ValidationError(["+M+"]); ":s+=" validate.errors = ["+M+"]; return false; ":s+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",l&&(s+=" else { "),s};
|
|
45
|
+
|
|
46
|
+
},{}],16:[function(require,module,exports){
|
|
47
|
+
"use strict";module.exports=function(e,r,a){var t,s=" ",o=e.level,m=e.dataLevel,h=e.schema[r],l=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,u="data"+(m||""),n=e.opts.$data&&h&&h.$data;if(n?(s+=" var schema"+o+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ",t="schema"+o):t=h,!n&&"number"!=typeof h)throw new Error(r+" must be number");s+="if ( ",n&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),s+=" "+u+".length "+("maxItems"==r?">":"<")+" "+t+") { ";var c=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(c||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(i)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"fewer",s+=" than ",s+=n?"' + "+t+" + '":""+h,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=n?"validate.schema"+l:""+h,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s};
|
|
48
|
+
|
|
49
|
+
},{}],17:[function(require,module,exports){
|
|
50
|
+
"use strict";module.exports=function(e,r,a){var t,s=" ",o=e.level,h=e.dataLevel,l=e.schema[r],m=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,u="data"+(h||""),c=e.opts.$data&&l&&l.$data;if(c?(s+=" var schema"+o+" = "+e.util.getData(l.$data,h,e.dataPathArr)+"; ",t="schema"+o):t=l,!c&&"number"!=typeof l)throw new Error(r+" must be number");var d="maxLength"==r?">":"<";s+="if ( ",c&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+d+" "+t+") { ";var p=r,v=v||[];v.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=c?"' + "+t+" + '":""+l,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=c?"validate.schema"+m:""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var g=s;return s=v.pop(),!e.compositeRule&&i?e.async?s+=" throw new ValidationError(["+g+"]); ":s+=" validate.errors = ["+g+"]; return false; ":s+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",i&&(s+=" else { "),s};
|
|
51
|
+
|
|
52
|
+
},{}],18:[function(require,module,exports){
|
|
53
|
+
"use strict";module.exports=function(e,r,a){var t,s=" ",o=e.level,h=e.dataLevel,m=e.schema[r],i=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,p=!e.opts.allErrors,d="data"+(h||""),u=e.opts.$data&&m&&m.$data;if(u?(s+=" var schema"+o+" = "+e.util.getData(m.$data,h,e.dataPathArr)+"; ",t="schema"+o):t=m,!u&&"number"!=typeof m)throw new Error(r+" must be number");s+="if ( ",u&&(s+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),s+=" Object.keys("+d+").length "+("maxProperties"==r?">":"<")+" "+t+") { ";var n=r,c=c||[];c.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(n||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"fewer",s+=" than ",s+=u?"' + "+t+" + '":""+m,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=u?"validate.schema"+i:""+m,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var v=s;return s=c.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s};
|
|
54
|
+
|
|
55
|
+
},{}],19:[function(require,module,exports){
|
|
56
|
+
"use strict";module.exports=function(e,t,a){var r=" ",s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,i=e.util.copy(e),o="";i.level++;var u="valid"+i.level,m=i.baseId,v=!0,d=s;if(d)for(var f,p=-1,n=d.length-1;p<n;)f=d[p+=1],(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all))&&(v=!1,i.schema=f,i.schemaPath=l+"["+p+"]",i.errSchemaPath=c+"/"+p,r+=" "+e.validate(i)+" ",i.baseId=m,h&&(r+=" if ("+u+") { ",o+="}"));return h&&(r+=v?" if (true) { ":" "+o.slice(0,-1)+" "),r};
|
|
57
|
+
|
|
58
|
+
},{}],20:[function(require,module,exports){
|
|
59
|
+
"use strict";module.exports=function(e,r,a){var s=" ",t=e.level,o=e.dataLevel,l=e.schema[r],i=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,v="data"+(o||""),m="valid"+t,u="errs__"+t,n=e.util.copy(e),d="";n.level++;var p="valid"+n.level;if(l.every(function(r){return e.opts.strictKeywords?"object"==typeof r&&Object.keys(r).length>0||!1===r:e.util.schemaHasRules(r,e.RULES.all)})){var f=n.baseId;s+=" var "+u+" = errors; var "+m+" = false; ";var E=e.compositeRule;e.compositeRule=n.compositeRule=!0;var y=l;if(y)for(var P,R=-1,g=y.length-1;R<g;)P=y[R+=1],n.schema=P,n.schemaPath=i+"["+R+"]",n.errSchemaPath=c+"/"+R,s+=" "+e.validate(n)+" ",n.baseId=f,s+=" "+m+" = "+m+" || "+p+"; if (!"+m+") { ",d+="}";e.compositeRule=n.compositeRule=E,s+=" "+d+" if (!"+m+") { var err = ",!1!==e.createErrors?(s+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else h&&(s+=" if (true) { ");return s};
|
|
60
|
+
|
|
61
|
+
},{}],21:[function(require,module,exports){
|
|
62
|
+
"use strict";module.exports=function(t,o,e){var r=" ",s=t.schema[o],n=t.errSchemaPath+"/"+o,c=(t.opts.allErrors,t.util.toQuotedString(s));return!0===t.opts.$comment?r+=" console.log("+c+");":"function"==typeof t.opts.$comment&&(r+=" self._opts.$comment("+c+", "+t.util.toQuotedString(n)+", validate.root.schema);"),r};
|
|
63
|
+
|
|
64
|
+
},{}],22:[function(require,module,exports){
|
|
65
|
+
"use strict";module.exports=function(a,e,r){var t=" ",s=a.level,o=a.dataLevel,l=a.schema[e],h=a.schemaPath+a.util.getProperty(e),c=a.errSchemaPath+"/"+e,d=!a.opts.allErrors,m="data"+(o||""),v="valid"+s,u=a.opts.$data&&l&&l.$data;u&&(t+=" var schema"+s+" = "+a.util.getData(l.$data,o,a.dataPathArr)+"; "),u||(t+=" var schema"+s+" = validate.schema"+h+";"),t+="var "+v+" = equal("+m+", schema"+s+"); if (!"+v+") { ";var i=i||[];i.push(t),t="",!1!==a.createErrors?(t+=" { keyword: 'const' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(c)+" , params: { allowedValue: schema"+s+" } ",!1!==a.opts.messages&&(t+=" , message: 'should be equal to constant' "),a.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";var n=t;return t=i.pop(),!a.compositeRule&&d?a.async?t+=" throw new ValidationError(["+n+"]); ":t+=" validate.errors = ["+n+"]; return false; ":t+=" var err = "+n+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",d&&(t+=" else { "),t};
|
|
66
|
+
|
|
67
|
+
},{}],23:[function(require,module,exports){
|
|
68
|
+
"use strict";module.exports=function(e,r,a){var t=" ",s=e.level,l=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),v=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,c="data"+(l||""),u="valid"+s,d="errs__"+s,m=e.util.copy(e);m.level++;var p="valid"+m.level,n="i"+s,P=m.dataLevel=e.dataLevel+1,f="data"+P,E=e.baseId,g=e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(t+="var "+d+" = errors;var "+u+";",g){var R=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.schema=o,m.schemaPath=i,m.errSchemaPath=v,t+=" var "+p+" = false; for (var "+n+" = 0; "+n+" < "+c+".length; "+n+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,n,e.opts.jsonPointers,!0);var y=c+"["+n+"]";m.dataPathArr[P]=n;var b=e.validate(m);m.baseId=E,e.util.varOccurences(b,f)<2?t+=" "+e.util.varReplace(b,f,y)+" ":t+=" var "+f+" = "+y+"; "+b+" ",t+=" if ("+p+") break; } ",e.compositeRule=m.compositeRule=R,t+=" if (!"+p+") {"}else t+=" if ("+c+".length == 0) {";var S=S||[];S.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should contain a valid item' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var w=t;return t=S.pop(),!e.compositeRule&&h?e.async?t+=" throw new ValidationError(["+w+"]); ":t+=" validate.errors = ["+w+"]; return false; ":t+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { ",g&&(t+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(t+=" } "),t};
|
|
69
|
+
|
|
70
|
+
},{}],24:[function(require,module,exports){
|
|
71
|
+
"use strict";module.exports=function(a,r,e){var t,s,o=" ",i=a.level,h=a.dataLevel,d=a.schema[r],l=a.schemaPath+a.util.getProperty(r),v=a.errSchemaPath+"/"+r,c=!a.opts.allErrors,n="data"+(h||""),m="valid"+i,u="errs__"+i,p=a.opts.$data&&d&&d.$data;p?(o+=" var schema"+i+" = "+a.util.getData(d.$data,h,a.dataPathArr)+"; ",s="schema"+i):s=d;var f,P,y,E,w,k="definition"+i,g=this.definition,R="";if(p&&g.$data){w="keywordValidate"+i;var S=g.validateSchema;o+=" var "+k+" = RULES.custom['"+r+"'].definition; var "+w+" = "+k+".validate;"}else{if(!(E=a.useCustomRule(this,d,a.schema,a)))return;s="validate.schema"+l,w=E.code,f=g.compile,P=g.inline,y=g.macro}var b=w+".errors",$="i"+i,A="ruleErr"+i,D=g.async;if(D&&!a.async)throw new Error("async keyword in sync schema");if(P||y||(o+=b+" = null;"),o+="var "+u+" = errors;var "+m+";",p&&g.$data&&(R+="}",o+=" if ("+s+" === undefined) { "+m+" = true; } else { ",S&&(R+="}",o+=" "+m+" = "+k+".validateSchema("+s+"); if ("+m+") { ")),P)g.statements?o+=" "+E.validate+" ":o+=" "+m+" = "+E.validate+"; ";else if(y){var V=a.util.copy(a);R="";V.level++;var x="valid"+V.level;V.schema=E.validate,V.schemaPath="";var C=a.compositeRule;a.compositeRule=V.compositeRule=!0;var L=a.validate(V).replace(/validate\.schema/g,w);a.compositeRule=V.compositeRule=C,o+=" "+L}else{(j=j||[]).push(o),o="",o+=" "+w+".call( ",a.opts.passContext?o+="this":o+="self",f||!1===g.schema?o+=" , "+n+" ":o+=" , "+s+" , "+n+" , validate.schema"+a.schemaPath+" ",o+=" , (dataPath || '')",'""'!=a.errorPath&&(o+=" + "+a.errorPath);var Q=h?"data"+(h-1||""):"parentData",_=h?a.dataPathArr[h]:"parentDataProperty",U=o+=" , "+Q+" , "+_+" , rootData ) ";o=j.pop(),!1===g.errors?(o+=" "+m+" = ",D&&(o+="await "),o+=U+"; "):o+=D?" var "+(b="customErrors"+i)+" = null; try { "+m+" = await "+U+"; } catch (e) { "+m+" = false; if (e instanceof ValidationError) "+b+" = e.errors; else throw e; } ":" "+b+" = null; "+m+" = "+U+"; "}if(g.modifying&&(o+=" if ("+Q+") "+n+" = "+Q+"["+_+"];"),o+=""+R,g.valid)c&&(o+=" if (true) { ");else{var j;o+=" if ( ",void 0===g.valid?(o+=" !",o+=y?""+x:""+m):o+=" "+!g.valid+" ",o+=") { ",t=this.keyword,(j=j||[]).push(o),o="",(j=j||[]).push(o),o="",!1!==a.createErrors?(o+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(v)+" , params: { keyword: '"+this.keyword+"' } ",!1!==a.opts.messages&&(o+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),a.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+n+" "),o+=" } "):o+=" {} ";var q=o;o=j.pop(),!a.compositeRule&&c?a.async?o+=" throw new ValidationError(["+q+"]); ":o+=" validate.errors = ["+q+"]; return false; ":o+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var z=o;o=j.pop(),P?g.errors?"full"!=g.errors&&(o+=" for (var "+$+"="+u+"; "+$+"<errors; "+$+"++) { var "+A+" = vErrors["+$+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+a.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+v+'"; } ',a.opts.verbose&&(o+=" "+A+".schema = "+s+"; "+A+".data = "+n+"; "),o+=" } "):!1===g.errors?o+=" "+z+" ":(o+=" if ("+u+" == errors) { "+z+" } else { for (var "+$+"="+u+"; "+$+"<errors; "+$+"++) { var "+A+" = vErrors["+$+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+a.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+v+'"; } ',a.opts.verbose&&(o+=" "+A+".schema = "+s+"; "+A+".data = "+n+"; "),o+=" } } "):y?(o+=" var err = ",!1!==a.createErrors?(o+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(v)+" , params: { keyword: '"+this.keyword+"' } ",!1!==a.opts.messages&&(o+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),a.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+n+" "),o+=" } "):o+=" {} ",o+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!a.compositeRule&&c&&(a.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; ")):!1===g.errors?o+=" "+z+" ":(o+=" if (Array.isArray("+b+")) { if (vErrors === null) vErrors = "+b+"; else vErrors = vErrors.concat("+b+"); errors = vErrors.length; for (var "+$+"="+u+"; "+$+"<errors; "+$+"++) { var "+A+" = vErrors["+$+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+a.errorPath+"; "+A+'.schemaPath = "'+v+'"; ',a.opts.verbose&&(o+=" "+A+".schema = "+s+"; "+A+".data = "+n+"; "),o+=" } } else { "+z+" } "),o+=" } ",c&&(o+=" else { ")}return o};
|
|
72
|
+
|
|
73
|
+
},{}],25:[function(require,module,exports){
|
|
74
|
+
"use strict";module.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,p=e.schema[r],i=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,n="data"+(o||""),h="errs__"+s,c=e.util.copy(e),d="";c.level++;var v="valid"+c.level,P={},m={},y=e.opts.ownProperties;for(j in p)if("__proto__"!=j){var g=p[j],f=Array.isArray(g)?m:P;f[j]=g}a+="var "+h+" = errors;";var Q=e.errorPath;for(var j in a+="var missing"+s+";",m)if((f=m[j]).length){if(a+=" if ( "+n+e.util.getProperty(j)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+n+", '"+e.util.escapeQuotes(j)+"') "),u){a+=" && ( ";var w=f;if(w)for(var E=-1,b=w.length-1;E<b;){x=w[E+=1],E&&(a+=" || "),a+=" ( ( "+(I=n+(D=e.util.getProperty(x)))+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+n+", '"+e.util.escapeQuotes(x)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?x:D)+") ) "}a+=")) { ";var O="missing"+s,S="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(Q,O,!0):Q+" + "+O);var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(j)+"', missingProperty: '"+S+"', depsCount: "+f.length+", deps: '"+e.util.escapeQuotes(1==f.length?f[0]:f.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==f.length?a+="property "+e.util.escapeQuotes(f[0]):a+="properties "+e.util.escapeQuotes(f.join(", ")),a+=" when property "+e.util.escapeQuotes(j)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+n+" "),a+=" } "):a+=" {} ";var k=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+k+"]); ":a+=" validate.errors = ["+k+"]; return false; ":a+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var R=f;if(R)for(var x,A=-1,C=R.length-1;A<C;){x=R[A+=1];var D=e.util.getProperty(x),I=(S=e.util.escapeQuotes(x),n+D);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Q,x,e.opts.jsonPointers)),a+=" if ( "+I+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+n+", '"+e.util.escapeQuotes(x)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(j)+"', missingProperty: '"+S+"', depsCount: "+f.length+", deps: '"+e.util.escapeQuotes(1==f.length?f[0]:f.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==f.length?a+="property "+e.util.escapeQuotes(f[0]):a+="properties "+e.util.escapeQuotes(f.join(", ")),a+=" when property "+e.util.escapeQuotes(j)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+n+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",u&&(d+="}",a+=" else { ")}e.errorPath=Q;var L=c.baseId;for(var j in P){g=P[j];(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(a+=" "+v+" = true; if ( "+n+e.util.getProperty(j)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+n+", '"+e.util.escapeQuotes(j)+"') "),a+=") { ",c.schema=g,c.schemaPath=i+e.util.getProperty(j),c.errSchemaPath=l+"/"+e.util.escapeFragment(j),a+=" "+e.validate(c)+" ",c.baseId=L,a+=" } ",u&&(a+=" if ("+v+") { ",d+="}"))}return u&&(a+=" "+d+" if ("+h+" == errors) {"),a};
|
|
75
|
+
|
|
76
|
+
},{}],26:[function(require,module,exports){
|
|
77
|
+
"use strict";module.exports=function(a,e,r){var t=" ",s=a.level,l=a.dataLevel,o=a.schema[e],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,i=!a.opts.allErrors,u="data"+(l||""),m="valid"+s,v=a.opts.$data&&o&&o.$data;v&&(t+=" var schema"+s+" = "+a.util.getData(o.$data,l,a.dataPathArr)+"; ");var c="i"+s,n="schema"+s;v||(t+=" var "+n+" = validate.schema"+h+";"),t+="var "+m+";",v&&(t+=" if (schema"+s+" === undefined) "+m+" = true; else if (!Array.isArray(schema"+s+")) "+m+" = false; else {"),t+=m+" = false;for (var "+c+"=0; "+c+"<"+n+".length; "+c+"++) if (equal("+u+", "+n+"["+c+"])) { "+m+" = true; break; }",v&&(t+=" } "),t+=" if (!"+m+") { ";var p=p||[];p.push(t),t="",!1!==a.createErrors?(t+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { allowedValues: schema"+s+" } ",!1!==a.opts.messages&&(t+=" , message: 'should be equal to one of the allowed values' "),a.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),t+=" } "):t+=" {} ";var f=t;return t=p.pop(),!a.compositeRule&&i?a.async?t+=" throw new ValidationError(["+f+"]); ":t+=" validate.errors = ["+f+"]; return false; ":t+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",i&&(t+=" else { "),t};
|
|
78
|
+
|
|
79
|
+
},{}],27:[function(require,module,exports){
|
|
80
|
+
"use strict";module.exports=function(a,t,r){var e=" ",o=a.level,s=a.dataLevel,i=a.schema[t],n=a.schemaPath+a.util.getProperty(t),f=a.errSchemaPath+"/"+t,c=!a.opts.allErrors,u="data"+(s||"");if(!1===a.opts.format)return c&&(e+=" if (true) { "),e;var m,h=a.opts.$data&&i&&i.$data;h?(e+=" var schema"+o+" = "+a.util.getData(i.$data,s,a.dataPathArr)+"; ",m="schema"+o):m=i;var l=a.opts.unknownFormats,d=Array.isArray(l);if(h){e+=" var "+(p="format"+o)+" = formats["+m+"]; var "+(v="isObject"+o)+" = typeof "+p+" == 'object' && !("+p+" instanceof RegExp) && "+p+".validate; var "+(y="formatType"+o)+" = "+v+" && "+p+".type || 'string'; if ("+v+") { ",a.async&&(e+=" var async"+o+" = "+p+".async; "),e+=" "+p+" = "+p+".validate; } if ( ",h&&(e+=" ("+m+" !== undefined && typeof "+m+" != 'string') || "),e+=" (","ignore"!=l&&(e+=" ("+m+" && !"+p+" ",d&&(e+=" && self._opts.unknownFormats.indexOf("+m+") == -1 "),e+=") || "),e+=" ("+p+" && "+y+" == '"+r+"' && !(typeof "+p+" == 'function' ? ",a.async?e+=" (async"+o+" ? await "+p+"("+u+") : "+p+"("+u+")) ":e+=" "+p+"("+u+") ",e+=" : "+p+".test("+u+"))))) {"}else{var p;if(!(p=a.formats[i])){if("ignore"==l)return a.logger.warn('unknown format "'+i+'" ignored in schema at path "'+a.errSchemaPath+'"'),c&&(e+=" if (true) { "),e;if(d&&l.indexOf(i)>=0)return c&&(e+=" if (true) { "),e;throw new Error('unknown format "'+i+'" is used in schema at path "'+a.errSchemaPath+'"')}var v,y=(v="object"==typeof p&&!(p instanceof RegExp)&&p.validate)&&p.type||"string";if(v){var g=!0===p.async;p=p.validate}if(y!=r)return c&&(e+=" if (true) { "),e;if(g){if(!a.async)throw new Error("async format in sync schema");e+=" if (!(await "+(w="formats"+a.util.getProperty(i)+".validate")+"("+u+"))) { "}else{e+=" if (! ";var w="formats"+a.util.getProperty(i);v&&(w+=".validate"),e+="function"==typeof p?" "+w+"("+u+") ":" "+w+".test("+u+") ",e+=") { "}}var P=P||[];P.push(e),e="",!1!==a.createErrors?(e+=" { keyword: 'format' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(f)+" , params: { format: ",e+=h?""+m:""+a.util.toQuotedString(i),e+=" } ",!1!==a.opts.messages&&(e+=" , message: 'should match format \"",e+=h?"' + "+m+" + '":""+a.util.escapeQuotes(i),e+="\"' "),a.opts.verbose&&(e+=" , schema: ",e+=h?"validate.schema"+n:""+a.util.toQuotedString(i),e+=" , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),e+=" } "):e+=" {} ";var E=e;return e=P.pop(),!a.compositeRule&&c?a.async?e+=" throw new ValidationError(["+E+"]); ":e+=" validate.errors = ["+E+"]; return false; ":e+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",e+=" } ",c&&(e+=" else { "),e};
|
|
81
|
+
|
|
82
|
+
},{}],28:[function(require,module,exports){
|
|
83
|
+
"use strict";module.exports=function(e,r,a){var s=" ",t=e.level,l=e.dataLevel,h=e.schema[r],o=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,m="data"+(l||""),v="valid"+t,u="errs__"+t,d=e.util.copy(e);d.level++;var n="valid"+d.level,p=e.schema.then,P=e.schema.else,f=void 0!==p&&(e.opts.strictKeywords?"object"==typeof p&&Object.keys(p).length>0||!1===p:e.util.schemaHasRules(p,e.RULES.all)),E=void 0!==P&&(e.opts.strictKeywords?"object"==typeof P&&Object.keys(P).length>0||!1===P:e.util.schemaHasRules(P,e.RULES.all)),y=d.baseId;if(f||E){var R;d.createErrors=!1,d.schema=h,d.schemaPath=o,d.errSchemaPath=c,s+=" var "+u+" = errors; var "+v+" = true; ";var S=e.compositeRule;e.compositeRule=d.compositeRule=!0,s+=" "+e.validate(d)+" ",d.baseId=y,d.createErrors=!0,s+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=S,f?(s+=" if ("+n+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",s+=" "+e.validate(d)+" ",d.baseId=y,s+=" "+v+" = "+n+"; ",f&&E?s+=" var "+(R="ifClause"+t)+" = 'then'; ":R="'then'",s+=" } ",E&&(s+=" else { ")):s+=" if (!"+n+") { ",E&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",s+=" "+e.validate(d)+" ",d.baseId=y,s+=" "+v+" = "+n+"; ",f&&E?s+=" var "+(R="ifClause"+t)+" = 'else'; ":R="'else'",s+=" } "),s+=" if (!"+v+") { var err = ",!1!==e.createErrors?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+R+" } ",!1!==e.opts.messages&&(s+=" , message: 'should match \"' + "+R+" + '\" schema' "),e.opts.verbose&&(s+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&i&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } ",i&&(s+=" else { ")}else i&&(s+=" if (true) { ");return s};
|
|
84
|
+
|
|
85
|
+
},{}],29:[function(require,module,exports){
|
|
86
|
+
"use strict";module.exports={$ref:require("./ref"),allOf:require("./allOf"),anyOf:require("./anyOf"),$comment:require("./comment"),const:require("./const"),contains:require("./contains"),dependencies:require("./dependencies"),enum:require("./enum"),format:require("./format"),if:require("./if"),items:require("./items"),maximum:require("./_limit"),minimum:require("./_limit"),maxItems:require("./_limitItems"),minItems:require("./_limitItems"),maxLength:require("./_limitLength"),minLength:require("./_limitLength"),maxProperties:require("./_limitProperties"),minProperties:require("./_limitProperties"),multipleOf:require("./multipleOf"),not:require("./not"),oneOf:require("./oneOf"),pattern:require("./pattern"),properties:require("./properties"),propertyNames:require("./propertyNames"),required:require("./required"),uniqueItems:require("./uniqueItems"),validate:require("./validate")};
|
|
87
|
+
|
|
88
|
+
},{"./_limit":15,"./_limitItems":16,"./_limitLength":17,"./_limitProperties":18,"./allOf":19,"./anyOf":20,"./comment":21,"./const":22,"./contains":23,"./dependencies":25,"./enum":26,"./format":27,"./if":28,"./items":30,"./multipleOf":31,"./not":32,"./oneOf":33,"./pattern":34,"./properties":35,"./propertyNames":36,"./ref":37,"./required":38,"./uniqueItems":39,"./validate":40}],30:[function(require,module,exports){
|
|
89
|
+
"use strict";module.exports=function(e,a,r){var t=" ",s=e.level,l=e.dataLevel,h=e.schema[a],o=e.schemaPath+e.util.getProperty(a),i=e.errSchemaPath+"/"+a,c=!e.opts.allErrors,v="data"+(l||""),d="valid"+s,n="errs__"+s,m=e.util.copy(e),u="";m.level++;var P="valid"+m.level,p="i"+s,f=m.dataLevel=e.dataLevel+1,g="data"+f,y=e.baseId;if(t+="var "+n+" = errors;var "+d+";",Array.isArray(h)){var b=e.schema.additionalItems;if(!1===b){t+=" "+d+" = "+v+".length <= "+h.length+"; ";var E=i;i=e.errSchemaPath+"/additionalItems",t+=" if (!"+d+") { ";var S=S||[];S.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(i)+" , params: { limit: "+h.length+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have more than "+h.length+" items' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),t+=" } "):t+=" {} ";var j=t;t=S.pop(),!e.compositeRule&&c?e.async?t+=" throw new ValidationError(["+j+"]); ":t+=" validate.errors = ["+j+"]; return false; ":t+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } ",i=E,c&&(u+="}",t+=" else { ")}var R=h;if(R)for(var I,O=-1,k=R.length-1;O<k;)if(I=R[O+=1],e.opts.strictKeywords?"object"==typeof I&&Object.keys(I).length>0||!1===I:e.util.schemaHasRules(I,e.RULES.all)){t+=" "+P+" = true; if ("+v+".length > "+O+") { ";var w=v+"["+O+"]";m.schema=I,m.schemaPath=o+"["+O+"]",m.errSchemaPath=i+"/"+O,m.errorPath=e.util.getPathExpr(e.errorPath,O,e.opts.jsonPointers,!0),m.dataPathArr[f]=O;var L=e.validate(m);m.baseId=y,e.util.varOccurences(L,g)<2?t+=" "+e.util.varReplace(L,g,w)+" ":t+=" var "+g+" = "+w+"; "+L+" ",t+=" } ",c&&(t+=" if ("+P+") { ",u+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))){m.schema=b,m.schemaPath=e.schemaPath+".additionalItems",m.errSchemaPath=e.errSchemaPath+"/additionalItems",t+=" "+P+" = true; if ("+v+".length > "+h.length+") { for (var "+p+" = "+h.length+"; "+p+" < "+v+".length; "+p+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers,!0);w=v+"["+p+"]";m.dataPathArr[f]=p;L=e.validate(m);m.baseId=y,e.util.varOccurences(L,g)<2?t+=" "+e.util.varReplace(L,g,w)+" ":t+=" var "+g+" = "+w+"; "+L+" ",c&&(t+=" if (!"+P+") break; "),t+=" } } ",c&&(t+=" if ("+P+") { ",u+="}")}}else if(e.opts.strictKeywords?"object"==typeof h&&Object.keys(h).length>0||!1===h:e.util.schemaHasRules(h,e.RULES.all)){m.schema=h,m.schemaPath=o,m.errSchemaPath=i,t+=" for (var "+p+" = 0; "+p+" < "+v+".length; "+p+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers,!0);w=v+"["+p+"]";m.dataPathArr[f]=p;L=e.validate(m);m.baseId=y,e.util.varOccurences(L,g)<2?t+=" "+e.util.varReplace(L,g,w)+" ":t+=" var "+g+" = "+w+"; "+L+" ",c&&(t+=" if (!"+P+") break; "),t+=" }"}return c&&(t+=" "+u+" if ("+n+" == errors) {"),t};
|
|
90
|
+
|
|
91
|
+
},{}],31:[function(require,module,exports){
|
|
92
|
+
"use strict";module.exports=function(e,r,a){var t,s=" ",i=e.level,o=e.dataLevel,l=e.schema[r],d=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,m="data"+(o||""),u=e.opts.$data&&l&&l.$data;if(u?(s+=" var schema"+i+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",t="schema"+i):t=l,!u&&"number"!=typeof l)throw new Error(r+" must be number");s+="var division"+i+";if (",u&&(s+=" "+t+" !== undefined && ( typeof "+t+" != 'number' || "),s+=" (division"+i+" = "+m+" / "+t+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",u&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { multipleOf: "+t+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=u?"' + "+t:t+"'"),e.opts.verbose&&(s+=" , schema: ",s+=u?"validate.schema"+d:""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ";var v=s;return s=p.pop(),!e.compositeRule&&n?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",n&&(s+=" else { "),s};
|
|
93
|
+
|
|
94
|
+
},{}],32:[function(require,module,exports){
|
|
95
|
+
"use strict";module.exports=function(r,e,a){var s=" ",t=r.level,o=r.dataLevel,l=r.schema[e],h=r.schemaPath+r.util.getProperty(e),c=r.errSchemaPath+"/"+e,i=!r.opts.allErrors,m="data"+(o||""),v="errs__"+t,p=r.util.copy(r);p.level++;var u="valid"+p.level;if(r.opts.strictKeywords?"object"==typeof l&&Object.keys(l).length>0||!1===l:r.util.schemaHasRules(l,r.RULES.all)){p.schema=l,p.schemaPath=h,p.errSchemaPath=c,s+=" var "+v+" = errors; ";var d,E=r.compositeRule;r.compositeRule=p.compositeRule=!0,p.createErrors=!1,p.opts.allErrors&&(d=p.opts.allErrors,p.opts.allErrors=!1),s+=" "+r.validate(p)+" ",p.createErrors=!0,d&&(p.opts.allErrors=d),r.compositeRule=p.compositeRule=E,s+=" if ("+u+") { ";var n=n||[];n.push(s),s="",!1!==r.createErrors?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(c)+" , params: {} ",!1!==r.opts.messages&&(s+=" , message: 'should NOT be valid' "),r.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ";var P=s;s=n.pop(),!r.compositeRule&&i?r.async?s+=" throw new ValidationError(["+P+"]); ":s+=" validate.errors = ["+P+"]; return false; ":s+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",r.opts.allErrors&&(s+=" } ")}else s+=" var err = ",!1!==r.createErrors?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(c)+" , params: {} ",!1!==r.opts.messages&&(s+=" , message: 'should NOT be valid' "),r.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+m+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i&&(s+=" if (false) { ");return s};
|
|
96
|
+
|
|
97
|
+
},{}],33:[function(require,module,exports){
|
|
98
|
+
"use strict";module.exports=function(e,r,a){var s=" ",t=e.level,l=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,v="data"+(l||""),m="valid"+t,u="errs__"+t,n=e.util.copy(e),p="";n.level++;var d="valid"+n.level,f=n.baseId,E="prevValid"+t,P="passingSchemas"+t;s+="var "+u+" = errors , "+E+" = false , "+m+" = false , "+P+" = null; ";var g=e.compositeRule;e.compositeRule=n.compositeRule=!0;var y=o;if(y)for(var R,S=-1,b=y.length-1;S<b;)R=y[S+=1],(e.opts.strictKeywords?"object"==typeof R&&Object.keys(R).length>0||!1===R:e.util.schemaHasRules(R,e.RULES.all))?(n.schema=R,n.schemaPath=i+"["+S+"]",n.errSchemaPath=c+"/"+S,s+=" "+e.validate(n)+" ",n.baseId=f):s+=" var "+d+" = true; ",S&&(s+=" if ("+d+" && "+E+") { "+m+" = false; "+P+" = ["+P+", "+S+"]; } else { ",p+="}"),s+=" if ("+d+") { "+m+" = "+E+" = true; "+P+" = "+S+"; }";return e.compositeRule=n.compositeRule=g,s+=p+"if (!"+m+") { var err = ",!1!==e.createErrors?(s+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+P+" } ",!1!==e.opts.messages&&(s+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+="} else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; }",e.opts.allErrors&&(s+=" } "),s};
|
|
99
|
+
|
|
100
|
+
},{}],34:[function(require,module,exports){
|
|
101
|
+
"use strict";module.exports=function(e,t,a){var r,s=" ",o=e.level,h=e.dataLevel,l=e.schema[t],u=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,i=!e.opts.allErrors,n="data"+(h||""),p=e.opts.$data&&l&&l.$data;p?(s+=" var schema"+o+" = "+e.util.getData(l.$data,h,e.dataPathArr)+"; ",r="schema"+o):r=l,s+="if ( ",p&&(s+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),s+=" !"+(p?"(new RegExp("+r+"))":e.usePattern(l))+".test("+n+") ) { ";var c=c||[];c.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { pattern: ",s+=p?""+r:""+e.util.toQuotedString(l),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=p?"' + "+r+" + '":""+e.util.escapeQuotes(l),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+u:""+e.util.toQuotedString(l),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+n+" "),s+=" } "):s+=" {} ";var m=s;return s=c.pop(),!e.compositeRule&&i?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",i&&(s+=" else { "),s};
|
|
102
|
+
|
|
103
|
+
},{}],35:[function(require,module,exports){
|
|
104
|
+
"use strict";module.exports=function(e,r,t){var a=" ",o=e.level,s=e.dataLevel,i=e.schema[r],l=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,p=!e.opts.allErrors,d="data"+(s||""),n="errs__"+o,c=e.util.copy(e),P="";c.level++;var u="valid"+c.level,v="key"+o,f="idx"+o,m=c.dataLevel=e.dataLevel+1,g="data"+m,y="dataProperties"+o,b=Object.keys(i||{}).filter(x),j=e.schema.patternProperties||{},O=Object.keys(j).filter(x),S=e.schema.additionalProperties,E=b.length||O.length,R=!1===S,k="object"==typeof S&&Object.keys(S).length,w=e.opts.removeAdditional,_=R||k||w,Q=e.opts.ownProperties,A=e.baseId,D=e.schema.required;if(D&&(!e.opts.$data||!D.$data)&&D.length<e.opts.loopRequired)var q=e.util.toHash(D);function x(e){return"__proto__"!==e}if(a+="var "+n+" = errors;var "+u+" = true;",Q&&(a+=" var "+y+" = undefined;"),_){if(a+=Q?" "+y+" = "+y+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+v+" = "+y+"["+f+"]; ":" for (var "+v+" in "+d+") { ",E){if(a+=" var isAdditional"+o+" = !(false ",b.length)if(b.length>8)a+=" || validate.schema"+l+".hasOwnProperty("+v+") ";else{var I=b;if(I)for(var L=-1,H=I.length-1;L<H;)M=I[L+=1],a+=" || "+v+" == "+e.util.toQuotedString(M)+" "}if(O.length){var F=O;if(F)for(var K=-1,U=F.length-1;K<U;)se=F[K+=1],a+=" || "+e.usePattern(se)+".test("+v+") "}a+=" ); if (isAdditional"+o+") { "}if("all"==w)a+=" delete "+d+"["+v+"]; ";else{var V=e.errorPath,$="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),R)if(w)a+=" delete "+d+"["+v+"]; ";else{a+=" "+u+" = false; ";var N=h;h=e.errSchemaPath+"/additionalProperties",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { additionalProperty: '"+$+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var T=a;a=te.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+T+"]); ":a+=" validate.errors = ["+T+"]; return false; ":a+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=N,p&&(a+=" break; ")}else if(k)if("failing"==w){a+=" var "+n+" = errors; ";var z=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=S,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var B=d+"["+v+"]";c.dataPathArr[m]=v;var C=e.validate(c);c.baseId=A,e.util.varOccurences(C,g)<2?a+=" "+e.util.varReplace(C,g,B)+" ":a+=" var "+g+" = "+B+"; "+C+" ",a+=" if (!"+u+") { errors = "+n+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+v+"]; } ",e.compositeRule=c.compositeRule=z}else{c.schema=S,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);B=d+"["+v+"]";c.dataPathArr[m]=v;C=e.validate(c);c.baseId=A,e.util.varOccurences(C,g)<2?a+=" "+e.util.varReplace(C,g,B)+" ":a+=" var "+g+" = "+B+"; "+C+" ",p&&(a+=" if (!"+u+") break; ")}e.errorPath=V}E&&(a+=" } "),a+=" } ",p&&(a+=" if ("+u+") { ",P+="}")}var G=e.opts.useDefaults&&!e.compositeRule;if(b.length){var J=b;if(J)for(var M,W=-1,X=J.length-1;W<X;){var Y=i[M=J[W+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all)){var Z=e.util.getProperty(M),ee=(B=d+Z,G&&void 0!==Y.default);c.schema=Y,c.schemaPath=l+Z,c.errSchemaPath=h+"/"+e.util.escapeFragment(M),c.errorPath=e.util.getPath(e.errorPath,M,e.opts.jsonPointers),c.dataPathArr[m]=e.util.toQuotedString(M);C=e.validate(c);if(c.baseId=A,e.util.varOccurences(C,g)<2){C=e.util.varReplace(C,g,B);var re=B}else{re=g;a+=" var "+g+" = "+B+"; "}if(ee)a+=" "+C+" ";else{if(q&&q[M]){a+=" if ( "+re+" === undefined ",Q&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(M)+"') "),a+=") { "+u+" = false; ";V=e.errorPath,N=h;var te,ae=e.util.escapeQuotes(M);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(V,M,e.opts.jsonPointers)),h=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+ae+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ae+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";T=a;a=te.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+T+"]); ":a+=" validate.errors = ["+T+"]; return false; ":a+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=N,e.errorPath=V,a+=" } else { "}else p?(a+=" if ( "+re+" === undefined ",Q&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(M)+"') "),a+=") { "+u+" = true; } else { "):(a+=" if ("+re+" !== undefined ",Q&&(a+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(M)+"') "),a+=" ) { ");a+=" "+C+" } "}}p&&(a+=" if ("+u+") { ",P+="}")}}if(O.length){var oe=O;if(oe)for(var se,ie=-1,le=oe.length-1;ie<le;){Y=j[se=oe[ie+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all)){c.schema=Y,c.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(se),c.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(se),a+=Q?" "+y+" = "+y+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+v+" = "+y+"["+f+"]; ":" for (var "+v+" in "+d+") { ",a+=" if ("+e.usePattern(se)+".test("+v+")) { ",c.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);B=d+"["+v+"]";c.dataPathArr[m]=v;C=e.validate(c);c.baseId=A,e.util.varOccurences(C,g)<2?a+=" "+e.util.varReplace(C,g,B)+" ":a+=" var "+g+" = "+B+"; "+C+" ",p&&(a+=" if (!"+u+") break; "),a+=" } ",p&&(a+=" else "+u+" = true; "),a+=" } ",p&&(a+=" if ("+u+") { ",P+="}")}}}return p&&(a+=" "+P+" if ("+n+" == errors) {"),a};
|
|
105
|
+
|
|
106
|
+
},{}],36:[function(require,module,exports){
|
|
107
|
+
"use strict";module.exports=function(r,e,a){var t=" ",s=r.level,o=r.dataLevel,l=r.schema[e],i=r.schemaPath+r.util.getProperty(e),v=r.errSchemaPath+"/"+e,c=!r.opts.allErrors,p="data"+(o||""),m="errs__"+s,h=r.util.copy(r);h.level++;var d="valid"+h.level;if(t+="var "+m+" = errors;",r.opts.strictKeywords?"object"==typeof l&&Object.keys(l).length>0||!1===l:r.util.schemaHasRules(l,r.RULES.all)){h.schema=l,h.schemaPath=i,h.errSchemaPath=v;var u="key"+s,n="idx"+s,y="i"+s,E="' + "+u+" + '",P="data"+(h.dataLevel=r.dataLevel+1),f="dataProperties"+s,R=r.opts.ownProperties,b=r.baseId;R&&(t+=" var "+f+" = undefined; "),t+=R?" "+f+" = "+f+" || Object.keys("+p+"); for (var "+n+"=0; "+n+"<"+f+".length; "+n+"++) { var "+u+" = "+f+"["+n+"]; ":" for (var "+u+" in "+p+") { ",t+=" var startErrs"+s+" = errors; ";var g=u,k=r.compositeRule;r.compositeRule=h.compositeRule=!0;var w=r.validate(h);h.baseId=b,r.util.varOccurences(w,P)<2?t+=" "+r.util.varReplace(w,P,g)+" ":t+=" var "+P+" = "+g+"; "+w+" ",r.compositeRule=h.compositeRule=k,t+=" if (!"+d+") { for (var "+y+"=startErrs"+s+"; "+y+"<errors; "+y+"++) { vErrors["+y+"].propertyName = "+u+"; } var err = ",!1!==r.createErrors?(t+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(v)+" , params: { propertyName: '"+E+"' } ",!1!==r.opts.messages&&(t+=" , message: 'property name \\'"+E+"\\' is invalid' "),r.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+p+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&c&&(r.async?t+=" throw new ValidationError(vErrors); ":t+=" validate.errors = vErrors; return false; "),c&&(t+=" break; "),t+=" } }"}return c&&(t+=" if ("+m+" == errors) {"),t};
|
|
108
|
+
|
|
109
|
+
},{}],37:[function(require,module,exports){
|
|
110
|
+
"use strict";module.exports=function(r,e,a){var s,t,o=" ",i=r.level,l=r.dataLevel,c=r.schema[e],n=r.errSchemaPath+"/"+e,h=!r.opts.allErrors,v="data"+(l||""),f="valid"+i;if("#"==c||"#/"==c)r.isRoot?(s=r.async,t="validate"):(s=!0===r.root.schema.$async,t="root.refVal[0]");else{var d=r.resolveRef(r.baseId,c,r.isRoot);if(void 0===d){var p=r.MissingRefError.message(r.baseId,c);if("fail"==r.opts.missingRefs){r.logger.error(p),(g=g||[]).push(o),o="",!1!==r.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(n)+" , params: { ref: '"+r.util.escapeQuotes(c)+"' } ",!1!==r.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+r.util.escapeQuotes(c)+"' "),r.opts.verbose&&(o+=" , schema: "+r.util.toQuotedString(c)+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+v+" "),o+=" } "):o+=" {} ";var m=o;o=g.pop(),!r.compositeRule&&h?r.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(o+=" if (false) { ")}else{if("ignore"!=r.opts.missingRefs)throw new r.MissingRefError(r.baseId,c,p);r.logger.warn(p),h&&(o+=" if (true) { ")}}else if(d.inline){var u=r.util.copy(r);u.level++;var E="valid"+u.level;u.schema=d.schema,u.schemaPath="",u.errSchemaPath=c,o+=" "+r.validate(u).replace(/validate\.schema/g,d.code)+" ",h&&(o+=" if ("+E+") { ")}else s=!0===d.$async||r.async&&!1!==d.$async,t=d.code}if(t){var g;(g=g||[]).push(o),o="",r.opts.passContext?o+=" "+t+".call(this, ":o+=" "+t+"( ",o+=" "+v+", (dataPath || '')",'""'!=r.errorPath&&(o+=" + "+r.errorPath);var y=o+=" , "+(l?"data"+(l-1||""):"parentData")+" , "+(l?r.dataPathArr[l]:"parentDataProperty")+", rootData) ";if(o=g.pop(),s){if(!r.async)throw new Error("async schema referenced by sync schema");h&&(o+=" var "+f+"; "),o+=" try { await "+y+"; ",h&&(o+=" "+f+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",h&&(o+=" "+f+" = false; "),o+=" } ",h&&(o+=" if ("+f+") { ")}else o+=" if (!"+y+") { if (vErrors === null) vErrors = "+t+".errors; else vErrors = vErrors.concat("+t+".errors); errors = vErrors.length; } ",h&&(o+=" else { ")}return o};
|
|
111
|
+
|
|
112
|
+
},{}],38:[function(require,module,exports){
|
|
113
|
+
"use strict";module.exports=function(r,e,a){var t=" ",s=r.level,o=r.dataLevel,i=r.schema[e],h=r.schemaPath+r.util.getProperty(e),p=r.errSchemaPath+"/"+e,l=!r.opts.allErrors,d="data"+(o||""),u="valid"+s,P=r.opts.$data&&i&&i.$data;P&&(t+=" var schema"+s+" = "+r.util.getData(i.$data,o,r.dataPathArr)+"; ");var n="schema"+s;if(!P)if(i.length<r.opts.loopRequired&&r.schema.properties&&Object.keys(r.schema.properties).length){var c=[],m=i;if(m)for(var v,y=-1,g=m.length-1;y<g;){v=m[y+=1];var f=r.schema.properties[v];f&&(r.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:r.util.schemaHasRules(f,r.RULES.all))||(c[c.length]=v)}}else c=i;if(P||c.length){var E=r.errorPath,q=P||c.length>=r.opts.loopRequired,w=r.opts.ownProperties;if(l)if(t+=" var missing"+s+"; ",q){P||(t+=" var "+n+" = validate.schema"+h+"; ");var b="' + "+(_="schema"+s+"["+(D="i"+s)+"]")+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPathExpr(E,_,r.opts.jsonPointers)),t+=" var "+u+" = true; ",P&&(t+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),t+=" for (var "+D+" = 0; "+D+" < "+n+".length; "+D+"++) { "+u+" = "+d+"["+n+"["+D+"]] !== undefined ",w&&(t+=" && Object.prototype.hasOwnProperty.call("+d+", "+n+"["+D+"]) "),t+="; if (!"+u+") break; } ",P&&(t+=" } "),t+=" if (!"+u+") { ",(Q=Q||[]).push(t),t="",!1!==r.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(p)+" , params: { missingProperty: '"+b+"' } ",!1!==r.opts.messages&&(t+=" , message: '",r.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+b+"\\'",t+="' "),r.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+d+" "),t+=" } "):t+=" {} ";var S=t;t=Q.pop(),!r.compositeRule&&l?r.async?t+=" throw new ValidationError(["+S+"]); ":t+=" validate.errors = ["+S+"]; return false; ":t+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var j=c;if(j)for(var D=-1,O=j.length-1;D<O;){R=j[D+=1],D&&(t+=" || "),t+=" ( ( "+(L=d+($=r.util.getProperty(R)))+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+r.util.escapeQuotes(R)+"') "),t+=") && (missing"+s+" = "+r.util.toQuotedString(r.opts.jsonPointers?R:$)+") ) "}t+=") { ";var Q;b="' + "+(_="missing"+s)+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.opts.jsonPointers?r.util.getPathExpr(E,_,!0):E+" + "+_),(Q=Q||[]).push(t),t="",!1!==r.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(p)+" , params: { missingProperty: '"+b+"' } ",!1!==r.opts.messages&&(t+=" , message: '",r.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+b+"\\'",t+="' "),r.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+d+" "),t+=" } "):t+=" {} ";S=t;t=Q.pop(),!r.compositeRule&&l?r.async?t+=" throw new ValidationError(["+S+"]); ":t+=" validate.errors = ["+S+"]; return false; ":t+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else if(q){P||(t+=" var "+n+" = validate.schema"+h+"; ");var _;b="' + "+(_="schema"+s+"["+(D="i"+s)+"]")+" + '";r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPathExpr(E,_,r.opts.jsonPointers)),P&&(t+=" if ("+n+" && !Array.isArray("+n+")) { var err = ",!1!==r.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(p)+" , params: { missingProperty: '"+b+"' } ",!1!==r.opts.messages&&(t+=" , message: '",r.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+b+"\\'",t+="' "),r.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+d+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+n+" !== undefined) { "),t+=" for (var "+D+" = 0; "+D+" < "+n+".length; "+D+"++) { if ("+d+"["+n+"["+D+"]] === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+n+"["+D+"]) "),t+=") { var err = ",!1!==r.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(p)+" , params: { missingProperty: '"+b+"' } ",!1!==r.opts.messages&&(t+=" , message: '",r.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+b+"\\'",t+="' "),r.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+d+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",P&&(t+=" } ")}else{var k=c;if(k)for(var R,A=-1,x=k.length-1;A<x;){R=k[A+=1];var $=r.util.getProperty(R),L=(b=r.util.escapeQuotes(R),d+$);r.opts._errorDataPathProperty&&(r.errorPath=r.util.getPath(E,R,r.opts.jsonPointers)),t+=" if ( "+L+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+r.util.escapeQuotes(R)+"') "),t+=") { var err = ",!1!==r.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(p)+" , params: { missingProperty: '"+b+"' } ",!1!==r.opts.messages&&(t+=" , message: '",r.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+b+"\\'",t+="' "),r.opts.verbose&&(t+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+d+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r.errorPath=E}else l&&(t+=" if (true) {");return t};
|
|
114
|
+
|
|
115
|
+
},{}],39:[function(require,module,exports){
|
|
116
|
+
"use strict";module.exports=function(e,a,r){var t,i=" ",s=e.level,o=e.dataLevel,m=e.schema[a],l=e.schemaPath+e.util.getProperty(a),c=e.errSchemaPath+"/"+a,u=!e.opts.allErrors,d="data"+(o||""),h="valid"+s,n=e.opts.$data&&m&&m.$data;if(n?(i+=" var schema"+s+" = "+e.util.getData(m.$data,o,e.dataPathArr)+"; ",t="schema"+s):t=m,(m||n)&&!1!==e.opts.uniqueItems){n&&(i+=" var "+h+"; if ("+t+" === false || "+t+" === undefined) "+h+" = true; else if (typeof "+t+" != 'boolean') "+h+" = false; else { "),i+=" var i = "+d+".length , "+h+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,v=Array.isArray(f);if(!f||"object"==f||"array"==f||v&&(f.indexOf("object")>=0||f.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+h+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var p="checkDataType"+(v?"s":"");i+=" if ("+e.util[p](f,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",n&&(i+=" } "),i+=" if (!"+h+") { ";var y=y||[];y.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=n?"validate.schema"+l:""+m,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var j=i;i=y.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+j+"]); ":i+=" validate.errors = ["+j+"]; return false; ":i+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u&&(i+=" else { ")}else u&&(i+=" if (true) { ");return i};
|
|
117
|
+
|
|
118
|
+
},{}],40:[function(require,module,exports){
|
|
119
|
+
"use strict";module.exports=function(e,r,a){var t="",s=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),l=e.self._getId(e.schema);if(e.opts.strictKeywords){var i=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==e.opts.strictKeywords)throw new Error(n);e.logger.warn(n)}}if(e.isTop&&(t+=" var validate = ",s&&(e.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",l&&(e.opts.sourceCode||e.opts.processCode)&&(t+=" /*# sourceURL="+l+" */ ")),"boolean"==typeof e.schema||!o&&!e.schema.$ref){var c=e.level,f=e.dataLevel,h=e.schema["false schema"],u=e.schemaPath+e.util.getProperty("false schema"),p=e.errSchemaPath+"/false schema",d=!e.opts.allErrors,m="data"+(f||""),v="valid"+c;if(!1===e.schema){e.isTop?d=!0:t+=" var "+v+" = false; ",(W=W||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'boolean schema is false' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";var y=t;t=W.pop(),!e.compositeRule&&d?e.async?t+=" throw new ValidationError(["+y+"]); ":t+=" validate.errors = ["+y+"]; return false; ":t+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?t+=s?" return data; ":" validate.errors = null; return true; ":t+=" var "+v+" = true; ";return e.isTop&&(t+=" }; return validate; "),t}if(e.isTop){var g=e.isTop;c=e.level=0,f=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var w="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(w);e.logger.warn(w)}t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{c=e.level,m="data"+((f=e.dataLevel)||"");if(l&&(e.baseId=e.resolve.url(e.baseId,l)),s&&!e.async)throw new Error("async schema in sync schema");t+=" var errs_"+c+" = errors;"}v="valid"+c,d=!e.opts.allErrors;var E="",P="",b=e.schema.type,D=Array.isArray(b);if(b&&e.opts.nullable&&!0===e.schema.nullable&&(D?-1==b.indexOf("null")&&(b=b.concat("null")):"null"!=b&&(b=[b,"null"],D=!0)),D&&1==b.length&&(b=b[0],D=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(t+=" "+e.RULES.all.$comment.code(e,"$comment")),b){if(e.opts.coerceTypes)var S=e.util.coerceToTypes(e.opts.coerceTypes,b);var R=e.RULES.types[b];if(S||D||!0===R||R&&!X(R)){u=e.schemaPath+".type",p=e.errSchemaPath+"/type",u=e.schemaPath+".type",p=e.errSchemaPath+"/type";var T=D?"checkDataTypes":"checkDataType";if(t+=" if ("+e.util[T](b,m,e.opts.strictNumbers,!0)+") { ",S){var k="dataType"+c,$="coerced"+c;t+=" var "+k+" = typeof "+m+"; var "+$+" = undefined; ","array"==e.opts.coerceTypes&&(t+=" if ("+k+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+k+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+$+" = "+m+"; } "),t+=" if ("+$+" !== undefined) ; ";var L=S;if(L)for(var j,A=-1,I=L.length-1;A<I;)"string"==(j=L[A+=1])?t+=" else if ("+k+" == 'number' || "+k+" == 'boolean') "+$+" = '' + "+m+"; else if ("+m+" === null) "+$+" = ''; ":"number"==j||"integer"==j?(t+=" else if ("+k+" == 'boolean' || "+m+" === null || ("+k+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==j&&(t+=" && !("+m+" % 1)"),t+=")) "+$+" = +"+m+"; "):"boolean"==j?t+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+$+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+$+" = true; ":"null"==j?t+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+$+" = null; ":"array"==e.opts.coerceTypes&&"array"==j&&(t+=" else if ("+k+" == 'string' || "+k+" == 'number' || "+k+" == 'boolean' || "+m+" == null) "+$+" = ["+m+"]; ");t+=" else { ",(W=W||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",t+=D?""+b.join(","):""+b,t+="' } ",!1!==e.opts.messages&&(t+=" , message: 'should be ",t+=D?""+b.join(","):""+b,t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";y=t;t=W.pop(),!e.compositeRule&&d?e.async?t+=" throw new ValidationError(["+y+"]); ":t+=" validate.errors = ["+y+"]; return false; ":t+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } if ("+$+" !== undefined) { ";var U=f?"data"+(f-1||""):"parentData";t+=" "+m+" = "+$+"; ",f||(t+="if ("+U+" !== undefined)"),t+=" "+U+"["+(f?e.dataPathArr[f]:"parentDataProperty")+"] = "+$+"; } "}else{(W=W||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",t+=D?""+b.join(","):""+b,t+="' } ",!1!==e.opts.messages&&(t+=" , message: 'should be ",t+=D?""+b.join(","):""+b,t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";y=t;t=W.pop(),!e.compositeRule&&d?e.async?t+=" throw new ValidationError(["+y+"]); ":t+=" validate.errors = ["+y+"]; return false; ":t+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}t+=" } "}}if(e.schema.$ref&&!o)t+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",d&&(t+=" } if (errors === ",t+=g?"0":"errs_"+c,t+=") { ",P+="}");else{var x=e.RULES;if(x)for(var _=-1,N=x.length-1;_<N;)if(X(R=x[_+=1])){if(R.type&&(t+=" if ("+e.util.checkDataType(R.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==R.type&&e.schema.properties){h=e.schema.properties;var V=Object.keys(h);if(V)for(var O,Q=-1,C=V.length-1;Q<C;){if(void 0!==(H=h[O=V[Q+=1]]).default){var J=m+e.util.getProperty(O);if(e.compositeRule){if(e.opts.strictDefaults){w="default is ignored for: "+J;if("log"!==e.opts.strictDefaults)throw new Error(w);e.logger.warn(w)}}else t+=" if ("+J+" === undefined ","empty"==e.opts.useDefaults&&(t+=" || "+J+" === null || "+J+" === '' "),t+=" ) "+J+" = ","shared"==e.opts.useDefaults?t+=" "+e.useDefault(H.default)+" ":t+=" "+JSON.stringify(H.default)+" ",t+="; "}}}else if("array"==R.type&&Array.isArray(e.schema.items)){var K=e.schema.items;if(K){A=-1;for(var H,q=K.length-1;A<q;)if(void 0!==(H=K[A+=1]).default){J=m+"["+A+"]";if(e.compositeRule){if(e.opts.strictDefaults){w="default is ignored for: "+J;if("log"!==e.opts.strictDefaults)throw new Error(w);e.logger.warn(w)}}else t+=" if ("+J+" === undefined ","empty"==e.opts.useDefaults&&(t+=" || "+J+" === null || "+J+" === '' "),t+=" ) "+J+" = ","shared"==e.opts.useDefaults?t+=" "+e.useDefault(H.default)+" ":t+=" "+JSON.stringify(H.default)+" ",t+="; "}}}var z=R.rules;if(z)for(var B,F=-1,G=z.length-1;F<G;)if(Y(B=z[F+=1])){var M=B.code(e,B.keyword,R.type);M&&(t+=" "+M+" ",d&&(E+="}"))}if(d&&(t+=" "+E+" ",E=""),R.type&&(t+=" } ",b&&b===R.type&&!S)){t+=" else { ";var W;u=e.schemaPath+".type",p=e.errSchemaPath+"/type";(W=W||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",t+=D?""+b.join(","):""+b,t+="' } ",!1!==e.opts.messages&&(t+=" , message: 'should be ",t+=D?""+b.join(","):""+b,t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";y=t;t=W.pop(),!e.compositeRule&&d?e.async?t+=" throw new ValidationError(["+y+"]); ":t+=" validate.errors = ["+y+"]; return false; ":t+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } "}d&&(t+=" if (errors === ",t+=g?"0":"errs_"+c,t+=") { ",P+="}")}}function X(e){for(var r=e.rules,a=0;a<r.length;a++)if(Y(r[a]))return!0}function Y(r){return void 0!==e.schema[r.keyword]||r.implements&&function(r){for(var a=r.implements,t=0;t<a.length;t++)if(void 0!==e.schema[a[t]])return!0}(r)}return d&&(t+=" "+P+" "),g?(s?(t+=" if (errors === 0) return data; ",t+=" else throw new ValidationError(vErrors); "):(t+=" validate.errors = vErrors; ",t+=" return errors === 0; "),t+=" }; return validate;"):t+=" var "+v+" = errors === errs_"+c+";",t};
|
|
120
|
+
|
|
121
|
+
},{}],41:[function(require,module,exports){
|
|
122
|
+
"use strict";var IDENTIFIER=/^[a-z_$][a-z0-9_$-]*$/i,customRuleCode=require("./dotjs/custom"),definitionSchema=require("./definition_schema");function addKeyword(e,r){var t=this.RULES;if(t.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!IDENTIFIER.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(r){this.validateKeyword(r,!0);var i=r.type;if(Array.isArray(i))for(var o=0;o<i.length;o++)d(e,i[o],r);else d(e,i,r);var a=r.metaSchema;a&&(r.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),r.validateSchema=this.compile(a,!0))}function d(e,r,i){for(var o,a=0;a<t.length;a++){var d=t[a];if(d.type==r){o=d;break}}o||(o={type:r,rules:[]},t.push(o));var s={keyword:e,definition:i,custom:!0,code:customRuleCode,implements:i.implements};o.rules.push(s),t.custom[e]=s}return t.keywords[e]=t.all[e]=!0,this}function getKeyword(e){var r=this.RULES.custom[e];return r?r.definition:this.RULES.keywords[e]||!1}function removeKeyword(e){var r=this.RULES;delete r.keywords[e],delete r.all[e],delete r.custom[e];for(var t=0;t<r.length;t++)for(var i=r[t].rules,o=0;o<i.length;o++)if(i[o].keyword==e){i.splice(o,1);break}return this}function validateKeyword(e,r){validateKeyword.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(definitionSchema,!0);if(t(e))return!0;if(validateKeyword.errors=t.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}module.exports={add:addKeyword,get:getKeyword,remove:removeKeyword,validate:validateKeyword};
|
|
123
|
+
|
|
124
|
+
},{"./definition_schema":14,"./dotjs/custom":24}],42:[function(require,module,exports){
|
|
125
|
+
module.exports={
|
|
126
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
127
|
+
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
128
|
+
"description": "Meta-schema for $data reference (JSON Schema extension proposal)",
|
|
129
|
+
"type": "object",
|
|
130
|
+
"required": [ "$data" ],
|
|
131
|
+
"properties": {
|
|
132
|
+
"$data": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"anyOf": [
|
|
135
|
+
{ "format": "relative-json-pointer" },
|
|
136
|
+
{ "format": "json-pointer" }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
},{}],43:[function(require,module,exports){
|
|
144
|
+
module.exports={
|
|
145
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
146
|
+
"$id": "http://json-schema.org/draft-06/schema#",
|
|
147
|
+
"title": "Core schema meta-schema",
|
|
148
|
+
"definitions": {
|
|
149
|
+
"schemaArray": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"minItems": 1,
|
|
152
|
+
"items": { "$ref": "#" }
|
|
153
|
+
},
|
|
154
|
+
"nonNegativeInteger": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"minimum": 0
|
|
157
|
+
},
|
|
158
|
+
"nonNegativeIntegerDefault0": {
|
|
159
|
+
"allOf": [
|
|
160
|
+
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
161
|
+
{ "default": 0 }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"simpleTypes": {
|
|
165
|
+
"enum": [
|
|
166
|
+
"array",
|
|
167
|
+
"boolean",
|
|
168
|
+
"integer",
|
|
169
|
+
"null",
|
|
170
|
+
"number",
|
|
171
|
+
"object",
|
|
172
|
+
"string"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"stringArray": {
|
|
176
|
+
"type": "array",
|
|
177
|
+
"items": { "type": "string" },
|
|
178
|
+
"uniqueItems": true,
|
|
179
|
+
"default": []
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"type": ["object", "boolean"],
|
|
183
|
+
"properties": {
|
|
184
|
+
"$id": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"format": "uri-reference"
|
|
187
|
+
},
|
|
188
|
+
"$schema": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"format": "uri"
|
|
191
|
+
},
|
|
192
|
+
"$ref": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"format": "uri-reference"
|
|
195
|
+
},
|
|
196
|
+
"title": {
|
|
197
|
+
"type": "string"
|
|
198
|
+
},
|
|
199
|
+
"description": {
|
|
200
|
+
"type": "string"
|
|
201
|
+
},
|
|
202
|
+
"default": {},
|
|
203
|
+
"examples": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": {}
|
|
206
|
+
},
|
|
207
|
+
"multipleOf": {
|
|
208
|
+
"type": "number",
|
|
209
|
+
"exclusiveMinimum": 0
|
|
210
|
+
},
|
|
211
|
+
"maximum": {
|
|
212
|
+
"type": "number"
|
|
213
|
+
},
|
|
214
|
+
"exclusiveMaximum": {
|
|
215
|
+
"type": "number"
|
|
216
|
+
},
|
|
217
|
+
"minimum": {
|
|
218
|
+
"type": "number"
|
|
219
|
+
},
|
|
220
|
+
"exclusiveMinimum": {
|
|
221
|
+
"type": "number"
|
|
222
|
+
},
|
|
223
|
+
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
224
|
+
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
225
|
+
"pattern": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"format": "regex"
|
|
228
|
+
},
|
|
229
|
+
"additionalItems": { "$ref": "#" },
|
|
230
|
+
"items": {
|
|
231
|
+
"anyOf": [
|
|
232
|
+
{ "$ref": "#" },
|
|
233
|
+
{ "$ref": "#/definitions/schemaArray" }
|
|
234
|
+
],
|
|
235
|
+
"default": {}
|
|
236
|
+
},
|
|
237
|
+
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
238
|
+
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
239
|
+
"uniqueItems": {
|
|
240
|
+
"type": "boolean",
|
|
241
|
+
"default": false
|
|
242
|
+
},
|
|
243
|
+
"contains": { "$ref": "#" },
|
|
244
|
+
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
245
|
+
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
246
|
+
"required": { "$ref": "#/definitions/stringArray" },
|
|
247
|
+
"additionalProperties": { "$ref": "#" },
|
|
248
|
+
"definitions": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"additionalProperties": { "$ref": "#" },
|
|
251
|
+
"default": {}
|
|
252
|
+
},
|
|
253
|
+
"properties": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"additionalProperties": { "$ref": "#" },
|
|
256
|
+
"default": {}
|
|
257
|
+
},
|
|
258
|
+
"patternProperties": {
|
|
259
|
+
"type": "object",
|
|
260
|
+
"additionalProperties": { "$ref": "#" },
|
|
261
|
+
"default": {}
|
|
262
|
+
},
|
|
263
|
+
"dependencies": {
|
|
264
|
+
"type": "object",
|
|
265
|
+
"additionalProperties": {
|
|
266
|
+
"anyOf": [
|
|
267
|
+
{ "$ref": "#" },
|
|
268
|
+
{ "$ref": "#/definitions/stringArray" }
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"propertyNames": { "$ref": "#" },
|
|
273
|
+
"const": {},
|
|
274
|
+
"enum": {
|
|
275
|
+
"type": "array",
|
|
276
|
+
"minItems": 1,
|
|
277
|
+
"uniqueItems": true
|
|
278
|
+
},
|
|
279
|
+
"type": {
|
|
280
|
+
"anyOf": [
|
|
281
|
+
{ "$ref": "#/definitions/simpleTypes" },
|
|
282
|
+
{
|
|
283
|
+
"type": "array",
|
|
284
|
+
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
285
|
+
"minItems": 1,
|
|
286
|
+
"uniqueItems": true
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
"format": { "type": "string" },
|
|
291
|
+
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
292
|
+
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
293
|
+
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
294
|
+
"not": { "$ref": "#" }
|
|
295
|
+
},
|
|
296
|
+
"default": {}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
},{}],44:[function(require,module,exports){
|
|
300
|
+
module.exports={
|
|
301
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
302
|
+
"$id": "http://json-schema.org/draft-07/schema#",
|
|
303
|
+
"title": "Core schema meta-schema",
|
|
304
|
+
"definitions": {
|
|
305
|
+
"schemaArray": {
|
|
306
|
+
"type": "array",
|
|
307
|
+
"minItems": 1,
|
|
308
|
+
"items": { "$ref": "#" }
|
|
309
|
+
},
|
|
310
|
+
"nonNegativeInteger": {
|
|
311
|
+
"type": "integer",
|
|
312
|
+
"minimum": 0
|
|
313
|
+
},
|
|
314
|
+
"nonNegativeIntegerDefault0": {
|
|
315
|
+
"allOf": [
|
|
316
|
+
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
317
|
+
{ "default": 0 }
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"simpleTypes": {
|
|
321
|
+
"enum": [
|
|
322
|
+
"array",
|
|
323
|
+
"boolean",
|
|
324
|
+
"integer",
|
|
325
|
+
"null",
|
|
326
|
+
"number",
|
|
327
|
+
"object",
|
|
328
|
+
"string"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"stringArray": {
|
|
332
|
+
"type": "array",
|
|
333
|
+
"items": { "type": "string" },
|
|
334
|
+
"uniqueItems": true,
|
|
335
|
+
"default": []
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"type": ["object", "boolean"],
|
|
339
|
+
"properties": {
|
|
340
|
+
"$id": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"format": "uri-reference"
|
|
343
|
+
},
|
|
344
|
+
"$schema": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"format": "uri"
|
|
347
|
+
},
|
|
348
|
+
"$ref": {
|
|
349
|
+
"type": "string",
|
|
350
|
+
"format": "uri-reference"
|
|
351
|
+
},
|
|
352
|
+
"$comment": {
|
|
353
|
+
"type": "string"
|
|
354
|
+
},
|
|
355
|
+
"title": {
|
|
356
|
+
"type": "string"
|
|
357
|
+
},
|
|
358
|
+
"description": {
|
|
359
|
+
"type": "string"
|
|
360
|
+
},
|
|
361
|
+
"default": true,
|
|
362
|
+
"readOnly": {
|
|
363
|
+
"type": "boolean",
|
|
364
|
+
"default": false
|
|
365
|
+
},
|
|
366
|
+
"examples": {
|
|
367
|
+
"type": "array",
|
|
368
|
+
"items": true
|
|
369
|
+
},
|
|
370
|
+
"multipleOf": {
|
|
371
|
+
"type": "number",
|
|
372
|
+
"exclusiveMinimum": 0
|
|
373
|
+
},
|
|
374
|
+
"maximum": {
|
|
375
|
+
"type": "number"
|
|
376
|
+
},
|
|
377
|
+
"exclusiveMaximum": {
|
|
378
|
+
"type": "number"
|
|
379
|
+
},
|
|
380
|
+
"minimum": {
|
|
381
|
+
"type": "number"
|
|
382
|
+
},
|
|
383
|
+
"exclusiveMinimum": {
|
|
384
|
+
"type": "number"
|
|
385
|
+
},
|
|
386
|
+
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
387
|
+
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
388
|
+
"pattern": {
|
|
389
|
+
"type": "string",
|
|
390
|
+
"format": "regex"
|
|
391
|
+
},
|
|
392
|
+
"additionalItems": { "$ref": "#" },
|
|
393
|
+
"items": {
|
|
394
|
+
"anyOf": [
|
|
395
|
+
{ "$ref": "#" },
|
|
396
|
+
{ "$ref": "#/definitions/schemaArray" }
|
|
397
|
+
],
|
|
398
|
+
"default": true
|
|
399
|
+
},
|
|
400
|
+
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
401
|
+
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
402
|
+
"uniqueItems": {
|
|
403
|
+
"type": "boolean",
|
|
404
|
+
"default": false
|
|
405
|
+
},
|
|
406
|
+
"contains": { "$ref": "#" },
|
|
407
|
+
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
408
|
+
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
409
|
+
"required": { "$ref": "#/definitions/stringArray" },
|
|
410
|
+
"additionalProperties": { "$ref": "#" },
|
|
411
|
+
"definitions": {
|
|
412
|
+
"type": "object",
|
|
413
|
+
"additionalProperties": { "$ref": "#" },
|
|
414
|
+
"default": {}
|
|
415
|
+
},
|
|
416
|
+
"properties": {
|
|
417
|
+
"type": "object",
|
|
418
|
+
"additionalProperties": { "$ref": "#" },
|
|
419
|
+
"default": {}
|
|
420
|
+
},
|
|
421
|
+
"patternProperties": {
|
|
422
|
+
"type": "object",
|
|
423
|
+
"additionalProperties": { "$ref": "#" },
|
|
424
|
+
"propertyNames": { "format": "regex" },
|
|
425
|
+
"default": {}
|
|
426
|
+
},
|
|
427
|
+
"dependencies": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"additionalProperties": {
|
|
430
|
+
"anyOf": [
|
|
431
|
+
{ "$ref": "#" },
|
|
432
|
+
{ "$ref": "#/definitions/stringArray" }
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"propertyNames": { "$ref": "#" },
|
|
437
|
+
"const": true,
|
|
438
|
+
"enum": {
|
|
439
|
+
"type": "array",
|
|
440
|
+
"items": true,
|
|
441
|
+
"minItems": 1,
|
|
442
|
+
"uniqueItems": true
|
|
443
|
+
},
|
|
444
|
+
"type": {
|
|
445
|
+
"anyOf": [
|
|
446
|
+
{ "$ref": "#/definitions/simpleTypes" },
|
|
447
|
+
{
|
|
448
|
+
"type": "array",
|
|
449
|
+
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
450
|
+
"minItems": 1,
|
|
451
|
+
"uniqueItems": true
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
"format": { "type": "string" },
|
|
456
|
+
"contentMediaType": { "type": "string" },
|
|
457
|
+
"contentEncoding": { "type": "string" },
|
|
458
|
+
"if": {"$ref": "#"},
|
|
459
|
+
"then": {"$ref": "#"},
|
|
460
|
+
"else": {"$ref": "#"},
|
|
461
|
+
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
462
|
+
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
463
|
+
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
464
|
+
"not": { "$ref": "#" }
|
|
465
|
+
},
|
|
466
|
+
"default": true
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
},{}],45:[function(require,module,exports){
|
|
470
|
+
"use strict";exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){var r,e,t=getLens(o),n=t[0],u=t[1],p=new Arr(_byteLength(o,n,u)),a=0,h=u>0?n-4:n;for(e=0;e<h;e+=4)r=revLookup[o.charCodeAt(e)]<<18|revLookup[o.charCodeAt(e+1)]<<12|revLookup[o.charCodeAt(e+2)]<<6|revLookup[o.charCodeAt(e+3)],p[a++]=r>>16&255,p[a++]=r>>8&255,p[a++]=255&r;return 2===u&&(r=revLookup[o.charCodeAt(e)]<<2|revLookup[o.charCodeAt(e+1)]>>4,p[a++]=255&r),1===u&&(r=revLookup[o.charCodeAt(e)]<<10|revLookup[o.charCodeAt(e+1)]<<4|revLookup[o.charCodeAt(e+2)]>>2,p[a++]=r>>8&255,p[a++]=255&r),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;u<e;u+=3)t=(o[u]<<16&16711680)+(o[u+1]<<8&65280)+(255&o[u+2]),n.push(tripletToBase64(t));return n.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,n=[],u=0,p=e-t;u<p;u+=16383)n.push(encodeChunk(o,u,u+16383>p?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;
|
|
471
|
+
|
|
472
|
+
},{}],46:[function(require,module,exports){
|
|
473
|
+
|
|
474
|
+
},{}],47:[function(require,module,exports){
|
|
475
|
+
(function (global){
|
|
476
|
+
!function(e){var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,n="object"==typeof module&&module&&!module.nodeType&&module,t="object"==typeof global&&global;t.global!==t&&t.window!==t&&t.self!==t||(e=t);var r,u,i=2147483647,f=36,c=1,l=26,s=38,d=700,p=72,a=128,h="-",v=/^xn--/,g=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=f-c,y=Math.floor,C=String.fromCharCode;function m(e){throw new RangeError(x[e])}function j(e,o){for(var n=e.length,t=[];n--;)t[n]=o(e[n]);return t}function A(e,o){var n=e.split("@"),t="";return n.length>1&&(t=n[0]+"@",e=n[1]),t+j((e=e.replace(w,".")).split("."),o).join(".")}function I(e){for(var o,n,t=[],r=0,u=e.length;r<u;)(o=e.charCodeAt(r++))>=55296&&o<=56319&&r<u?56320==(64512&(n=e.charCodeAt(r++)))?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--):t.push(o);return t}function E(e){return j(e,function(e){var o="";return e>65535&&(o+=C((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=C(e)}).join("")}function F(e,o){return e+22+75*(e<26)-((0!=o)<<5)}function O(e,o,n){var t=0;for(e=n?y(e/d):e>>1,e+=y(e/o);e>b*l>>1;t+=f)e=y(e/b);return y(t+(b+1)*e/(e+s))}function S(e){var o,n,t,r,u,s,d,v,g,w,x,b=[],C=e.length,j=0,A=a,I=p;for((n=e.lastIndexOf(h))<0&&(n=0),t=0;t<n;++t)e.charCodeAt(t)>=128&&m("not-basic"),b.push(e.charCodeAt(t));for(r=n>0?n+1:0;r<C;){for(u=j,s=1,d=f;r>=C&&m("invalid-input"),((v=(x=e.charCodeAt(r++))-48<10?x-22:x-65<26?x-65:x-97<26?x-97:f)>=f||v>y((i-j)/s))&&m("overflow"),j+=v*s,!(v<(g=d<=I?c:d>=I+l?l:d-I));d+=f)s>y(i/(w=f-g))&&m("overflow"),s*=w;I=O(j-u,o=b.length+1,0==u),y(j/o)>i-A&&m("overflow"),A+=y(j/o),j%=o,b.splice(j++,0,A)}return E(b)}function T(e){var o,n,t,r,u,s,d,v,g,w,x,b,j,A,E,S=[];for(b=(e=I(e)).length,o=a,n=0,u=p,s=0;s<b;++s)(x=e[s])<128&&S.push(C(x));for(t=r=S.length,r&&S.push(h);t<b;){for(d=i,s=0;s<b;++s)(x=e[s])>=o&&x<d&&(d=x);for(d-o>y((i-n)/(j=t+1))&&m("overflow"),n+=(d-o)*j,o=d,s=0;s<b;++s)if((x=e[s])<o&&++n>i&&m("overflow"),x==o){for(v=n,g=f;!(v<(w=g<=u?c:g>=u+l?l:g-u));g+=f)E=v-w,A=f-w,S.push(C(F(w+E%A,0))),v=y(E/A);S.push(C(F(v,0))),u=O(n,j,t==r),n=0,++t}++n,++o}return S.join("")}if(r={version:"1.4.1",ucs2:{decode:I,encode:E},decode:S,encode:T,toASCII:function(e){return A(e,function(e){return g.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return A(e,function(e){return v.test(e)?S(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return r});else if(o&&n)if(module.exports==o)n.exports=r;else for(u in r)r.hasOwnProperty(u)&&(o[u]=r[u]);else e.punycode=r}(this);
|
|
477
|
+
|
|
478
|
+
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
479
|
+
},{}],48:[function(require,module,exports){
|
|
480
|
+
(function (Buffer){
|
|
481
|
+
"use strict";var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=Buffer.prototype,t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=Buffer.prototype,n}function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),r=createBuffer(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;i<u;i++)if(a(e,i)===a(t,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*o}else-1!==h&&(i-=i-h),h=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(e,i+l)!==a(t,l)){c=!1;break}if(c)return i}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var f=e.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(t.substr(2*o,2),16);if(numberIsNaN(u))return o;e[r+o]=u}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?base64.fromByteArray(e):base64.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],f=t;f<r;){var i,o,u,s,a=e[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);f<i;++f)if(e[f]!==t[f]){r=e[f],n=t[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),f=0;for(r=0;r<e.length;++r){var i=e[r];if(isInstance(i,Uint8Array)&&(i=Buffer.from(i)),!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function(){var e="",t=exports.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(127&e[f]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(e[f]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=t;i<r;++i)f+=toHex(e[i]);return f}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=Buffer.prototype,n},Buffer.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n},Buffer.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i<r&&(f*=256);)this[t+i]=e/f&255;return t+r},Buffer.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var f=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=f-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=Buffer.isBuffer(e)?e:Buffer.from(e,n),u=o.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,f=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,f,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f<n&&!(f+r>=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}
|
|
482
|
+
|
|
483
|
+
}).call(this,require("buffer").Buffer)
|
|
484
|
+
},{"base64-js":45,"buffer":48,"ieee754":146}],49:[function(require,module,exports){
|
|
485
|
+
(function (Buffer){
|
|
486
|
+
function isArray(r){return Array.isArray?Array.isArray(r):"[object Array]"===objectToString(r)}function isBoolean(r){return"boolean"==typeof r}function isNull(r){return null===r}function isNullOrUndefined(r){return null==r}function isNumber(r){return"number"==typeof r}function isString(r){return"string"==typeof r}function isSymbol(r){return"symbol"==typeof r}function isUndefined(r){return void 0===r}function isRegExp(r){return"[object RegExp]"===objectToString(r)}function isObject(r){return"object"==typeof r&&null!==r}function isDate(r){return"[object Date]"===objectToString(r)}function isError(r){return"[object Error]"===objectToString(r)||r instanceof Error}function isFunction(r){return"function"==typeof r}function isPrimitive(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function objectToString(r){return Object.prototype.toString.call(r)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer;
|
|
487
|
+
|
|
488
|
+
}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
|
|
489
|
+
},{"../../is-buffer/index.js":148}],50:[function(require,module,exports){
|
|
490
|
+
(function (process){
|
|
491
|
+
function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+exports.humanize(this.diff),o){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(n=t))}),e.splice(n,0,r)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(e){try{null==e?exports.storage.removeItem("debug"):exports.storage.debug=e}catch(e){}}function load(){var e;try{e=exports.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function localstorage(){try{return window.localStorage}catch(e){}}exports=module.exports=require("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},exports.enable(load());
|
|
492
|
+
|
|
493
|
+
}).call(this,require('_process'))
|
|
494
|
+
},{"./debug":51,"_process":158}],51:[function(require,module,exports){
|
|
495
|
+
var prevTime;function selectColor(e){var r,t=0;for(r in e)t=(t<<5)-t+e.charCodeAt(r),t|=0;return exports.colors[Math.abs(t)%exports.colors.length]}function createDebug(e){function r(){if(r.enabled){var e=r,t=+new Date,o=t-(prevTime||t);e.diff=o,e.prev=prevTime,e.curr=t,prevTime=t;for(var s=new Array(arguments.length),n=0;n<s.length;n++)s[n]=arguments[n];s[0]=exports.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var p=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,t){if("%%"===r)return r;p++;var o=exports.formatters[t];if("function"==typeof o){var n=s[p];r=o.call(e,n),s.splice(p,1),p--}return r}),exports.formatArgs.call(e,s),(r.log||exports.log||console.log.bind(console)).apply(e,s)}}return r.namespace=e,r.enabled=exports.enabled(e),r.useColors=exports.useColors(),r.color=selectColor(e),"function"==typeof exports.init&&exports.init(r),r}function enable(e){exports.save(e),exports.names=[],exports.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),t=r.length,o=0;o<t;o++)r[o]&&("-"===(e=r[o].replace(/\*/g,".*?"))[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,t;for(r=0,t=exports.skips.length;r<t;r++)if(exports.skips[r].test(e))return!1;for(r=0,t=exports.names.length;r<t;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=createDebug.debug=createDebug.default=createDebug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.humanize=require("ms"),exports.names=[],exports.skips=[],exports.formatters={};
|
|
496
|
+
|
|
497
|
+
},{"ms":154}],52:[function(require,module,exports){
|
|
498
|
+
var Stream=require("stream"),writeMethods=["write","end","destroy"],readMethods=["resume","pause"],readEvents=["data","close"],slice=Array.prototype.slice;function forEach(e,r){if(e.forEach)return e.forEach(r);for(var t=0;t<e.length;t++)r(e[t],t)}function duplex(e,r){var t=new Stream,n=!1;return forEach(writeMethods,function(r){t[r]=function(){return e[r].apply(e,arguments)}}),forEach(readMethods,function(e){t[e]=function(){t.emit(e);var n=r[e];if(n)return n.apply(r,arguments);r.emit(e)}}),forEach(readEvents,function(e){r.on(e,function(){var r=slice.call(arguments);r.unshift(e),t.emit.apply(t,r)})}),r.on("end",function(){if(n)return;n=!0;var e=slice.call(arguments);e.unshift("end"),t.emit.apply(t,e)}),e.on("drain",function(){t.emit("drain")}),e.on("error",a),r.on("error",a),t.writable=e.writable,t.readable=r.readable,t;function a(e){t.emit("error",e)}}module.exports=duplex;
|
|
499
|
+
|
|
500
|
+
},{"stream":179}],53:[function(require,module,exports){
|
|
501
|
+
(function (process,global,Buffer){
|
|
502
|
+
var Stream=require("stream").Stream,es=exports,through=require("through"),from=require("from"),duplex=require("duplexer"),map=require("map-stream"),pause=require("pause-stream"),split=require("split"),pipeline=require("stream-combiner"),immediately=global.setImmediate||process.nextTick;es.Stream=Stream,es.through=through,es.from=from,es.duplex=duplex,es.map=map,es.pause=pause,es.split=split,es.pipeline=es.connect=es.pipe=pipeline,es.concat=es.merge=function(){var e=[].slice.call(arguments);1===e.length&&e[0]instanceof Array&&(e=e[0]);var r=new Stream;r.setMaxListeners(0);var t=0;return r.writable=r.readable=!0,e.length?e.forEach(function(n){n.pipe(r,{end:!1});var i=!1;n.on("end",function(){i||(i=!0,++t==e.length&&r.emit("end"))})}):process.nextTick(function(){r.emit("end")}),r.write=function(e){this.emit("data",e)},r.destroy=function(){e.forEach(function(e){e.destroy&&e.destroy()})},r},es.writeArray=function(e){if("function"!=typeof e)throw new Error("function writeArray (done): done must be function");var r=new Stream,t=[],n=!1;return r.write=function(e){t.push(e)},r.end=function(){n=!0,e(null,t)},r.writable=!0,r.readable=!1,r.destroy=function(){r.writable=r.readable=!1,n||e(new Error("destroyed before end"),t)},r},es.readArray=function(e){var r=new Stream,t=0,n=!1,i=!1;if(r.readable=!0,r.writable=!1,!Array.isArray(e))throw new Error("event-stream.read expects an array");return r.resume=function(){if(!i){n=!1;for(var o=e.length;t<o&&!n&&!i;)r.emit("data",e[t++]);t!=o||i||(i=!0,r.readable=!1,r.emit("end"))}},process.nextTick(r.resume),r.pause=function(){n=!0},r.destroy=function(){i=!0,r.emit("close")},r},es.readable=function(e,r){var t=new Stream,n=0,i=!1,o=!1,a=!1;if(t.readable=!0,t.writable=!1,"function"!=typeof e)throw new Error("event-stream.readable expects async function");function s(u,c){u?(t.emit("error",u),r||t.emit("end")):arguments.length>1&&t.emit("data",c),immediately(function(){if(!(o||i||a))try{a=!0,e.call(t,n++,function(){a=!1,s.apply(null,arguments)})}catch(e){t.emit("error",e)}})}return t.on("end",function(){o=!0}),t.resume=function(){i=!1,s()},process.nextTick(s),t.pause=function(){i=!0},t.destroy=function(){t.emit("end"),t.emit("close"),o=!0},t},es.mapSync=function(e){return es.through(function(r){var t;try{t=e(r)}catch(e){return this.emit("error",e)}void 0!==t&&this.emit("data",t)})},es.log=function(e){return es.through(function(r){[].slice.call(arguments);e?console.error(e,r):console.error(r),this.emit("data",r)})},es.child=function(e){return es.duplex(e.stdin,e.stdout)},es.parse=function(e){var r=!(!e||!e.error);return es.through(function(e){var t;try{e&&(t=JSON.parse(e.toString()))}catch(t){return r?this.emit("error",t):console.error(t,"attempting to parse:",e)}void 0!==t&&this.emit("data",t)})},es.stringify=function(){var e=require("buffer").Buffer;return es.mapSync(function(r){return JSON.stringify(e.isBuffer(r)?r.toString():r)+"\n"})},es.replace=function(e,r){return es.pipeline(es.split(e),es.join(r))},es.join=function(e){if("function"==typeof e)return es.wait(e);var r=!0;return es.through(function(t){return r||this.emit("data",e),r=!1,this.emit("data",t),!0})},es.wait=function(e){var r=[];return es.through(function(e){r.push(e)},function(){var t=Buffer.isBuffer(r[0])?Buffer.concat(r):r.join("");this.emit("data",t),this.emit("end"),e&&e(null,t)})},es.pipeable=function(){throw new Error("[EVENT-STREAM] es.pipeable is deprecated")};
|
|
503
|
+
|
|
504
|
+
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
|
|
505
|
+
},{"_process":158,"buffer":48,"duplexer":52,"from":58,"map-stream":153,"pause-stream":156,"split":178,"stream":179,"stream-combiner":180,"through":183}],54:[function(require,module,exports){
|
|
506
|
+
var objectCreate=Object.create||objectCreatePolyfill,objectKeys=Object.keys||objectKeysPolyfill,bind=Function.prototype.bind||functionBindPolyfill;function EventEmitter(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=objectCreate(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0;var hasDefineProperty,defaultMaxListeners=10;try{var o={};Object.defineProperty&&Object.defineProperty(o,"x",{value:0}),hasDefineProperty=0===o.x}catch(e){hasDefineProperty=!1}function $getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function emitNone(e,t,n){if(t)e.call(n);else for(var r=e.length,i=arrayClone(e,r),s=0;s<r;++s)i[s].call(n)}function emitOne(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,s=arrayClone(e,i),o=0;o<i;++o)s[o].call(n,r)}function emitTwo(e,t,n,r,i){if(t)e.call(n,r,i);else for(var s=e.length,o=arrayClone(e,s),a=0;a<s;++a)o[a].call(n,r,i)}function emitThree(e,t,n,r,i,s){if(t)e.call(n,r,i,s);else for(var o=e.length,a=arrayClone(e,o),l=0;l<o;++l)a[l].call(n,r,i,s)}function emitMany(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,s=arrayClone(e,i),o=0;o<i;++o)s[o].apply(n,r)}function _addListener(e,t,n,r){var i,s,o;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]):(s=e._events=objectCreate(null),e._eventsCount=0),o){if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=$getMaxListeners(e))&&i>0&&o.length>i){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",a.name,a.message)}}else o=s[t]=n,++e._eventsCount;return e}function onceWrapper(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function _onceWrap(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=bind.call(onceWrapper,r);return i.listener=n,r.wrapFn=i,i}function _listeners(e,t,n){var r=e._events;if(!r)return[];var i=r[t];return i?"function"==typeof i?n?[i.listener||i]:[i]:n?unwrapListeners(i):arrayClone(i,i.length):[]}function listenerCount(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function arrayClone(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function objectCreatePolyfill(e){var t=function(){};return t.prototype=e,new t}function objectKeysPolyfill(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n}function functionBindPolyfill(e){var t=this;return function(){return t.apply(e,arguments)}}hasDefineProperty?Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');defaultMaxListeners=e}}):EventEmitter.defaultMaxListeners=defaultMaxListeners,EventEmitter.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function(){return $getMaxListeners(this)},EventEmitter.prototype.emit=function(e){var t,n,r,i,s,o,a="error"===e;if(o=this._events)a=a&&null==o.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var l=new Error('Unhandled "error" event. ('+t+")");throw l.context=t,l}if(!(n=o[e]))return!1;var u="function"==typeof n;switch(r=arguments.length){case 1:emitNone(n,u,this);break;case 2:emitOne(n,u,this,arguments[1]);break;case 3:emitTwo(n,u,this,arguments[1],arguments[2]);break;case 4:emitThree(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),s=1;s<r;s++)i[s-1]=arguments[s];emitMany(n,u,this,i)}return!0},EventEmitter.prototype.addListener=function(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function(e,t){var n,r,i,s,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=objectCreate(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():spliceOne(n,i),1===n.length&&(r[e]=n[0]),r.removeListener&&this.emit("removeListener",e,o||t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,n,r;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=objectCreate(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=objectCreate(null):delete n[e]),this;if(0===arguments.length){var i,s=objectKeys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=objectCreate(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};
|
|
507
|
+
|
|
508
|
+
},{}],55:[function(require,module,exports){
|
|
509
|
+
"use strict";module.exports=function r(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var o,n,u;if(Array.isArray(t)){if((o=t.length)!=e.length)return!1;for(n=o;0!=n--;)if(!r(t[n],e[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((o=(u=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,u[n]))return!1;for(n=o;0!=n--;){var f=u[n];if(!r(t[f],e[f]))return!1}return!0}return t!=t&&e!=e};
|
|
510
|
+
|
|
511
|
+
},{}],56:[function(require,module,exports){
|
|
512
|
+
"use strict";module.exports=function(r,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var e,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(e=t.cmp,function(r){return function(t,n){var i={key:t,value:r[t]},u={key:n,value:r[n]};return e(i,u)}}),u=[];return function r(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var e,o;if(Array.isArray(t)){for(o="[",e=0;e<t.length;e++)e&&(o+=","),o+=r(t[e])||"null";return o+"]"}if(null===t)return"null";if(-1!==u.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var f=u.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(o="",e=0;e<c.length;e++){var l=c[e],y=r(t[l]);y&&(o&&(o+=","),o+=JSON.stringify(l)+":"+y)}return u.splice(f,1),"{"+o+"}"}}(r)};
|
|
513
|
+
|
|
514
|
+
},{}],57:[function(require,module,exports){
|
|
515
|
+
module.exports="object"==typeof self?self.FormData:window.FormData;
|
|
516
|
+
|
|
517
|
+
},{}],58:[function(require,module,exports){
|
|
518
|
+
(function (process){
|
|
519
|
+
"use strict";var Stream=require("stream");module.exports=function e(t){if(Array.isArray(t)){var n=0,r=t.length;return e(function(e){return n<r?this.emit("data",t[n++]):this.emit("end"),!0})}var d=new Stream,s=0;function a(){if(d.started=!0,!d.ended)for(;!d.ended&&!d.paused&&t.call(d,s++,function(){d.ended||d.paused||process.nextTick(a)}););}return d.ended=!1,d.started=!1,d.readable=!0,d.writable=!1,d.paused=!1,d.ended=!1,d.pause=function(){d.started=!0,d.paused=!0},d.resume=function(){d.started=!0,d.paused=!1,a()},d.on("end",function(){d.ended=!0,d.readable=!1,process.nextTick(d.destroy)}),d.destroy=function(){d.ended=!0,d.emit("close")},process.nextTick(function(){d.started||d.resume()}),d};
|
|
520
|
+
|
|
521
|
+
}).call(this,require('_process'))
|
|
522
|
+
},{"_process":158,"stream":179}],59:[function(require,module,exports){
|
|
523
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=(e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t)));
|
|
524
|
+
|
|
525
|
+
},{}],60:[function(require,module,exports){
|
|
526
|
+
module.exports={
|
|
527
|
+
"$id": "afterRequest.json#",
|
|
528
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
529
|
+
"type": "object",
|
|
530
|
+
"optional": true,
|
|
531
|
+
"required": [
|
|
532
|
+
"lastAccess",
|
|
533
|
+
"eTag",
|
|
534
|
+
"hitCount"
|
|
535
|
+
],
|
|
536
|
+
"properties": {
|
|
537
|
+
"expires": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"
|
|
540
|
+
},
|
|
541
|
+
"lastAccess": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"
|
|
544
|
+
},
|
|
545
|
+
"eTag": {
|
|
546
|
+
"type": "string"
|
|
547
|
+
},
|
|
548
|
+
"hitCount": {
|
|
549
|
+
"type": "integer"
|
|
550
|
+
},
|
|
551
|
+
"comment": {
|
|
552
|
+
"type": "string"
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
},{}],61:[function(require,module,exports){
|
|
558
|
+
module.exports={
|
|
559
|
+
"$id": "beforeRequest.json#",
|
|
560
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
561
|
+
"type": "object",
|
|
562
|
+
"optional": true,
|
|
563
|
+
"required": [
|
|
564
|
+
"lastAccess",
|
|
565
|
+
"eTag",
|
|
566
|
+
"hitCount"
|
|
567
|
+
],
|
|
568
|
+
"properties": {
|
|
569
|
+
"expires": {
|
|
570
|
+
"type": "string",
|
|
571
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"
|
|
572
|
+
},
|
|
573
|
+
"lastAccess": {
|
|
574
|
+
"type": "string",
|
|
575
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"
|
|
576
|
+
},
|
|
577
|
+
"eTag": {
|
|
578
|
+
"type": "string"
|
|
579
|
+
},
|
|
580
|
+
"hitCount": {
|
|
581
|
+
"type": "integer"
|
|
582
|
+
},
|
|
583
|
+
"comment": {
|
|
584
|
+
"type": "string"
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
},{}],62:[function(require,module,exports){
|
|
590
|
+
module.exports={
|
|
591
|
+
"$id": "browser.json#",
|
|
592
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
593
|
+
"type": "object",
|
|
594
|
+
"required": [
|
|
595
|
+
"name",
|
|
596
|
+
"version"
|
|
597
|
+
],
|
|
598
|
+
"properties": {
|
|
599
|
+
"name": {
|
|
600
|
+
"type": "string"
|
|
601
|
+
},
|
|
602
|
+
"version": {
|
|
603
|
+
"type": "string"
|
|
604
|
+
},
|
|
605
|
+
"comment": {
|
|
606
|
+
"type": "string"
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
},{}],63:[function(require,module,exports){
|
|
612
|
+
module.exports={
|
|
613
|
+
"$id": "cache.json#",
|
|
614
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
615
|
+
"properties": {
|
|
616
|
+
"beforeRequest": {
|
|
617
|
+
"oneOf": [
|
|
618
|
+
{ "type": "null" },
|
|
619
|
+
{ "$ref": "beforeRequest.json#" }
|
|
620
|
+
]
|
|
621
|
+
},
|
|
622
|
+
"afterRequest": {
|
|
623
|
+
"oneOf": [
|
|
624
|
+
{ "type": "null" },
|
|
625
|
+
{ "$ref": "afterRequest.json#" }
|
|
626
|
+
]
|
|
627
|
+
},
|
|
628
|
+
"comment": {
|
|
629
|
+
"type": "string"
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
},{}],64:[function(require,module,exports){
|
|
635
|
+
module.exports={
|
|
636
|
+
"$id": "content.json#",
|
|
637
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
638
|
+
"type": "object",
|
|
639
|
+
"required": [
|
|
640
|
+
"size",
|
|
641
|
+
"mimeType"
|
|
642
|
+
],
|
|
643
|
+
"properties": {
|
|
644
|
+
"size": {
|
|
645
|
+
"type": "integer"
|
|
646
|
+
},
|
|
647
|
+
"compression": {
|
|
648
|
+
"type": "integer"
|
|
649
|
+
},
|
|
650
|
+
"mimeType": {
|
|
651
|
+
"type": "string"
|
|
652
|
+
},
|
|
653
|
+
"text": {
|
|
654
|
+
"type": "string"
|
|
655
|
+
},
|
|
656
|
+
"encoding": {
|
|
657
|
+
"type": "string"
|
|
658
|
+
},
|
|
659
|
+
"comment": {
|
|
660
|
+
"type": "string"
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
},{}],65:[function(require,module,exports){
|
|
666
|
+
module.exports={
|
|
667
|
+
"$id": "cookie.json#",
|
|
668
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
669
|
+
"type": "object",
|
|
670
|
+
"required": [
|
|
671
|
+
"name",
|
|
672
|
+
"value"
|
|
673
|
+
],
|
|
674
|
+
"properties": {
|
|
675
|
+
"name": {
|
|
676
|
+
"type": "string"
|
|
677
|
+
},
|
|
678
|
+
"value": {
|
|
679
|
+
"type": "string"
|
|
680
|
+
},
|
|
681
|
+
"path": {
|
|
682
|
+
"type": "string"
|
|
683
|
+
},
|
|
684
|
+
"domain": {
|
|
685
|
+
"type": "string"
|
|
686
|
+
},
|
|
687
|
+
"expires": {
|
|
688
|
+
"type": ["string", "null"],
|
|
689
|
+
"format": "date-time"
|
|
690
|
+
},
|
|
691
|
+
"httpOnly": {
|
|
692
|
+
"type": "boolean"
|
|
693
|
+
},
|
|
694
|
+
"secure": {
|
|
695
|
+
"type": "boolean"
|
|
696
|
+
},
|
|
697
|
+
"comment": {
|
|
698
|
+
"type": "string"
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
},{}],66:[function(require,module,exports){
|
|
704
|
+
module.exports={
|
|
705
|
+
"$id": "creator.json#",
|
|
706
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
707
|
+
"type": "object",
|
|
708
|
+
"required": [
|
|
709
|
+
"name",
|
|
710
|
+
"version"
|
|
711
|
+
],
|
|
712
|
+
"properties": {
|
|
713
|
+
"name": {
|
|
714
|
+
"type": "string"
|
|
715
|
+
},
|
|
716
|
+
"version": {
|
|
717
|
+
"type": "string"
|
|
718
|
+
},
|
|
719
|
+
"comment": {
|
|
720
|
+
"type": "string"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
},{}],67:[function(require,module,exports){
|
|
726
|
+
module.exports={
|
|
727
|
+
"$id": "entry.json#",
|
|
728
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
729
|
+
"type": "object",
|
|
730
|
+
"optional": true,
|
|
731
|
+
"required": [
|
|
732
|
+
"startedDateTime",
|
|
733
|
+
"time",
|
|
734
|
+
"request",
|
|
735
|
+
"response",
|
|
736
|
+
"cache",
|
|
737
|
+
"timings"
|
|
738
|
+
],
|
|
739
|
+
"properties": {
|
|
740
|
+
"pageref": {
|
|
741
|
+
"type": "string"
|
|
742
|
+
},
|
|
743
|
+
"startedDateTime": {
|
|
744
|
+
"type": "string",
|
|
745
|
+
"format": "date-time",
|
|
746
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
|
|
747
|
+
},
|
|
748
|
+
"time": {
|
|
749
|
+
"type": "number",
|
|
750
|
+
"min": 0
|
|
751
|
+
},
|
|
752
|
+
"request": {
|
|
753
|
+
"$ref": "request.json#"
|
|
754
|
+
},
|
|
755
|
+
"response": {
|
|
756
|
+
"$ref": "response.json#"
|
|
757
|
+
},
|
|
758
|
+
"cache": {
|
|
759
|
+
"$ref": "cache.json#"
|
|
760
|
+
},
|
|
761
|
+
"timings": {
|
|
762
|
+
"$ref": "timings.json#"
|
|
763
|
+
},
|
|
764
|
+
"serverIPAddress": {
|
|
765
|
+
"type": "string",
|
|
766
|
+
"oneOf": [
|
|
767
|
+
{ "format": "ipv4" },
|
|
768
|
+
{ "format": "ipv6" }
|
|
769
|
+
]
|
|
770
|
+
},
|
|
771
|
+
"connection": {
|
|
772
|
+
"type": "string"
|
|
773
|
+
},
|
|
774
|
+
"comment": {
|
|
775
|
+
"type": "string"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
},{}],68:[function(require,module,exports){
|
|
781
|
+
module.exports={
|
|
782
|
+
"$id": "har.json#",
|
|
783
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
784
|
+
"type": "object",
|
|
785
|
+
"required": [
|
|
786
|
+
"log"
|
|
787
|
+
],
|
|
788
|
+
"properties": {
|
|
789
|
+
"log": {
|
|
790
|
+
"$ref": "log.json#"
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
},{}],69:[function(require,module,exports){
|
|
796
|
+
module.exports={
|
|
797
|
+
"$id": "header.json#",
|
|
798
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
799
|
+
"type": "object",
|
|
800
|
+
"required": [
|
|
801
|
+
"name",
|
|
802
|
+
"value"
|
|
803
|
+
],
|
|
804
|
+
"properties": {
|
|
805
|
+
"name": {
|
|
806
|
+
"type": "string"
|
|
807
|
+
},
|
|
808
|
+
"value": {
|
|
809
|
+
"type": "string"
|
|
810
|
+
},
|
|
811
|
+
"comment": {
|
|
812
|
+
"type": "string"
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
},{}],70:[function(require,module,exports){
|
|
818
|
+
"use strict";module.exports={afterRequest:require("./afterRequest.json"),beforeRequest:require("./beforeRequest.json"),browser:require("./browser.json"),cache:require("./cache.json"),content:require("./content.json"),cookie:require("./cookie.json"),creator:require("./creator.json"),entry:require("./entry.json"),har:require("./har.json"),header:require("./header.json"),log:require("./log.json"),page:require("./page.json"),pageTimings:require("./pageTimings.json"),postData:require("./postData.json"),query:require("./query.json"),request:require("./request.json"),response:require("./response.json"),timings:require("./timings.json")};
|
|
819
|
+
|
|
820
|
+
},{"./afterRequest.json":60,"./beforeRequest.json":61,"./browser.json":62,"./cache.json":63,"./content.json":64,"./cookie.json":65,"./creator.json":66,"./entry.json":67,"./har.json":68,"./header.json":69,"./log.json":71,"./page.json":72,"./pageTimings.json":73,"./postData.json":74,"./query.json":75,"./request.json":76,"./response.json":77,"./timings.json":78}],71:[function(require,module,exports){
|
|
821
|
+
module.exports={
|
|
822
|
+
"$id": "log.json#",
|
|
823
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
824
|
+
"type": "object",
|
|
825
|
+
"required": [
|
|
826
|
+
"version",
|
|
827
|
+
"creator",
|
|
828
|
+
"entries"
|
|
829
|
+
],
|
|
830
|
+
"properties": {
|
|
831
|
+
"version": {
|
|
832
|
+
"type": "string"
|
|
833
|
+
},
|
|
834
|
+
"creator": {
|
|
835
|
+
"$ref": "creator.json#"
|
|
836
|
+
},
|
|
837
|
+
"browser": {
|
|
838
|
+
"$ref": "browser.json#"
|
|
839
|
+
},
|
|
840
|
+
"pages": {
|
|
841
|
+
"type": "array",
|
|
842
|
+
"items": {
|
|
843
|
+
"$ref": "page.json#"
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
"entries": {
|
|
847
|
+
"type": "array",
|
|
848
|
+
"items": {
|
|
849
|
+
"$ref": "entry.json#"
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
"comment": {
|
|
853
|
+
"type": "string"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
},{}],72:[function(require,module,exports){
|
|
859
|
+
module.exports={
|
|
860
|
+
"$id": "page.json#",
|
|
861
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
862
|
+
"type": "object",
|
|
863
|
+
"optional": true,
|
|
864
|
+
"required": [
|
|
865
|
+
"startedDateTime",
|
|
866
|
+
"id",
|
|
867
|
+
"title",
|
|
868
|
+
"pageTimings"
|
|
869
|
+
],
|
|
870
|
+
"properties": {
|
|
871
|
+
"startedDateTime": {
|
|
872
|
+
"type": "string",
|
|
873
|
+
"format": "date-time",
|
|
874
|
+
"pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
|
|
875
|
+
},
|
|
876
|
+
"id": {
|
|
877
|
+
"type": "string",
|
|
878
|
+
"unique": true
|
|
879
|
+
},
|
|
880
|
+
"title": {
|
|
881
|
+
"type": "string"
|
|
882
|
+
},
|
|
883
|
+
"pageTimings": {
|
|
884
|
+
"$ref": "pageTimings.json#"
|
|
885
|
+
},
|
|
886
|
+
"comment": {
|
|
887
|
+
"type": "string"
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
},{}],73:[function(require,module,exports){
|
|
893
|
+
module.exports={
|
|
894
|
+
"$id": "pageTimings.json#",
|
|
895
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
896
|
+
"type": "object",
|
|
897
|
+
"properties": {
|
|
898
|
+
"onContentLoad": {
|
|
899
|
+
"type": "number",
|
|
900
|
+
"min": -1
|
|
901
|
+
},
|
|
902
|
+
"onLoad": {
|
|
903
|
+
"type": "number",
|
|
904
|
+
"min": -1
|
|
905
|
+
},
|
|
906
|
+
"comment": {
|
|
907
|
+
"type": "string"
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
},{}],74:[function(require,module,exports){
|
|
913
|
+
module.exports={
|
|
914
|
+
"$id": "postData.json#",
|
|
915
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
916
|
+
"type": "object",
|
|
917
|
+
"optional": true,
|
|
918
|
+
"required": [
|
|
919
|
+
"mimeType"
|
|
920
|
+
],
|
|
921
|
+
"properties": {
|
|
922
|
+
"mimeType": {
|
|
923
|
+
"type": "string"
|
|
924
|
+
},
|
|
925
|
+
"text": {
|
|
926
|
+
"type": "string"
|
|
927
|
+
},
|
|
928
|
+
"params": {
|
|
929
|
+
"type": "array",
|
|
930
|
+
"required": [
|
|
931
|
+
"name"
|
|
932
|
+
],
|
|
933
|
+
"properties": {
|
|
934
|
+
"name": {
|
|
935
|
+
"type": "string"
|
|
936
|
+
},
|
|
937
|
+
"value": {
|
|
938
|
+
"type": "string"
|
|
939
|
+
},
|
|
940
|
+
"fileName": {
|
|
941
|
+
"type": "string"
|
|
942
|
+
},
|
|
943
|
+
"contentType": {
|
|
944
|
+
"type": "string"
|
|
945
|
+
},
|
|
946
|
+
"comment": {
|
|
947
|
+
"type": "string"
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"comment": {
|
|
952
|
+
"type": "string"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
},{}],75:[function(require,module,exports){
|
|
958
|
+
module.exports={
|
|
959
|
+
"$id": "query.json#",
|
|
960
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
961
|
+
"type": "object",
|
|
962
|
+
"required": [
|
|
963
|
+
"name",
|
|
964
|
+
"value"
|
|
965
|
+
],
|
|
966
|
+
"properties": {
|
|
967
|
+
"name": {
|
|
968
|
+
"type": "string"
|
|
969
|
+
},
|
|
970
|
+
"value": {
|
|
971
|
+
"type": "string"
|
|
972
|
+
},
|
|
973
|
+
"comment": {
|
|
974
|
+
"type": "string"
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
},{}],76:[function(require,module,exports){
|
|
980
|
+
module.exports={
|
|
981
|
+
"$id": "request.json#",
|
|
982
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
983
|
+
"type": "object",
|
|
984
|
+
"required": [
|
|
985
|
+
"method",
|
|
986
|
+
"url",
|
|
987
|
+
"httpVersion",
|
|
988
|
+
"cookies",
|
|
989
|
+
"headers",
|
|
990
|
+
"queryString",
|
|
991
|
+
"headersSize",
|
|
992
|
+
"bodySize"
|
|
993
|
+
],
|
|
994
|
+
"properties": {
|
|
995
|
+
"method": {
|
|
996
|
+
"type": "string"
|
|
997
|
+
},
|
|
998
|
+
"url": {
|
|
999
|
+
"type": "string",
|
|
1000
|
+
"format": "uri"
|
|
1001
|
+
},
|
|
1002
|
+
"httpVersion": {
|
|
1003
|
+
"type": "string"
|
|
1004
|
+
},
|
|
1005
|
+
"cookies": {
|
|
1006
|
+
"type": "array",
|
|
1007
|
+
"items": {
|
|
1008
|
+
"$ref": "cookie.json#"
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
"headers": {
|
|
1012
|
+
"type": "array",
|
|
1013
|
+
"items": {
|
|
1014
|
+
"$ref": "header.json#"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"queryString": {
|
|
1018
|
+
"type": "array",
|
|
1019
|
+
"items": {
|
|
1020
|
+
"$ref": "query.json#"
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
"postData": {
|
|
1024
|
+
"$ref": "postData.json#"
|
|
1025
|
+
},
|
|
1026
|
+
"headersSize": {
|
|
1027
|
+
"type": "integer"
|
|
1028
|
+
},
|
|
1029
|
+
"bodySize": {
|
|
1030
|
+
"type": "integer"
|
|
1031
|
+
},
|
|
1032
|
+
"comment": {
|
|
1033
|
+
"type": "string"
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
},{}],77:[function(require,module,exports){
|
|
1039
|
+
module.exports={
|
|
1040
|
+
"$id": "response.json#",
|
|
1041
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
1042
|
+
"type": "object",
|
|
1043
|
+
"required": [
|
|
1044
|
+
"status",
|
|
1045
|
+
"statusText",
|
|
1046
|
+
"httpVersion",
|
|
1047
|
+
"cookies",
|
|
1048
|
+
"headers",
|
|
1049
|
+
"content",
|
|
1050
|
+
"redirectURL",
|
|
1051
|
+
"headersSize",
|
|
1052
|
+
"bodySize"
|
|
1053
|
+
],
|
|
1054
|
+
"properties": {
|
|
1055
|
+
"status": {
|
|
1056
|
+
"type": "integer"
|
|
1057
|
+
},
|
|
1058
|
+
"statusText": {
|
|
1059
|
+
"type": "string"
|
|
1060
|
+
},
|
|
1061
|
+
"httpVersion": {
|
|
1062
|
+
"type": "string"
|
|
1063
|
+
},
|
|
1064
|
+
"cookies": {
|
|
1065
|
+
"type": "array",
|
|
1066
|
+
"items": {
|
|
1067
|
+
"$ref": "cookie.json#"
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
"headers": {
|
|
1071
|
+
"type": "array",
|
|
1072
|
+
"items": {
|
|
1073
|
+
"$ref": "header.json#"
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
"content": {
|
|
1077
|
+
"$ref": "content.json#"
|
|
1078
|
+
},
|
|
1079
|
+
"redirectURL": {
|
|
1080
|
+
"type": "string"
|
|
1081
|
+
},
|
|
1082
|
+
"headersSize": {
|
|
1083
|
+
"type": "integer"
|
|
1084
|
+
},
|
|
1085
|
+
"bodySize": {
|
|
1086
|
+
"type": "integer"
|
|
1087
|
+
},
|
|
1088
|
+
"comment": {
|
|
1089
|
+
"type": "string"
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
},{}],78:[function(require,module,exports){
|
|
1095
|
+
module.exports={
|
|
1096
|
+
"$id": "timings.json#",
|
|
1097
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
1098
|
+
"required": [
|
|
1099
|
+
"send",
|
|
1100
|
+
"wait",
|
|
1101
|
+
"receive"
|
|
1102
|
+
],
|
|
1103
|
+
"properties": {
|
|
1104
|
+
"dns": {
|
|
1105
|
+
"type": "number",
|
|
1106
|
+
"min": -1
|
|
1107
|
+
},
|
|
1108
|
+
"connect": {
|
|
1109
|
+
"type": "number",
|
|
1110
|
+
"min": -1
|
|
1111
|
+
},
|
|
1112
|
+
"blocked": {
|
|
1113
|
+
"type": "number",
|
|
1114
|
+
"min": -1
|
|
1115
|
+
},
|
|
1116
|
+
"send": {
|
|
1117
|
+
"type": "number",
|
|
1118
|
+
"min": -1
|
|
1119
|
+
},
|
|
1120
|
+
"wait": {
|
|
1121
|
+
"type": "number",
|
|
1122
|
+
"min": -1
|
|
1123
|
+
},
|
|
1124
|
+
"receive": {
|
|
1125
|
+
"type": "number",
|
|
1126
|
+
"min": -1
|
|
1127
|
+
},
|
|
1128
|
+
"ssl": {
|
|
1129
|
+
"type": "number",
|
|
1130
|
+
"min": -1
|
|
1131
|
+
},
|
|
1132
|
+
"comment": {
|
|
1133
|
+
"type": "string"
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
},{}],79:[function(require,module,exports){
|
|
1139
|
+
var ajv,Ajv=require("ajv"),HARError=require("./error"),schemas=require("har-schema");function createAjvInstance(){var e=new Ajv({allErrors:!0});return e.addMetaSchema(require("ajv/lib/refs/json-schema-draft-06.json")),e.addSchema(schemas),e}function validate(e,r,t){r=r||{};var n=(ajv=ajv||createAjvInstance()).getSchema(e+".json"),a=n(r);return"function"==typeof t?t(a?null:new HARError(n.errors),a):a}exports.afterRequest=function(e,r){return validate("afterRequest",e,r)},exports.beforeRequest=function(e,r){return validate("beforeRequest",e,r)},exports.browser=function(e,r){return validate("browser",e,r)},exports.cache=function(e,r){return validate("cache",e,r)},exports.content=function(e,r){return validate("content",e,r)},exports.cookie=function(e,r){return validate("cookie",e,r)},exports.creator=function(e,r){return validate("creator",e,r)},exports.entry=function(e,r){return validate("entry",e,r)},exports.har=function(e,r){return validate("har",e,r)},exports.header=function(e,r){return validate("header",e,r)},exports.log=function(e,r){return validate("log",e,r)},exports.page=function(e,r){return validate("page",e,r)},exports.pageTimings=function(e,r){return validate("pageTimings",e,r)},exports.postData=function(e,r){return validate("postData",e,r)},exports.query=function(e,r){return validate("query",e,r)},exports.request=function(e,r){return validate("request",e,r)},exports.response=function(e,r){return validate("response",e,r)},exports.timings=function(e,r){return validate("timings",e,r)};
|
|
1140
|
+
|
|
1141
|
+
},{"./error":80,"ajv":2,"ajv/lib/refs/json-schema-draft-06.json":43,"har-schema":70}],80:[function(require,module,exports){
|
|
1142
|
+
function HARError(r){this.name="HARError",this.message="validation failed",this.errors=r,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error("validation failed").stack}HARError.prototype=Error.prototype,module.exports=HARError;
|
|
1143
|
+
|
|
1144
|
+
},{}],81:[function(require,module,exports){
|
|
1145
|
+
"use strict";const util=require("util"),CodeBuilder=function(t,i){this.code=[],this.indentation=t,this.lineJoin=i||"\n"};CodeBuilder.prototype.buildLine=function(t,i){let e="",n=2;if("[object String]"===Object.prototype.toString.call(t))n=1,i=t,t=0;else if(null===t)return null;for(;t;)e+=this.indentation,t--;const o=Array.prototype.slice.call(arguments,n,arguments.length);return o.unshift(e+i),util.format.apply(this,o)},CodeBuilder.prototype.unshift=function(){return this.code.unshift(this.buildLine.apply(this,arguments)),this},CodeBuilder.prototype.push=function(){return this.code.push(this.buildLine.apply(this,arguments)),this},CodeBuilder.prototype.blank=function(){return this.code.push(null),this},CodeBuilder.prototype.join=function(){return this.code.join(this.lineJoin)},module.exports=CodeBuilder;
|
|
1146
|
+
|
|
1147
|
+
},{"util":191}],82:[function(require,module,exports){
|
|
1148
|
+
const carriage="\r\n",dashes="-".repeat(2),NAME=Symbol.toStringTag,isBlob=e=>"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&/^(Blob|File)$/.test(e[NAME]),getFooter=e=>`${dashes}${e}${dashes}${carriage.repeat(2)}`;function getHeader(e,t,o){let r="";return r+=`${dashes}${e}${carriage}`,r+=`Content-Disposition: form-data; name="${t}"`,isBlob(o)&&(r+=`; filename="${o.name}"${carriage}`,r+=`Content-Type: ${o.type||"application/octet-stream"}`),`${r}${carriage.repeat(2)}`}module.exports.getBoundary=(()=>{let e="--------------------------";for(let t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);return e}),module.exports.formDataIterator=function*(e,t){for(const[o,r]of e)yield getHeader(t,o,r),isBlob(r)?yield*r.stream():yield r,yield carriage;yield getFooter(t)},module.exports.isBlob=isBlob;
|
|
1149
|
+
|
|
1150
|
+
},{}],83:[function(require,module,exports){
|
|
1151
|
+
module.exports={getHeader:(e,o)=>e[Object.keys(e).find(e=>e.toLowerCase()===o.toLowerCase())],getHeaderName:(e,o)=>Object.keys(e).find(e=>{if(e.toLowerCase()===o.toLowerCase())return e}),hasHeader:(e,o)=>Boolean(Object.keys(e).find(e=>e.toLowerCase()===o.toLowerCase()))};
|
|
1152
|
+
|
|
1153
|
+
},{}],84:[function(require,module,exports){
|
|
1154
|
+
"use strict";module.exports=function(e,n){if(void 0===e[n.name])return e[n.name]=n.value,e;if(e[n.name]instanceof Array)return e[n.name].push(n.value),e;const a=[e[n.name],n.value];return e[n.name]=a,e};
|
|
1155
|
+
|
|
1156
|
+
},{}],85:[function(require,module,exports){
|
|
1157
|
+
"use strict";const util=require("util");module.exports={quote:function(e){return/^[a-z0-9-_/.@%^=:]+$/i.test(e)?e:util.format("'%s'",e.replace(/'/g,"'\\''"))},escape:function(e){return e.replace(/\r/g,"\\r").replace(/\n/g,"\\n")}};
|
|
1158
|
+
|
|
1159
|
+
},{"util":191}],86:[function(require,module,exports){
|
|
1160
|
+
"use strict";const debug=require("debug")("httpsnippet"),es=require("event-stream"),MultiPartForm=require("form-data"),qs=require("querystring"),reducer=require("./helpers/reducer"),helpers=require("./helpers/headers"),targets=require("./targets"),url=require("url"),validate=require("har-validator/lib/async"),{formDataIterator:formDataIterator,isBlob:isBlob}=require("./helpers/form-data.js"),HTTPSnippet=function(e){let t;const r=this,a=Object.assign({},e);r.requests=[],(t=a.log&&a.log.entries?a.log.entries:[{request:a}]).forEach(function(e){e.request.httpVersion=e.request.httpVersion||"HTTP/1.1",e.request.queryString=e.request.queryString||[],e.request.headers=e.request.headers||[],e.request.cookies=e.request.cookies||[],e.request.postData=e.request.postData||{},e.request.postData.mimeType=e.request.postData.mimeType||"application/octet-stream",e.request.bodySize=0,e.request.headersSize=0,e.request.postData.size=0,validate.request(e.request,function(t,a){if(!a)throw t;r.requests.push(r.prepare(e.request))})})};HTTPSnippet.prototype.prepare=function(e){if(e.queryObj={},e.headersObj={},e.cookiesObj={},e.allHeaders={},e.postData.jsonObj=!1,e.postData.paramsObj=!1,e.queryString&&e.queryString.length&&(debug("queryString found, constructing queryString pair map"),e.queryObj=e.queryString.reduce(reducer,{})),e.headers&&e.headers.length){const t=/^HTTP\/2/;e.headersObj=e.headers.reduce(function(r,a){let o=a.name;return e.httpVersion.match(t)&&(o=o.toLowerCase()),r[o]=a.value,r},{})}e.cookies&&e.cookies.length&&(e.cookiesObj=e.cookies.reduceRight(function(e,t){return e[t.name]=t.value,e},{}));const t=e.cookies.map(function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)});switch(t.length&&(e.allHeaders.cookie=t.join("; ")),e.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(e.postData.text="",e.postData.mimeType="multipart/form-data",e.postData.params){const t=new MultiPartForm,r="function"==typeof t[Symbol.iterator],a="---011000010111000001101001";if(r||(t._boundary=a),e.postData.params.forEach(function(e){const a=e.name,o=e.value||"",n=e.fileName||null;r?isBlob(o)?t.append(a,o,n):t.append(a,o):t.append(a,o,{filename:n,contentType:e.contentType||null})}),r)for(const r of formDataIterator(t,a))e.postData.text+=r;else t.pipe(es.map(function(t,r){e.postData.text+=t}));e.postData.boundary=a;const o=helpers.hasHeader(e.headersObj,"content-type")?helpers.getHeaderName(e.headersObj,"content-type"):"content-type";e.headersObj[o]="multipart/form-data; boundary="+a}break;case"application/x-www-form-urlencoded":e.postData.params?(e.postData.paramsObj=e.postData.params.reduce(reducer,{}),e.postData.text=qs.stringify(e.postData.paramsObj)):e.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(e.postData.mimeType="application/json",e.postData.text)try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){debug(t),e.postData.mimeType="text/plain"}}return e.allHeaders=Object.assign(e.allHeaders,e.headersObj),e.uriObj=url.parse(e.url,!0,!0),e.queryObj=Object.assign(e.queryObj,e.uriObj.query),e.uriObj.query=null,e.uriObj.search=null,e.uriObj.path=e.uriObj.pathname,e.url=url.format(e.uriObj),e.uriObj.query=e.queryObj,e.uriObj.search=qs.stringify(e.queryObj),e.uriObj.search&&(e.uriObj.path=e.uriObj.pathname+"?"+e.uriObj.search),e.fullUrl=url.format(e.uriObj),e},HTTPSnippet.prototype.convert=function(e,t,r){!r&&t&&(r=t);const a=this._matchTarget(e,t);if(a){const e=this.requests.map(function(e){return a(e,r)});return 1===e.length?e[0]:e}return!1},HTTPSnippet.prototype._matchTarget=function(e,t){return!!targets.hasOwnProperty(e)&&("string"==typeof t&&"function"==typeof targets[e][t]?targets[e][t]:targets[e][targets[e].info.default])},module.exports=HTTPSnippet,module.exports.addTarget=function(e){if(!("info"in e))throw new Error("The supplied custom target must contain an `info` object.");if(!("key"in e.info&&"title"in e.info&&"extname"in e.info&&"default"in e.info))throw new Error("The supplied custom target must have an `info` object with a `key`, `title`, `extname`, and `default` property.");if(targets.hasOwnProperty(e.info.key))throw new Error("The supplied custom target already exists.");if(1===Object.keys(e).length)throw new Error("A custom target must have a client defined on it.");targets[e.info.key]=e},module.exports.addTargetClient=function(e,t){if(!targets.hasOwnProperty(e))throw new Error(`Sorry, but no ${e} target exists to add clients to.`);if(!("info"in t))throw new Error("The supplied custom target client must contain an `info` object.");if(!("key"in t.info&&"title"in t.info))throw new Error("The supplied custom target client must have an `info` object with a `key` and `title` property.");if(targets[e].hasOwnProperty(t.info.key))throw new Error("The supplied custom target client already exists, please use a different key");targets[e][t.info.key]=t},module.exports.availableTargets=function(){return Object.keys(targets).map(function(e){const t=Object.assign({},targets[e].info),r=Object.keys(targets[e]).filter(function(e){return!~["info","index"].indexOf(e)}).map(function(t){return targets[e][t].info});return r.length&&(t.clients=r),t})},module.exports.extname=function(e){return targets[e]?targets[e].info.extname:""};
|
|
1161
|
+
|
|
1162
|
+
},{"./helpers/form-data.js":82,"./helpers/headers":83,"./helpers/reducer":84,"./targets":98,"debug":50,"event-stream":53,"form-data":57,"har-validator/lib/async":79,"querystring":161,"url":186}],87:[function(require,module,exports){
|
|
1163
|
+
"use strict";module.exports={info:{key:"c",title:"C",extname:".c",default:"libcurl"},libcurl:require("./libcurl")};
|
|
1164
|
+
|
|
1165
|
+
},{"./libcurl":88}],88:[function(require,module,exports){
|
|
1166
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,s){const t=new CodeBuilder;t.push("CURL *hnd = curl_easy_init();").blank().push('curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "%s");',e.method.toUpperCase()).push('curl_easy_setopt(hnd, CURLOPT_URL, "%s");',e.fullUrl);const r=Object.keys(e.headersObj);return r.length&&(t.blank().push("struct curl_slist *headers = NULL;"),r.forEach(function(s){t.push('headers = curl_slist_append(headers, "%s: %s");',s,e.headersObj[s])}),t.push("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),e.allHeaders.cookie&&t.blank().push('curl_easy_setopt(hnd, CURLOPT_COOKIE, "%s");',e.allHeaders.cookie),e.postData.text&&t.blank().push("curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, %s);",JSON.stringify(e.postData.text)),t.blank().push("CURLcode ret = curl_easy_perform(hnd);"),t.join()},module.exports.info={key:"libcurl",title:"Libcurl",link:"http://curl.haxx.se/libcurl/",description:"Simple REST and HTTP API Client for C"};
|
|
1167
|
+
|
|
1168
|
+
},{"../../helpers/code-builder":81}],89:[function(require,module,exports){
|
|
1169
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers"),Keyword=function(e){this.name=e};Keyword.prototype.toString=function(){return":"+this.name};const File=function(e){this.path=e};File.prototype.toString=function(){return'(clojure.java.io/file "'+this.path+'")'};const jsType=function(e){return void 0!==e?e.constructor.name.toLowerCase():null},objEmpty=function(e){return"object"===jsType(e)&&0===Object.keys(e).length},filterEmpty=function(e){return Object.keys(e).filter(function(t){return objEmpty(e[t])}).forEach(function(t){delete e[t]}),e},padBlock=function(e,t){const r=Array.apply(null,Array(e)).map(function(e){return" "}).join("");return t.replace(/\n/g,"\n"+r)},jsToEdn=function(e){switch(jsType(e)){case"string":return'"'+e.replace(/"/g,'\\"')+'"';case"file":case"keyword":return e.toString();case"null":return"nil";case"regexp":return'#"'+e.source+'"';case"object":{const t=Object.keys(e).reduce(function(t,r){return t+":"+r+" "+padBlock(r.length+2,jsToEdn(e[r]))+"\n "},"").trim();return"{"+padBlock(1,t)+"}"}case"array":{const t=e.reduce(function(e,t){return e+" "+jsToEdn(t)},"").trim();return"["+padBlock(1,t)+"]"}default:return e.toString()}};module.exports=function(e,t){const r=new CodeBuilder(t);if(-1===["get","post","put","delete","patch","head","options"].indexOf(e.method.toLowerCase()))return r.push("Method not supported").join();const n={headers:e.allHeaders,"query-params":e.queryObj};switch(e.postData.mimeType){case"application/json":n["content-type"]=new Keyword("json"),n["form-params"]=e.postData.jsonObj,delete n.headers[helpers.getHeaderName(n.headers,"content-type")];break;case"application/x-www-form-urlencoded":n["form-params"]=e.postData.paramsObj,delete n.headers[helpers.getHeaderName(n.headers,"content-type")];break;case"text/plain":n.body=e.postData.text,delete n.headers[helpers.getHeaderName(n.headers,"content-type")];break;case"multipart/form-data":n.multipart=e.postData.params.map(function(e){return e.fileName&&!e.value?{name:e.name,content:new File(e.fileName)}:{name:e.name,content:e.value}}),delete n.headers[helpers.getHeaderName(n.headers,"content-type")]}switch(helpers.getHeader(n.headers,"accept")){case"application/json":n.accept=new Keyword("json"),delete n.headers[helpers.getHeaderName(n.headers,"accept")]}return r.push("(require '[clj-http.client :as client])\n"),objEmpty(filterEmpty(n))?r.push('(client/%s "%s")',e.method.toLowerCase(),e.url):r.push('(client/%s "%s" %s)',e.method.toLowerCase(),e.url,padBlock(11+e.method.length+e.url.length,jsToEdn(filterEmpty(n)))),r.join()},module.exports.info={key:"clj_http",title:"clj-http",link:"https://github.com/dakrone/clj-http",description:"An idiomatic clojure http client wrapping the apache client."};
|
|
1170
|
+
|
|
1171
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],90:[function(require,module,exports){
|
|
1172
|
+
"use strict";module.exports={info:{key:"clojure",title:"Clojure",extname:".clj",default:"clj_http"},clj_http:require("./clj_http")};
|
|
1173
|
+
|
|
1174
|
+
},{"./clj_http":89}],91:[function(require,module,exports){
|
|
1175
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers");function getDecompressionMethods(e){const t=helpers.getHeader(e.allHeaders,"accept-encoding");if(!t)return[];const s={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},n=[];return t.split(",").forEach(function(e){const t=/\s*([^;\s]+)/.exec(e);if(t){const e=s[t[1]];e&&n.push(e)}}),n}module.exports=function(e,t){const s=Object.assign({indent:" "},t),n=new CodeBuilder(s.indent);let o="";const p=!!e.allHeaders.cookie,a=getDecompressionMethods(e);(p||a.length)&&(o="clientHandler",n.push("var clientHandler = new HttpClientHandler"),n.push("{"),p&&n.push(1,"UseCookies = false,"),a.length&&n.push(1,"AutomaticDecompression = %s,",a.join(" | ")),n.push("};")),n.push("var client = new HttpClient(%s);",o),n.push("var request = new HttpRequestMessage"),n.push("{");let r=e.method.toUpperCase();r=r&&-1!==["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"].indexOf(r)?`HttpMethod.${r[0]}${r.substring(1).toLowerCase()}`:`new HttpMethod("${r}")`,n.push(1,"Method = %s,",r),n.push(1,'RequestUri = new Uri("%s"),',e.fullUrl);const i=Object.keys(e.allHeaders).filter(function(e){switch(e.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(i.length&&(n.push(1,"Headers ="),n.push(1,"{"),i.forEach(function(t){n.push(2,'{ "%s", "%s" },',t,e.allHeaders[t])}),n.push(1,"},")),e.postData.text){const t=e.postData.mimeType;switch(t){case"application/x-www-form-urlencoded":n.push(1,"Content = new FormUrlEncodedContent(new Dictionary<string, string>"),n.push(1,"{"),e.postData.params.forEach(function(e){n.push(2,'{ "%s", "%s" },',e.name,e.value)}),n.push(1,"}),");break;case"multipart/form-data":n.push(1,"Content = new MultipartFormDataContent"),n.push(1,"{"),e.postData.params.forEach(function(e){n.push(2,"new StringContent(%s)",JSON.stringify(e.value||"")),n.push(2,"{"),n.push(3,"Headers ="),n.push(3,"{"),e.contentType&&n.push(4,'ContentType = new MediaTypeHeaderValue("%s"),',e.contentType),n.push(4,'ContentDisposition = new ContentDispositionHeaderValue("form-data")'),n.push(4,"{"),n.push(5,'Name = "%s",',e.name),e.fileName&&n.push(5,'FileName = "%s",',e.fileName),n.push(4,"}"),n.push(3,"}"),n.push(2,"},")}),n.push(1,"},");break;default:n.push(1,"Content = new StringContent(%s)",JSON.stringify(e.postData.text||"")),n.push(1,"{"),n.push(2,"Headers ="),n.push(2,"{"),n.push(3,'ContentType = new MediaTypeHeaderValue("%s")',t),n.push(2,"}"),n.push(1,"}")}}return n.push("};"),n.push("using (var response = await client.SendAsync(request))"),n.push("{"),n.push(1,"response.EnsureSuccessStatusCode();"),n.push(1,"var body = await response.Content.ReadAsStringAsync();"),n.push(1,"Console.WriteLine(body);"),n.push("}"),n.join()},module.exports.info={key:"httpclient",title:"HttpClient",link:"https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",description:".NET Standard HTTP Client"};
|
|
1176
|
+
|
|
1177
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],92:[function(require,module,exports){
|
|
1178
|
+
"use strict";module.exports={info:{key:"csharp",title:"C#",extname:".cs",default:"restsharp"},restsharp:require("./restsharp"),httpclient:require("./httpclient")};
|
|
1179
|
+
|
|
1180
|
+
},{"./httpclient":91,"./restsharp":93}],93:[function(require,module,exports){
|
|
1181
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers");module.exports=function(e,t){const s=new CodeBuilder;if(-1===["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].indexOf(e.method.toUpperCase()))return"Method not supported";s.push('var client = new RestClient("%s");',e.fullUrl),s.push("var request = new RestRequest(Method.%s);",e.method.toUpperCase());const r=Object.keys(e.headersObj);return r.length&&r.forEach(function(t){s.push('request.AddHeader("%s", "%s");',t,e.headersObj[t])}),e.cookies.length&&e.cookies.forEach(function(e){s.push('request.AddCookie("%s", "%s");',e.name,e.value)}),e.postData.text&&s.push('request.AddParameter("%s", %s, ParameterType.RequestBody);',helpers.getHeader(e.allHeaders,"content-type"),JSON.stringify(e.postData.text)),s.push("IRestResponse response = client.Execute(request);"),s.join()},module.exports.info={key:"restsharp",title:"RestSharp",link:"http://restsharp.org/",description:"Simple REST and HTTP API Client for .NET"};
|
|
1182
|
+
|
|
1183
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],94:[function(require,module,exports){
|
|
1184
|
+
"use strict";module.exports={info:{key:"go",title:"Go",extname:".go",default:"native"},native:require("./native")};
|
|
1185
|
+
|
|
1186
|
+
},{"./native":95}],95:[function(require,module,exports){
|
|
1187
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=new CodeBuilder("\t"),r=Object.assign({showBoilerplate:!0,checkErrors:!1,printBody:!0,timeout:-1},t),l=r.checkErrors?"err":"_",n=r.showBoilerplate?1:0,o=function(){r.checkErrors&&s.push(n,"if err != nil {").push(n+1,"panic(err)").push(n,"}")};let i;return r.showBoilerplate&&(s.push("package main").blank().push("import (").push(n,'"fmt"'),r.timeout>0&&s.push(n,'"time"'),e.postData.text&&s.push(n,'"strings"'),s.push(n,'"net/http"'),r.printBody&&s.push(n,'"io/ioutil"'),s.push(")").blank().push("func main() {").blank()),r.timeout>0?(i="client",s.push(n,"client := http.Client{").push(n+1,"Timeout: time.Duration(%s * time.Second),",r.timeout).push(n,"}").blank()):i="http.DefaultClient",s.push(n,'url := "%s"',e.fullUrl).blank(),e.postData.text?s.push(n,"payload := strings.NewReader(%s)",JSON.stringify(e.postData.text)).blank().push(n,'req, %s := http.NewRequest("%s", url, payload)',l,e.method).blank():s.push(n,'req, %s := http.NewRequest("%s", url, nil)',l,e.method).blank(),o(),Object.keys(e.allHeaders).length&&(Object.keys(e.allHeaders).forEach(function(t){s.push(n,'req.Header.Add("%s", "%s")',t,e.allHeaders[t])}),s.blank()),s.push(n,"res, %s := %s.Do(req)",l,i),o(),r.printBody&&(s.blank().push(n,"defer res.Body.Close()").push(n,"body, %s := ioutil.ReadAll(res.Body)",l),o()),s.blank().push(n,"fmt.Println(res)"),r.printBody&&s.push(n,"fmt.Println(string(body))"),r.showBoilerplate&&s.blank().push("}"),s.join()},module.exports.info={key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request"};
|
|
1188
|
+
|
|
1189
|
+
},{"../../helpers/code-builder":81}],96:[function(require,module,exports){
|
|
1190
|
+
(function (Buffer){
|
|
1191
|
+
"use strict";const CRLF="\r\n",CodeBuilder=require("../../helpers/code-builder"),util=require("util");module.exports=function(t,e){const s=Object.assign({absoluteURI:!1,autoContentLength:!0,autoHost:!0},e),o=new CodeBuilder("",CRLF),n=s.absoluteURI?t.fullUrl:t.uriObj.path;o.push("%s %s %s",t.method,n,t.httpVersion),Object.keys(t.allHeaders).forEach(function(e){const s=e.toLowerCase().replace(/(^|-)(\w)/g,function(t){return t.toUpperCase()});o.push("%s",util.format("%s: %s",s,t.allHeaders[e]))}),s.autoHost&&-1===Object.keys(t.allHeaders).indexOf("host")&&o.push("Host: %s",t.uriObj.host),s.autoContentLength&&t.postData.text&&-1===Object.keys(t.allHeaders).indexOf("content-length")&&o.push("Content-Length: %d",Buffer.byteLength(t.postData.text,"ascii")),o.blank();const r=o.join();let a="";return t.postData.text&&(a=t.postData.text),r+CRLF+a},module.exports.info={key:"1.1",title:"HTTP/1.1",link:"https://tools.ietf.org/html/rfc7230",description:"HTTP/1.1 request string in accordance with RFC 7230"};
|
|
1192
|
+
|
|
1193
|
+
}).call(this,require("buffer").Buffer)
|
|
1194
|
+
},{"../../helpers/code-builder":81,"buffer":48,"util":191}],97:[function(require,module,exports){
|
|
1195
|
+
"use strict";module.exports={info:{key:"http",title:"HTTP",extname:"",default:"1.1"},1.1:require("./http1.1")};
|
|
1196
|
+
|
|
1197
|
+
},{"./http1.1":96}],98:[function(require,module,exports){
|
|
1198
|
+
"use strict";module.exports={c:require("./c"),clojure:require("./clojure"),csharp:require("./csharp"),go:require("./go"),http:require("./http"),java:require("./java"),javascript:require("./javascript"),kotlin:require("./kotlin"),node:require("./node"),objc:require("./objc"),ocaml:require("./ocaml"),php:require("./php"),powershell:require("./powershell"),python:require("./python"),r:require("./r"),ruby:require("./ruby"),shell:require("./shell"),swift:require("./swift")};
|
|
1199
|
+
|
|
1200
|
+
},{"./c":87,"./clojure":90,"./csharp":92,"./go":94,"./http":97,"./java":100,"./javascript":106,"./kotlin":109,"./node":113,"./objc":118,"./ocaml":121,"./php":126,"./powershell":128,"./python":132,"./r":136,"./ruby":137,"./shell":141,"./swift":144}],99:[function(require,module,exports){
|
|
1201
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(t,e){const n=Object.assign({indent:" "},e),s=new CodeBuilder(n.indent);s.push("AsyncHttpClient client = new DefaultAsyncHttpClient();"),s.push(`client.prepare("${t.method.toUpperCase()}", "${t.fullUrl}")`);const l=Object.keys(t.allHeaders);return l.length&&l.forEach(function(e){s.push(1,'.setHeader("%s", "%s")',e,t.allHeaders[e])}),t.postData.text&&s.push(1,".setBody(%s)",JSON.stringify(t.postData.text)),s.push(1,".execute()"),s.push(1,".toCompletableFuture()"),s.push(1,".thenAccept(System.out::println)"),s.push(1,".join();"),s.blank(),s.push("client.close();"),s.join()},module.exports.info={key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpClient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java"};
|
|
1202
|
+
|
|
1203
|
+
},{"../../helpers/code-builder":81}],100:[function(require,module,exports){
|
|
1204
|
+
"use strict";module.exports={info:{key:"java",title:"Java",extname:".java",default:"unirest"},okhttp:require("./okhttp"),unirest:require("./unirest"),asynchttp:require("./asynchttp"),nethttp:require("./nethttp")};
|
|
1205
|
+
|
|
1206
|
+
},{"./asynchttp":99,"./nethttp":101,"./okhttp":102,"./unirest":103}],101:[function(require,module,exports){
|
|
1207
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),n=new CodeBuilder(s.indent);n.push("HttpRequest request = HttpRequest.newBuilder()"),n.push(2,'.uri(URI.create("%s"))',e.fullUrl);const o=Object.keys(e.allHeaders);return o.length&&o.forEach(function(t){n.push(2,'.header("%s", "%s")',t,e.allHeaders[t])}),e.postData.text?n.push(2,'.method("%s", HttpRequest.BodyPublishers.ofString(%s))',e.method.toUpperCase(),JSON.stringify(e.postData.text)):n.push(2,'.method("%s", HttpRequest.BodyPublishers.noBody())',e.method.toUpperCase()),n.push(2,".build();"),n.push("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"),n.push("System.out.println(response.body());"),n.join()},module.exports.info={key:"nethttp",title:"java.net.http",link:"https://openjdk.java.net/groups/net/httpclient/intro.html",description:"Java Standardized HTTP Client API"};
|
|
1208
|
+
|
|
1209
|
+
},{"../../helpers/code-builder":81}],102:[function(require,module,exports){
|
|
1210
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),o=new CodeBuilder(s.indent);o.push("OkHttpClient client = new OkHttpClient();").blank(),e.postData.text&&(e.postData.boundary?o.push('MediaType mediaType = MediaType.parse("%s; boundary=%s");',e.postData.mimeType,e.postData.boundary):o.push('MediaType mediaType = MediaType.parse("%s");',e.postData.mimeType),o.push("RequestBody body = RequestBody.create(mediaType, %s);",JSON.stringify(e.postData.text))),o.push("Request request = new Request.Builder()"),o.push(1,'.url("%s")',e.fullUrl),-1===["GET","POST","PUT","DELETE","PATCH","HEAD"].indexOf(e.method.toUpperCase())?e.postData.text?o.push(1,'.method("%s", body)',e.method.toUpperCase()):o.push(1,'.method("%s", null)',e.method.toUpperCase()):["POST","PUT","DELETE","PATCH"].indexOf(e.method.toUpperCase())>=0?e.postData.text?o.push(1,".%s(body)",e.method.toLowerCase()):o.push(1,".%s(null)",e.method.toLowerCase()):o.push(1,".%s()",e.method.toLowerCase());const p=Object.keys(e.allHeaders);return p.length&&p.forEach(function(t){o.push(1,'.addHeader("%s", "%s")',t,e.allHeaders[t])}),o.push(1,".build();").blank().push("Response response = client.newCall(request).execute();"),o.join()},module.exports.info={key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library"};
|
|
1211
|
+
|
|
1212
|
+
},{"../../helpers/code-builder":81}],103:[function(require,module,exports){
|
|
1213
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),n=new CodeBuilder(s.indent);-1===["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].indexOf(e.method.toUpperCase())?n.push('HttpResponse<String> response = Unirest.customMethod("%s","%s")',e.method.toUpperCase(),e.fullUrl):n.push('HttpResponse<String> response = Unirest.%s("%s")',e.method.toLowerCase(),e.fullUrl);const r=Object.keys(e.allHeaders);return r.length&&r.forEach(function(t){n.push(1,'.header("%s", "%s")',t,e.allHeaders[t])}),e.postData.text&&n.push(1,".body(%s)",JSON.stringify(e.postData.text)),n.push(1,".asString();"),n.join()},module.exports.info={key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library"};
|
|
1214
|
+
|
|
1215
|
+
},{"../../helpers/code-builder":81}],104:[function(require,module,exports){
|
|
1216
|
+
"use strict";const util=require("util"),stringifyObject=require("stringify-object"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),a=new CodeBuilder(s.indent);a.push('import axios from "axios";').blank();const o={method:e.method,url:e.url};switch(Object.keys(e.queryObj).length&&(o.params=e.queryObj),Object.keys(e.allHeaders).length&&(o.headers=e.allHeaders),e.postData.mimeType){case"application/x-www-form-urlencoded":o.data=e.postData.paramsObj;break;case"application/json":e.postData.jsonObj&&(o.data=e.postData.jsonObj);break;case"multipart/form-data":a.push("const form = new FormData();"),e.postData.params.forEach(function(e){a.push("form.append(%s, %s);",JSON.stringify(e.name),JSON.stringify(e.value||e.fileName||""))}),a.blank(),o.data="[form]";break;default:e.postData.text&&(o.data=e.postData.text)}return a.push("const options = %s;",stringifyObject(o,{indent:" ",inlineCharacterLimit:80}).replace('"[form]"',"form")).blank(),a.push(util.format("axios.request(options).then(%s","function (response) {")).push(1,"console.log(response.data);").push("}).catch(%s","function (error) {").push(1,"console.error(error);").push("});"),a.join()},module.exports.info={key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js"};
|
|
1217
|
+
|
|
1218
|
+
},{"../../helpers/code-builder":81,"stringify-object":182,"util":191}],105:[function(require,module,exports){
|
|
1219
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" ",credentials:null},t),o=require("stringify-object"),a=new CodeBuilder(s.indent);switch(t={method:e.method},Object.keys(e.allHeaders).length&&(t.headers=e.allHeaders),null!==s.credentials&&(t.credentials=s.credentials),e.postData.mimeType){case"application/x-www-form-urlencoded":t.body=e.postData.paramsObj?e.postData.paramsObj:e.postData.text;break;case"application/json":t.body=JSON.stringify(e.postData.jsonObj);break;case"multipart/form-data":a.push("const form = new FormData();"),e.postData.params.forEach(function(e){a.push("form.append(%s, %s);",JSON.stringify(e.name),JSON.stringify(e.value||e.fileName||""))}),a.blank();break;default:e.postData.text&&(t.body=e.postData.text)}return a.push("const options = %s;",o(t,{indent:s.indent,inlineCharacterLimit:80,transform:(t,s,o)=>"body"===s&&"application/x-www-form-urlencoded"===e.postData.mimeType?`new URLSearchParams(${o})`:o})).blank(),"multipart/form-data"===e.postData.mimeType&&a.push("options.body = form;").blank(),a.push("fetch('%s', options)",e.fullUrl).push(1,".then(response => response.json())").push(1,".then(response => console.log(response))").push(1,".catch(err => console.error(err));"),a.join()},module.exports.info={key:"fetch",title:"fetch",link:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",description:"Perform asynchronous HTTP requests with the Fetch API"};
|
|
1220
|
+
|
|
1221
|
+
},{"../../helpers/code-builder":81,"stringify-object":182}],106:[function(require,module,exports){
|
|
1222
|
+
"use strict";module.exports={info:{key:"javascript",title:"JavaScript",extname:".js",default:"xhr"},jquery:require("./jquery"),fetch:require("./fetch"),xhr:require("./xhr"),axios:require("./axios")};
|
|
1223
|
+
|
|
1224
|
+
},{"./axios":104,"./fetch":105,"./jquery":107,"./xhr":108}],107:[function(require,module,exports){
|
|
1225
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers");module.exports=function(e,t){const a=Object.assign({indent:" "},t),s=new CodeBuilder(a.indent),r={async:!0,crossDomain:!0,url:e.fullUrl,method:e.method,headers:e.allHeaders};switch(e.postData.mimeType){case"application/x-www-form-urlencoded":r.data=e.postData.paramsObj?e.postData.paramsObj:e.postData.text;break;case"application/json":r.processData=!1,r.data=e.postData.text;break;case"multipart/form-data":s.push("const form = new FormData();"),e.postData.params.forEach(function(e){s.push("form.append(%s, %s);",JSON.stringify(e.name),JSON.stringify(e.value||e.fileName||""))}),r.processData=!1,r.contentType=!1,r.mimeType="multipart/form-data",r.data="[form]",helpers.hasHeader(r.headers,"content-type")&&helpers.getHeader(r.headers,"content-type").indexOf("boundary")&&delete r.headers[helpers.getHeaderName(r.headers,"content-type")],s.blank();break;default:e.postData.text&&(r.data=e.postData.text)}return s.push("const settings = "+JSON.stringify(r,null,a.indent).replace('"[form]"',"form")+";").blank().push("$.ajax(settings).done(function (response) {").push(1,"console.log(response);").push("});"),s.join()},module.exports.info={key:"jquery",title:"jQuery",link:"http://api.jquery.com/jquery.ajax/",description:"Perform an asynchronous HTTP (Ajax) requests with jQuery"};
|
|
1226
|
+
|
|
1227
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],108:[function(require,module,exports){
|
|
1228
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers");module.exports=function(e,t){const s=Object.assign({indent:" ",cors:!0},t),a=new CodeBuilder(s.indent);switch(e.postData.mimeType){case"application/json":a.push("const data = JSON.stringify(%s);",JSON.stringify(e.postData.jsonObj,null,s.indent)).push(null);break;case"multipart/form-data":a.push("const data = new FormData();"),e.postData.params.forEach(function(e){a.push("data.append(%s, %s);",JSON.stringify(e.name),JSON.stringify(e.value||e.fileName||""))}),helpers.hasHeader(e.allHeaders,"content-type")&&helpers.getHeader(e.allHeaders,"content-type").indexOf("boundary")&&delete e.allHeaders[helpers.getHeaderName(e.allHeaders,"content-type")],a.blank();break;default:a.push("const data = %s;",JSON.stringify(e.postData.text||null)).blank()}return a.push("const xhr = new XMLHttpRequest();"),s.cors&&a.push("xhr.withCredentials = true;"),a.blank().push('xhr.addEventListener("readystatechange", function () {').push(1,"if (this.readyState === this.DONE) {").push(2,"console.log(this.responseText);").push(1,"}").push("});").blank().push("xhr.open(%s, %s);",JSON.stringify(e.method),JSON.stringify(e.fullUrl)),Object.keys(e.allHeaders).forEach(function(t){a.push("xhr.setRequestHeader(%s, %s);",JSON.stringify(t),JSON.stringify(e.allHeaders[t]))}),a.blank().push("xhr.send(data);"),a.join()},module.exports.info={key:"xhr",title:"XMLHttpRequest",link:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",description:"W3C Standard API that provides scripted client functionality"};
|
|
1229
|
+
|
|
1230
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],109:[function(require,module,exports){
|
|
1231
|
+
"use strict";module.exports={info:{key:"kotlin",title:"Kotlin",extname:".kt",default:"okhttp"},okhttp:require("./okhttp")};
|
|
1232
|
+
|
|
1233
|
+
},{"./okhttp":110}],110:[function(require,module,exports){
|
|
1234
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),o=new CodeBuilder(s.indent);o.push("val client = OkHttpClient()").blank(),e.postData.text&&(e.postData.boundary?o.push('val mediaType = MediaType.parse("%s; boundary=%s")',e.postData.mimeType,e.postData.boundary):o.push('val mediaType = MediaType.parse("%s")',e.postData.mimeType),o.push("val body = RequestBody.create(mediaType, %s)",JSON.stringify(e.postData.text))),o.push("val request = Request.Builder()"),o.push(1,'.url("%s")',e.fullUrl),-1===["GET","POST","PUT","DELETE","PATCH","HEAD"].indexOf(e.method.toUpperCase())?e.postData.text?o.push(1,'.method("%s", body)',e.method.toUpperCase()):o.push(1,'.method("%s", null)',e.method.toUpperCase()):["POST","PUT","DELETE","PATCH"].indexOf(e.method.toUpperCase())>=0?e.postData.text?o.push(1,".%s(body)",e.method.toLowerCase()):o.push(1,".%s(null)",e.method.toLowerCase()):o.push(1,".%s()",e.method.toLowerCase());const a=Object.keys(e.allHeaders);return a.length&&a.forEach(function(t){o.push(1,'.addHeader("%s", "%s")',t,e.allHeaders[t])}),o.push(1,".build()").blank().push("val response = client.newCall(request).execute()"),o.join()},module.exports.info={key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library"};
|
|
1235
|
+
|
|
1236
|
+
},{"../../helpers/code-builder":81}],111:[function(require,module,exports){
|
|
1237
|
+
"use strict";const util=require("util"),stringifyObject=require("stringify-object"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),o=new CodeBuilder(s.indent);o.push('var axios = require("axios").default;').blank();const a={method:e.method,url:e.url};switch(Object.keys(e.queryObj).length&&(a.params=e.queryObj),Object.keys(e.allHeaders).length&&(a.headers=e.allHeaders),e.postData.mimeType){case"application/x-www-form-urlencoded":a.data=e.postData.paramsObj;break;case"application/json":e.postData.jsonObj&&(a.data=e.postData.jsonObj);break;default:e.postData.text&&(a.data=e.postData.text)}return o.push("var options = %s;",stringifyObject(a,{indent:" ",inlineCharacterLimit:80})).blank(),o.push(util.format("axios.request(options).then(%s","function (response) {")).push(1,"console.log(response.data);").push("}).catch(%s","function (error) {").push(1,"console.error(error);").push("});"),o.join()},module.exports.info={key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js"};
|
|
1238
|
+
|
|
1239
|
+
},{"../../helpers/code-builder":81,"stringify-object":182,"util":191}],112:[function(require,module,exports){
|
|
1240
|
+
"use strict";const stringifyObject=require("stringify-object"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const a=Object.assign({indent:" "},t);let o=!1;const n=new CodeBuilder(a.indent);n.push("const fetch = require('node-fetch');");const s=e.fullUrl,r={method:e.method};switch(Object.keys(e.headersObj).length&&(r.headers=e.headersObj),e.postData.mimeType){case"application/x-www-form-urlencoded":n.unshift("const { URLSearchParams } = require('url');"),n.push("const encodedParams = new URLSearchParams();"),n.blank(),e.postData.params.forEach(function(e){n.push("encodedParams.set('"+e.name+"', '"+e.value+"');")}),r.body="encodedParams";break;case"application/json":e.postData.jsonObj&&(r.body=JSON.stringify(e.postData.jsonObj));break;case"multipart/form-data":n.unshift("const FormData = require('form-data');"),n.push("const formData = new FormData();"),n.blank(),e.postData.params.forEach(function(e){e.fileName||e.fileName||e.contentType?e.fileName&&(o=!0,n.push("formData.append('"+e.name+"', fs.createReadStream('"+e.fileName+"'));")):n.push("formData.append('"+e.name+"', '"+e.value+"');")});break;default:e.postData.text&&(r.body=e.postData.text)}if(e.cookies.length){let t="";e.cookies.forEach(function(e){t=t+encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)+"; "}),r.headers?r.headers.cookie=t:(r.headers={},r.headers.cookie=t)}return n.blank(),n.push("let url = '"+s+"';").blank(),n.push("let options = %s;",stringifyObject(r,{indent:" ",inlineCharacterLimit:80})).blank(),o&&n.unshift("const fs = require('fs');"),"multipart/form-data"===e.postData.mimeType&&n.push("options.body = formData;").blank(),n.push("fetch(url, options)").push(1,".then(res => res.json())").push(1,".then(json => console.log(json))").push(1,".catch(err => console.error('error:' + err));"),n.join().replace(/'encodedParams'/,"encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/,'fs.createReadStream("$1")')},module.exports.info={key:"fetch",title:"Fetch",link:"https://github.com/bitinn/node-fetch",description:"Simplified HTTP node-fetch client"};
|
|
1241
|
+
|
|
1242
|
+
},{"../../helpers/code-builder":81,"stringify-object":182}],113:[function(require,module,exports){
|
|
1243
|
+
"use strict";module.exports={info:{key:"node",title:"Node.js",extname:".js",default:"native"},native:require("./native"),request:require("./request"),unirest:require("./unirest"),axios:require("./axios"),fetch:require("./fetch")};
|
|
1244
|
+
|
|
1245
|
+
},{"./axios":111,"./fetch":112,"./native":114,"./request":115,"./unirest":116}],114:[function(require,module,exports){
|
|
1246
|
+
"use strict";const stringifyObject=require("stringify-object"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(t,e){const n=Object.assign({indent:" "},e),s=new CodeBuilder(n.indent),i={method:t.method,hostname:t.uriObj.hostname,port:t.uriObj.port,path:t.uriObj.path,headers:t.allHeaders};switch(s.push('const http = require("%s");',t.uriObj.protocol.replace(":","")),s.blank().push("const options = %s;",JSON.stringify(i,null,n.indent)).blank().push("const req = http.request(options, function (res) {").push(1,"const chunks = [];").blank().push(1,'res.on("data", function (chunk) {').push(2,"chunks.push(chunk);").push(1,"});").blank().push(1,'res.on("end", function () {').push(2,"const body = Buffer.concat(chunks);").push(2,"console.log(body.toString());").push(1,"});").push("});").blank(),t.postData.mimeType){case"application/x-www-form-urlencoded":t.postData.paramsObj&&(s.unshift('const qs = require("querystring");'),s.push("req.write(qs.stringify(%s));",stringifyObject(t.postData.paramsObj,{indent:" ",inlineCharacterLimit:80})));break;case"application/json":t.postData.jsonObj&&s.push("req.write(JSON.stringify(%s));",stringifyObject(t.postData.jsonObj,{indent:" ",inlineCharacterLimit:80}));break;default:t.postData.text&&s.push("req.write(%s);",JSON.stringify(t.postData.text,null,n.indent))}return s.push("req.end();"),s.join()},module.exports.info={key:"native",title:"HTTP",link:"http://nodejs.org/api/http.html#http_http_request_options_callback",description:"Node.js native HTTP interface"};
|
|
1247
|
+
|
|
1248
|
+
},{"../../helpers/code-builder":81,"stringify-object":182}],115:[function(require,module,exports){
|
|
1249
|
+
"use strict";const util=require("util"),stringifyObject=require("stringify-object"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const o=Object.assign({indent:" "},t);let r=!1;const a=new CodeBuilder(o.indent);a.push("const request = require('request');").blank();const s={method:e.method,url:e.url};switch(Object.keys(e.queryObj).length&&(s.qs=e.queryObj),Object.keys(e.headersObj).length&&(s.headers=e.headersObj),e.postData.mimeType){case"application/x-www-form-urlencoded":s.form=e.postData.paramsObj;break;case"application/json":e.postData.jsonObj&&(s.body=e.postData.jsonObj,s.json=!0);break;case"multipart/form-data":s.formData={},e.postData.params.forEach(function(e){const t={};e.fileName||e.fileName||e.contentType?(e.fileName?(r=!0,t.value='fs.createReadStream("'+e.fileName+'")'):e.value&&(t.value=e.value),e.fileName&&(t.options={filename:e.fileName,contentType:e.contentType?e.contentType:null}),s.formData[e.name]=t):s.formData[e.name]=e.value});break;default:e.postData.text&&(s.body=e.postData.text)}if(e.cookies.length){s.jar="JAR",a.push("const jar = request.jar();");const t=e.url;e.cookies.forEach(function(e){a.push("jar.setCookie(request.cookie('%s=%s'), '%s');",encodeURIComponent(e.name),encodeURIComponent(e.value),t)}),a.blank()}return r&&a.unshift("const fs = require('fs');"),a.push("const options = %s;",stringifyObject(s,{indent:" ",inlineCharacterLimit:80})).blank(),a.push(util.format("request(options, %s","function (error, response, body) {")).push(1,"if (error) throw new Error(error);").blank().push(1,"console.log(body);").push("});").blank(),a.join().replace('"JAR"',"jar").replace(/'fs\.createReadStream\("(.+)"\)'/g,"fs.createReadStream('$1')")},module.exports.info={key:"request",title:"Request",link:"https://github.com/request/request",description:"Simplified HTTP request client"};
|
|
1250
|
+
|
|
1251
|
+
},{"../../helpers/code-builder":81,"stringify-object":182,"util":191}],116:[function(require,module,exports){
|
|
1252
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const n=Object.assign({indent:" "},t);let s=!1;const r=new CodeBuilder(n.indent);switch(r.push('const unirest = require("unirest");').blank().push('const req = unirest("%s", "%s");',e.method,e.url).blank(),e.cookies.length&&(r.push("const CookieJar = unirest.jar();"),e.cookies.forEach(function(t){r.push('CookieJar.add("%s=%s","%s");',encodeURIComponent(t.name),encodeURIComponent(t.value),e.url)}),r.push("req.jar(CookieJar);").blank()),Object.keys(e.queryObj).length&&r.push("req.query(%s);",JSON.stringify(e.queryObj,null,n.indent)).blank(),Object.keys(e.headersObj).length&&r.push("req.headers(%s);",JSON.stringify(e.headersObj,null,n.indent)).blank(),e.postData.mimeType){case"application/x-www-form-urlencoded":e.postData.paramsObj&&r.push("req.form(%s);",JSON.stringify(e.postData.paramsObj,null,n.indent)).blank();break;case"application/json":e.postData.jsonObj&&r.push('req.type("json");').push("req.send(%s);",JSON.stringify(e.postData.jsonObj,null,n.indent)).blank();break;case"multipart/form-data":{const t=[];e.postData.params.forEach(function(e){const n={};e.fileName&&!e.value?(s=!0,n.body='fs.createReadStream("'+e.fileName+'")'):e.value&&(n.body=e.value),n.body&&(e.contentType&&(n["content-type"]=e.contentType),t.push(n))}),r.push("req.multipart(%s);",JSON.stringify(t,null,n.indent)).blank();break}default:e.postData.text&&r.push("req.send(%s);",JSON.stringify(e.postData.text,null,n.indent)).blank()}return s&&r.unshift('const fs = require("fs");'),r.push("req.end(function (res) {").push(1,"if (res.error) throw new Error(res.error);").blank().push(1,"console.log(res.body);").push("});").blank(),r.join().replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/,'fs.createReadStream("$1")')},module.exports.info={key:"unirest",title:"Unirest",link:"http://unirest.io/nodejs.html",description:"Lightweight HTTP Request Client Library"};
|
|
1253
|
+
|
|
1254
|
+
},{"../../helpers/code-builder":81}],117:[function(require,module,exports){
|
|
1255
|
+
"use strict";const util=require("util");module.exports={blankString:function(t){return Array.apply(null,new Array(t)).map(String.prototype.valueOf," ").join("")},nsDeclaration:function(t,e,n,r){const i=t+" *"+e+" = ";return i+this.literalRepresentation(n,r?i.length:void 0)+";"},literalRepresentation:function(t,e){const n=void 0===e?", ":",\n "+this.blankString(e);switch(Object.prototype.toString.call(t)){case"[object Number]":return"@"+t;case"[object Array]":return"@[ "+t.map(function(t){return this.literalRepresentation(t)}.bind(this)).join(n)+" ]";case"[object Object]":{const e=[];for(const n in t)e.push(util.format('@"%s": %s',n,this.literalRepresentation(t[n])));return"@{ "+e.join(n)+" }"}case"[object Boolean]":return t?"@YES":"@NO";default:return null==t?"":'@"'+t.toString().replace(/"/g,'\\"')+'"'}}};
|
|
1256
|
+
|
|
1257
|
+
},{"util":191}],118:[function(require,module,exports){
|
|
1258
|
+
"use strict";module.exports={info:{key:"objc",title:"Objective-C",extname:".m",default:"nsurlsession"},nsurlsession:require("./nsurlsession")};
|
|
1259
|
+
|
|
1260
|
+
},{"./nsurlsession":119}],119:[function(require,module,exports){
|
|
1261
|
+
"use strict";const helpers=require("./helpers"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(a,e){const s=Object.assign({indent:" ",pretty:!0,timeout:"10"},e),t=new CodeBuilder(s.indent),r={hasHeaders:!1,hasBody:!1};if(t.push("#import <Foundation/Foundation.h>"),Object.keys(a.allHeaders).length&&(r.hasHeaders=!0,t.blank().push(helpers.nsDeclaration("NSDictionary","headers",a.allHeaders,s.pretty))),a.postData.text||a.postData.jsonObj||a.postData.params)switch(r.hasBody=!0,a.postData.mimeType){case"application/x-www-form-urlencoded":t.blank().push('NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"%s=%s" dataUsingEncoding:NSUTF8StringEncoding]];',a.postData.params[0].name,a.postData.params[0].value);for(let e=1,s=a.postData.params.length;e<s;e++)t.push('[postData appendData:[@"&%s=%s" dataUsingEncoding:NSUTF8StringEncoding]];',a.postData.params[e].name,a.postData.params[e].value);break;case"application/json":a.postData.jsonObj&&t.push(helpers.nsDeclaration("NSDictionary","parameters",a.postData.jsonObj,s.pretty)).blank().push("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];");break;case"multipart/form-data":t.push(helpers.nsDeclaration("NSArray","parameters",a.postData.params,s.pretty)).push('NSString *boundary = @"%s";',a.postData.boundary).blank().push("NSError *error;").push("NSMutableString *body = [NSMutableString string];").push("for (NSDictionary *param in parameters) {").push(1,'[body appendFormat:@"--%@\\r\\n", boundary];').push(1,'if (param[@"fileName"]) {').push(2,'[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];').push(2,'[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];').push(2,'[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];').push(2,"if (error) {").push(3,'NSLog(@"%@", error);').push(2,"}").push(1,"} else {").push(2,'[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];').push(2,'[body appendFormat:@"%@", param[@"value"]];').push(1,"}").push("}").push('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];').push("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:t.blank().push('NSData *postData = [[NSData alloc] initWithData:[@"'+a.postData.text+'" dataUsingEncoding:NSUTF8StringEncoding]];')}return t.blank().push('NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"'+a.fullUrl+'"]').push(" cachePolicy:NSURLRequestUseProtocolCachePolicy").push(" timeoutInterval:"+parseInt(s.timeout,10).toFixed(1)+"];").push('[request setHTTPMethod:@"'+a.method+'"];'),r.hasHeaders&&t.push("[request setAllHTTPHeaderFields:headers];"),r.hasBody&&t.push("[request setHTTPBody:postData];"),t.blank().push("NSURLSession *session = [NSURLSession sharedSession];").push("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request").push(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {").push(1," if (error) {").push(2,' NSLog(@"%@", error);').push(1," } else {").push(2," NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;").push(2,' NSLog(@"%@", httpResponse);').push(1," }").push(" }];").push("[dataTask resume];"),t.join()},module.exports.info={key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request"};
|
|
1262
|
+
|
|
1263
|
+
},{"../../helpers/code-builder":81,"./helpers":117}],120:[function(require,module,exports){
|
|
1264
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" "},t),o=new CodeBuilder(s.indent);o.push("open Cohttp_lwt_unix").push("open Cohttp").push("open Lwt").blank().push('let uri = Uri.of_string "%s" in',e.fullUrl);const i=Object.keys(e.allHeaders);return 1===i.length?o.push('let headers = Header.add (Header.init ()) "%s" "%s" in',i[0],e.allHeaders[i[0]]):i.length>1&&(o.push("let headers = Header.add_list (Header.init ()) ["),i.forEach(function(t){o.push(1,'("%s", "%s");',t,e.allHeaders[t])}),o.push("] in")),e.postData.text&&o.push("let body = Cohttp_lwt_body.of_string %s in",JSON.stringify(e.postData.text)),o.blank(),o.push("Client.call %s%s%s uri",i.length?"~headers ":"",e.postData.text?"~body ":"",["get","post","head","delete","patch","put","options"].indexOf(e.method.toLowerCase())>=0?"`"+e.method.toUpperCase():'(Code.method_of_string "'+e.method+'")'),o.push(">>= fun (res, body_stream) ->").push(1,"(* Do stuff with the result *)"),o.join()},module.exports.info={key:"cohttp",title:"CoHTTP",link:"https://github.com/mirage/ocaml-cohttp",description:"Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml"};
|
|
1265
|
+
|
|
1266
|
+
},{"../../helpers/code-builder":81}],121:[function(require,module,exports){
|
|
1267
|
+
"use strict";module.exports={info:{key:"ocaml",title:"OCaml",extname:".ml",default:"cohttp"},cohttp:require("./cohttp")};
|
|
1268
|
+
|
|
1269
|
+
},{"./cohttp":120}],122:[function(require,module,exports){
|
|
1270
|
+
"use strict";const util=require("util"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,n){const s=Object.assign({closingTag:!1,indent:" ",maxRedirects:10,namedErrors:!1,noTags:!1,shortTags:!1,timeout:30},n),r=new CodeBuilder(s.indent);s.noTags||r.push(s.shortTags?"<?":"<?php").blank(),r.push("$curl = curl_init();").blank();const u=[{escape:!0,name:"CURLOPT_PORT",value:e.uriObj.port},{escape:!0,name:"CURLOPT_URL",value:e.fullUrl},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:s.maxRedirects},{escape:!1,name:"CURLOPT_TIMEOUT",value:s.timeout},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:"HTTP/1.0"===e.httpVersion?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:e.method},{escape:!0,name:"CURLOPT_POSTFIELDS",value:e.postData?e.postData.text:void 0}];r.push("curl_setopt_array($curl, [");const t=new CodeBuilder(s.indent,"\n"+s.indent);u.forEach(function(e){~[null,void 0].indexOf(e.value)||t.push(util.format("%s => %s,",e.name,e.escape?JSON.stringify(e.value):e.value))});const a=e.cookies.map(function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)});a.length&&t.push(util.format('CURLOPT_COOKIE => "%s",',a.join("; ")));const o=Object.keys(e.headersObj).sort().map(function(n){return util.format('"%s: %s"',n,e.headersObj[n])});return o.length&&t.push("CURLOPT_HTTPHEADER => [").push(1,o.join(",\n"+s.indent+s.indent)).push("],"),r.push(1,t.join()).push("]);").blank().push("$response = curl_exec($curl);").push("$err = curl_error($curl);").blank().push("curl_close($curl);").blank().push("if ($err) {"),s.namedErrors?r.push(1,'echo array_flip(get_defined_constants(true)["curl"])[$err];'):r.push(1,'echo "cURL Error #:" . $err;'),r.push("} else {").push(1,"echo $response;").push("}"),!s.noTags&&s.closingTag&&r.blank().push("?>"),r.join()},module.exports.info={key:"curl",title:"cURL",link:"http://php.net/manual/en/book.curl.php",description:"PHP with ext-curl"};
|
|
1271
|
+
|
|
1272
|
+
},{"../../helpers/code-builder":81,"util":191}],123:[function(require,module,exports){
|
|
1273
|
+
"use strict";const convert=function(e,t,c){let n,r;switch(c||(c=""),Object.prototype.toString.call(e)){case"[object Null]":case"[object Undefined]":r="null";break;case"[object String]":r="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"'")+"'";break;case"[object Number]":r=e.toString();break;case"[object Array]":r=[],e.forEach(function(e){r.push(convert(e,t+t,t))}),r="[\n"+t+r.join(",\n"+t)+"\n"+c+"]";break;case"[object Object]":for(n in r=[],e)e.hasOwnProperty(n)&&r.push(convert(n,t)+" => "+convert(e[n],t+t,t));r="[\n"+t+r.join(",\n"+t)+"\n"+c+"]";break;default:r="null"}return r};module.exports={convert:convert,methods:["ACL","BASELINE_CONTROL","CHECKIN","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LABEL","LOCK","MERGE","MKACTIVITY","MKCOL","MKWORKSPACE","MOVE","OPTIONS","POST","PROPFIND","PROPPATCH","PUT","REPORT","TRACE","UNCHECKOUT","UNLOCK","UPDATE","VERSION_CONTROL"]};
|
|
1274
|
+
|
|
1275
|
+
},{}],124:[function(require,module,exports){
|
|
1276
|
+
"use strict";const helpers=require("./helpers"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({closingTag:!1,indent:" ",noTags:!1,shortTags:!1},t),p=new CodeBuilder(s.indent);switch(s.noTags||p.push(s.shortTags?"<?":"<?php").blank(),~helpers.methods.indexOf(e.method.toUpperCase())||p.push("HttpRequest::methodRegister('%s');",e.method),p.push("$request = new HttpRequest();").push("$request->setUrl(%s);",helpers.convert(e.url)),~helpers.methods.indexOf(e.method.toUpperCase())?p.push("$request->setMethod(HTTP_METH_%s);",e.method.toUpperCase()):p.push("$request->setMethod(HttpRequest::HTTP_METH_%s);",e.method.toUpperCase()),p.blank(),Object.keys(e.queryObj).length&&p.push("$request->setQueryData(%s);",helpers.convert(e.queryObj,s.indent)).blank(),Object.keys(e.headersObj).length&&p.push("$request->setHeaders(%s);",helpers.convert(e.headersObj,s.indent)).blank(),Object.keys(e.cookiesObj).length&&p.push("$request->setCookies(%s);",helpers.convert(e.cookiesObj,s.indent)).blank(),e.postData.mimeType){case"application/x-www-form-urlencoded":p.push("$request->setContentType(%s);",helpers.convert(e.postData.mimeType)).push("$request->setPostFields(%s);",helpers.convert(e.postData.paramsObj,s.indent)).blank();break;default:e.postData.text&&p.push("$request->setBody(%s);",helpers.convert(e.postData.text)).blank()}return p.push("try {").push(1,"$response = $request->send();").blank().push(1,"echo $response->getBody();").push("} catch (HttpException $ex) {").push(1,"echo $ex;").push("}"),!s.noTags&&s.closingTag&&p.blank().push("?>"),p.join()},module.exports.info={key:"http1",title:"HTTP v1",link:"http://php.net/manual/en/book.http.php",description:"PHP with pecl/http v1"};
|
|
1277
|
+
|
|
1278
|
+
},{"../../helpers/code-builder":81,"./helpers":123}],125:[function(require,module,exports){
|
|
1279
|
+
"use strict";const helpers=require("./helpers"),headerHelpers=require("../../helpers/headers"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({closingTag:!1,indent:" ",noTags:!1,shortTags:!1},t),n=new CodeBuilder(s.indent);let r=!1;switch(s.noTags||n.push(s.shortTags?"<?":"<?php").blank(),n.push("$client = new http\\Client;").push("$request = new http\\Client\\Request;").blank(),e.postData.mimeType){case"application/x-www-form-urlencoded":n.push("$body = new http\\Message\\Body;").push("$body->append(new http\\QueryString(%s));",helpers.convert(e.postData.paramsObj,s.indent)).blank(),r=!0;break;case"multipart/form-data":{const t=[],a={};e.postData.params.forEach(function(e){e.fileName?t.push({name:e.name,type:e.contentType,file:e.fileName,data:e.value}):e.value&&(a[e.name]=e.value)}),n.push("$body = new http\\Message\\Body;").push("$body->addForm(%s, %s);",Object.keys(a).length?helpers.convert(a,s.indent):"null",t.length?helpers.convert(t,s.indent):"null"),headerHelpers.hasHeader(e.headersObj,"content-type")&&headerHelpers.getHeader(e.headersObj,"content-type").indexOf("boundary")&&delete e.headersObj[headerHelpers.getHeaderName(e.headersObj,"content-type")],n.blank(),r=!0;break}default:e.postData.text&&(n.push("$body = new http\\Message\\Body;").push("$body->append(%s);",helpers.convert(e.postData.text)).blank(),r=!0)}return n.push("$request->setRequestUrl(%s);",helpers.convert(e.url)).push("$request->setRequestMethod(%s);",helpers.convert(e.method)),r&&n.push("$request->setBody($body);").blank(),Object.keys(e.queryObj).length&&n.push("$request->setQuery(new http\\QueryString(%s));",helpers.convert(e.queryObj,s.indent)).blank(),Object.keys(e.headersObj).length&&n.push("$request->setHeaders(%s);",helpers.convert(e.headersObj,s.indent)).blank(),Object.keys(e.cookiesObj).length&&n.blank().push("$client->setCookies(%s);",helpers.convert(e.cookiesObj,s.indent)).blank(),n.push("$client->enqueue($request)->send();").push("$response = $client->getResponse();").blank().push("echo $response->getBody();"),!s.noTags&&s.closingTag&&n.blank().push("?>"),n.join()},module.exports.info={key:"http2",title:"HTTP v2",link:"http://devel-m6w6.rhcloud.com/mdref/http",description:"PHP with pecl/http v2"};
|
|
1280
|
+
|
|
1281
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83,"./helpers":123}],126:[function(require,module,exports){
|
|
1282
|
+
"use strict";module.exports={info:{key:"php",title:"PHP",extname:".php",default:"curl"},curl:require("./curl"),http1:require("./http1"),http2:require("./http2")};
|
|
1283
|
+
|
|
1284
|
+
},{"./curl":122,"./http1":124,"./http2":125}],127:[function(require,module,exports){
|
|
1285
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder"),helpers=require("../../helpers/headers");module.exports=function(e){return function(s,o){const t=new CodeBuilder;if(-1===["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].indexOf(s.method.toUpperCase()))return"Method not supported";const r=[],n=Object.keys(s.headersObj);return n.length&&(t.push("$headers=@{}"),n.forEach(function(e){"connection"!==e&&t.push('$headers.Add("%s", "%s")',e,s.headersObj[e])}),r.push("-Headers $headers")),s.cookies.length&&(t.push("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),s.cookies.forEach(function(e){t.push("$cookie = New-Object System.Net.Cookie"),t.push("$cookie.Name = '%s'",e.name),t.push("$cookie.Value = '%s'",e.value),t.push("$cookie.Domain = '%s'",s.uriObj.host),t.push("$session.Cookies.Add($cookie)")}),r.push("-WebSession $session")),s.postData.text&&(r.push("-ContentType '"+helpers.getHeader(s.allHeaders,"content-type")+"'"),r.push("-Body '"+s.postData.text+"'")),t.push("$response = %s -Uri '%s' -Method %s %s",e,s.fullUrl,s.method,r.join(" ")),t.join()}};
|
|
1286
|
+
|
|
1287
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83}],128:[function(require,module,exports){
|
|
1288
|
+
"use strict";module.exports={info:{key:"powershell",title:"Powershell",extname:".ps1",default:"webrequest"},webrequest:require("./webrequest"),restmethod:require("./restmethod")};
|
|
1289
|
+
|
|
1290
|
+
},{"./restmethod":129,"./webrequest":130}],129:[function(require,module,exports){
|
|
1291
|
+
"use strict";module.exports=require("./common")("Invoke-RestMethod"),module.exports.info={key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client"};
|
|
1292
|
+
|
|
1293
|
+
},{"./common":127}],130:[function(require,module,exports){
|
|
1294
|
+
"use strict";module.exports=require("./common")("Invoke-WebRequest"),module.exports.info={key:"webrequest",title:"Invoke-WebRequest",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",description:"Powershell Invoke-WebRequest client"};
|
|
1295
|
+
|
|
1296
|
+
},{"./common":127}],131:[function(require,module,exports){
|
|
1297
|
+
"use strict";const util=require("util");function buildString(t,e){return Array.apply(null,new Array(t)).map(String.prototype.valueOf,e).join("")}function concatValues(t,e,n,r,o){const c=buildString(o,r),i=buildString(o-1,r),l=n?",\n"+c:", ",a="object"===t?"{":"[",u="object"===t?"}":"]";return n?a+"\n"+c+e.join(l)+"\n"+i+u:a+e.join(l)+u}module.exports={literalRepresentation:function(t,e,n){switch(n=void 0===n?1:n+1,Object.prototype.toString.call(t)){case"[object Number]":return t;case"[object Array]":{let r=!1;return concatValues("array",t.map(function(t){return"[object Object]"===Object.prototype.toString.call(t)&&(r=Object.keys(t).length>1),this.literalRepresentation(t,e,n)}.bind(this)),r,e.indent,n)}case"[object Object]":{const r=[];for(const o in t)r.push(util.format('"%s": %s',o,this.literalRepresentation(t[o],e,n)));return concatValues("object",r,e.pretty&&r.length>1,e.indent,n)}case"[object Null]":return"None";case"[object Boolean]":return t?"True":"False";default:return null==t?"":'"'+t.toString().replace(/"/g,'\\"')+'"'}}};
|
|
1298
|
+
|
|
1299
|
+
},{"util":191}],132:[function(require,module,exports){
|
|
1300
|
+
"use strict";module.exports={info:{key:"python",title:"Python",extname:".py",default:"python3"},python3:require("./python3"),requests:require("./requests")};
|
|
1301
|
+
|
|
1302
|
+
},{"./python3":133,"./requests":134}],133:[function(require,module,exports){
|
|
1303
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(s,t){const e=new CodeBuilder;e.push("import http.client").blank(),"https:"===s.uriObj.protocol?e.push('conn = http.client.HTTPSConnection("%s")',s.uriObj.host).blank():e.push('conn = http.client.HTTPConnection("%s")',s.uriObj.host).blank();const n=JSON.stringify(s.postData.text);n&&e.push("payload = %s",n).blank();const o=s.allHeaders,r=Object.keys(o).length;if(1===r)for(const s in o)e.push("headers = { '%s': \"%s\" }",s,o[s]).blank();else if(r>1){let s=1;e.push("headers = {");for(const t in o)s++!==r?e.push(" '%s': \"%s\",",t,o[t]):e.push(" '%s': \"%s\"",t,o[t]);e.push(" }").blank()}const h=s.method,p=s.uriObj.path;return n&&r?e.push('conn.request("%s", "%s", payload, headers)',h,p):n&&!r?e.push('conn.request("%s", "%s", payload)',h,p):!n&&r?e.push('conn.request("%s", "%s", headers=headers)',h,p):e.push('conn.request("%s", "%s")',h,p),e.blank().push("res = conn.getresponse()").push("data = res.read()").blank().push('print(data.decode("utf-8"))'),e.join()},module.exports.info={key:"python3",title:"http.client",link:"https://docs.python.org/3/library/http.client.html",description:"Python3 HTTP Client"};
|
|
1304
|
+
|
|
1305
|
+
},{"../../helpers/code-builder":81}],134:[function(require,module,exports){
|
|
1306
|
+
"use strict";const util=require("util"),CodeBuilder=require("../../helpers/code-builder"),helpers=require("./helpers");module.exports=function(e,s){const t=Object.assign({indent:" ",pretty:!0},s),r=new CodeBuilder(t.indent);let n;r.push("import requests").blank(),r.push('url = "%s"',e.url).blank(),Object.keys(e.queryObj).length&&(n="querystring = "+JSON.stringify(e.queryObj),r.push(n).blank());let a=!1,u=!1;switch(e.postData.mimeType){case"application/json":e.postData.jsonObj&&(r.push("payload = %s",helpers.literalRepresentation(e.postData.jsonObj,t)),u=!0,a=!0);break;default:{const s=JSON.stringify(e.postData.text);s&&(r.push("payload = %s",s),a=!0)}}const l=e.allHeaders,o=Object.keys(l).length;if(1===o)for(const e in l)r.push('headers = {"%s": "%s"}',e,l[e]).blank();else if(o>1){let e=1;r.push("headers = {");for(const s in l)e++!==o?r.push(1,'"%s": "%s",',s,l[s]):r.push(1,'"%s": "%s"',s,l[s]);r.push("}").blank()}const i=e.method;let p=util.format('response = requests.request("%s", url',i);return a&&(p+=u?", json=payload":", data=payload"),o>0&&(p+=", headers=headers"),n&&(p+=", params=querystring"),p+=")",r.push(p).blank().push("print(response.text)"),r.join()},module.exports.info={key:"requests",title:"Requests",link:"http://docs.python-requests.org/en/latest/api/#requests.request",description:"Requests HTTP library"};
|
|
1307
|
+
|
|
1308
|
+
},{"../../helpers/code-builder":81,"./helpers":131,"util":191}],135:[function(require,module,exports){
|
|
1309
|
+
"use strict";const util=require("util"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=new CodeBuilder;s.push("library(httr)").blank(),s.push('url <- "%s"',e.url).blank();const o=e.queryObj,r=Object.keys(o).length;if(delete e.queryObj.key,1===e.queryString.length)s.push('queryString <- list(%s = "%s")',Object.keys(o),Object.values(o).toString()).blank();else if(e.queryString.length>1){let e=1;s.push("queryString <- list(");for(const t in o)e++!=r-1?s.push(' %s = "%s",',t,o[t].toString()):s.push(' %s = "%s"',t,o[t].toString());s.push(")").blank()}const a=JSON.stringify(e.postData.text);if(a&&s.push("payload <- %s",a).blank(),e.postData.text||e.postData.jsonObj||e.postData.params)switch(e.postData.mimeType){case"application/x-www-form-urlencoded":s.push('encode <- "form"').blank();break;case"application/json":s.push('encode <- "json"').blank();break;case"multipart/form-data":s.push('encode <- "multipart"').blank();break;default:s.push('encode <- "raw"').blank()}const n=e.allHeaders;let l,i,p=Object.keys(n).length,c="";for(const e in n)"accept"===e.toLowerCase()?(i=', accept("'+n[e]+'")',p-=1):"cookie"===e.toLowerCase()?(l=", set_cookies(`"+n[e].replace(/;/g,'", `').replace(/` /g,"`").replace(/=/g,'` = "')+'")',p-=1):"content-type"!==e.toLowerCase()&&(c=c+e.replace("-","_")+" = '"+n[e],p>1&&(c+="', "));const u=e.method;let d=util.format('response <- VERB("%s", url',u);return a&&(d+=", body = payload"),""!==c&&(d+=", add_headers("+c+"')"),e.queryString.length&&(d+=", query = queryString"),d+=', content_type("'+e.postData.mimeType+'")',void 0!==i&&(d+=i),void 0!==l&&(d+=l),(e.postData.text||e.postData.jsonObj||e.postData.params)&&(d+=", encode = encode"),d+=")",s.push(d).blank().push('content(response, "text")'),s.join()},module.exports.info={key:"httr",title:"httr",link:"https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",description:"httr: Tools for Working with URLs and HTTP"};
|
|
1310
|
+
|
|
1311
|
+
},{"../../helpers/code-builder":81,"util":191}],136:[function(require,module,exports){
|
|
1312
|
+
"use strict";module.exports={info:{key:"r",title:"R",extname:".r",default:"httr"},httr:require("./httr")};
|
|
1313
|
+
|
|
1314
|
+
},{"./httr":135}],137:[function(require,module,exports){
|
|
1315
|
+
"use strict";module.exports={info:{key:"ruby",title:"Ruby",extname:".rb",default:"native"},native:require("./native")};
|
|
1316
|
+
|
|
1317
|
+
},{"./native":138}],138:[function(require,module,exports){
|
|
1318
|
+
"use strict";const CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=new CodeBuilder;s.push("require 'uri'").push("require 'net/http'"),"https:"===e.uriObj.protocol&&s.push("require 'openssl'"),s.blank();const r=e.method.toUpperCase(),u=r.charAt(0)+r.substring(1).toLowerCase();["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"].indexOf(r)<0&&s.push("class Net::HTTP::%s < Net::HTTPRequest",u).push(" METHOD = '%s'",r.toUpperCase()).push(" REQUEST_HAS_BODY = '%s'",e.postData.text?"true":"false").push(" RESPONSE_HAS_BODY = true").push("end").blank(),s.push('url = URI("%s")',e.fullUrl).blank().push("http = Net::HTTP.new(url.host, url.port)"),"https:"===e.uriObj.protocol&&s.push("http.use_ssl = true").push("http.verify_mode = OpenSSL::SSL::VERIFY_NONE"),s.blank().push("request = Net::HTTP::%s.new(url)",u);const p=Object.keys(e.allHeaders);return p.length&&p.forEach(function(t){s.push("request[\"%s\"] = '%s'",t,e.allHeaders[t])}),e.postData.text&&s.push("request.body = %s",JSON.stringify(e.postData.text)),s.blank().push("response = http.request(request)").push("puts response.read_body"),s.join()},module.exports.info={key:"native",title:"net::http",link:"http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",description:"Ruby HTTP client"};
|
|
1319
|
+
|
|
1320
|
+
},{"../../helpers/code-builder":81}],139:[function(require,module,exports){
|
|
1321
|
+
"use strict";const util=require("util"),helpers=require("../../helpers/shell"),headerHelpers=require("../../helpers/headers"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" ",short:!1,binary:!1,globOff:!1},t),a=new CodeBuilder(s.indent,!1!==s.indent?" \\\n"+s.indent:" "),r=s.short?"-g":"--globoff",o=s.short?"-X":"--request";let l=helpers.quote(e.fullUrl);if(a.push("curl %s %s",o,e.method),s.globOff&&(l=unescape(l),a.push(r)),a.push(util.format("%s%s",s.short?"":"--url ",l)),"HTTP/1.0"===e.httpVersion&&a.push(s.short?"-0":"--http1.0"),"multipart/form-data"===e.postData.mimeType){const t=headerHelpers.getHeaderName(e.headersObj,"content-type"),s=e.headersObj[t];if(t&&s){const a=s.replace(/; boundary.+?(?=(;|$))/,"");e.headersObj[t]=a,e.allHeaders[t]=a}}switch(Object.keys(e.headersObj).sort().forEach(function(t){const r=util.format("%s: %s",t,e.headersObj[t]);a.push("%s %s",s.short?"-H":"--header",helpers.quote(r))}),e.allHeaders.cookie&&a.push("%s %s",s.short?"-b":"--cookie",helpers.quote(e.allHeaders.cookie)),e.postData.mimeType){case"multipart/form-data":e.postData.params.forEach(function(e){let t="";t=e.fileName?util.format("%s=@%s",e.name,e.fileName):util.format("%s=%s",e.name,e.value),a.push("%s %s",s.short?"-F":"--form",helpers.quote(t))});break;case"application/x-www-form-urlencoded":e.postData.params?e.postData.params.forEach(function(e){a.push("%s %s",s.binary?"--data-binary":s.short?"-d":"--data",helpers.quote(util.format("%s=%s",e.name,e.value)))}):a.push("%s %s",s.binary?"--data-binary":s.short?"-d":"--data",helpers.quote(e.postData.text));break;default:e.postData.text&&a.push("%s %s",s.binary?"--data-binary":s.short?"-d":"--data",helpers.quote(e.postData.text))}return a.join()},module.exports.info={key:"curl",title:"cURL",link:"http://curl.haxx.se/",description:"cURL is a command line tool and library for transferring data with URL syntax"};
|
|
1322
|
+
|
|
1323
|
+
},{"../../helpers/code-builder":81,"../../helpers/headers":83,"../../helpers/shell":85,"util":191}],140:[function(require,module,exports){
|
|
1324
|
+
"use strict";const util=require("util"),shell=require("../../helpers/shell"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(t,e){const s=Object.assign({body:!1,cert:!1,headers:!1,indent:" ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1},e),r=new CodeBuilder(s.indent,!1!==s.indent?" \\\n"+s.indent:" ");let o=!1;const u=[];if(s.headers&&u.push(s.short?"-h":"--headers"),s.body&&u.push(s.short?"-b":"--body"),s.verbose&&u.push(s.short?"-v":"--verbose"),s.print&&u.push(util.format("%s=%s",s.short?"-p":"--print",s.print)),s.verify&&u.push(util.format("--verify=%s",s.verify)),s.cert&&u.push(util.format("--cert=%s",s.cert)),s.pretty&&u.push(util.format("--pretty=%s",s.pretty)),s.style&&u.push(util.format("--style=%s",s.pretty)),s.timeout&&u.push(util.format("--timeout=%s",s.timeout)),s.queryParams){Object.keys(t.queryObj).forEach(function(e){const s=t.queryObj[e];Array.isArray(s)?s.forEach(function(t){r.push("%s==%s",e,shell.quote(t))}):r.push("%s==%s",e,shell.quote(s))})}return Object.keys(t.allHeaders).sort().forEach(function(e){r.push("%s:%s",e,shell.quote(t.allHeaders[e]))}),"application/x-www-form-urlencoded"===t.postData.mimeType?t.postData.params&&t.postData.params.length&&(u.push(s.short?"-f":"--form"),t.postData.params.forEach(function(t){r.push("%s=%s",t.name,shell.quote(t.value))})):o=!0,r.unshift("http %s%s %s",u.length?u.join(" ")+" ":"",t.method,shell.quote(s.queryParams?t.url:t.fullUrl)),o&&t.postData.text&&r.unshift("echo %s | ",shell.quote(t.postData.text)),r.join()},module.exports.info={key:"httpie",title:"HTTPie",link:"http://httpie.org/",description:"a CLI, cURL-like tool for humans"};
|
|
1325
|
+
|
|
1326
|
+
},{"../../helpers/code-builder":81,"../../helpers/shell":85,"util":191}],141:[function(require,module,exports){
|
|
1327
|
+
"use strict";module.exports={info:{key:"shell",title:"Shell",extname:".sh",default:"curl"},curl:require("./curl"),httpie:require("./httpie"),wget:require("./wget")};
|
|
1328
|
+
|
|
1329
|
+
},{"./curl":139,"./httpie":140,"./wget":142}],142:[function(require,module,exports){
|
|
1330
|
+
"use strict";const util=require("util"),helpers=require("../../helpers/shell"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,t){const s=Object.assign({indent:" ",short:!1,verbose:!1},t),r=new CodeBuilder(s.indent,!1!==s.indent?" \\\n"+s.indent:" ");return s.verbose?r.push("wget %s",s.short?"-v":"--verbose"):r.push("wget %s",s.short?"-q":"--quiet"),r.push("--method %s",helpers.quote(e.method)),Object.keys(e.allHeaders).forEach(function(t){const s=util.format("%s: %s",t,e.allHeaders[t]);r.push("--header %s",helpers.quote(s))}),e.postData.text&&r.push("--body-data "+helpers.escape(helpers.quote(e.postData.text))),r.push(s.short?"-O":"--output-document").push("- %s",helpers.quote(e.fullUrl)),r.join()},module.exports.info={key:"wget",title:"Wget",link:"https://www.gnu.org/software/wget/",description:"a free software package for retrieving files using HTTP, HTTPS"};
|
|
1331
|
+
|
|
1332
|
+
},{"../../helpers/code-builder":81,"../../helpers/shell":85,"util":191}],143:[function(require,module,exports){
|
|
1333
|
+
"use strict";const util=require("util");function buildString(t,e){return Array.apply(null,new Array(t)).map(String.prototype.valueOf,e).join("")}function concatArray(t,e,n,r){const i=buildString(r,n),o=buildString(r-1,n),l=e?",\n"+i:", ";return e?"[\n"+i+t.join(l)+"\n"+o+"]":"["+t.join(l)+"]"}module.exports={literalDeclaration:function(t,e,n){return util.format("let %s = %s",t,this.literalRepresentation(e,n))},literalRepresentation:function(t,e,n){switch(n=void 0===n?1:n+1,Object.prototype.toString.call(t)){case"[object Number]":return t;case"[object Array]":{let r=!1;return concatArray(t.map(function(t){return"[object Object]"===Object.prototype.toString.call(t)&&(r=Object.keys(t).length>1),this.literalRepresentation(t,e,n)}.bind(this)),r,e.indent,n)}case"[object Object]":{const r=[];for(const i in t)r.push(util.format('"%s": %s',i,this.literalRepresentation(t[i],e,n)));return concatArray(r,e.pretty&&r.length>1,e.indent,n)}case"[object Boolean]":return t.toString();default:return null==t?"":'"'+t.toString().replace(/"/g,'\\"')+'"'}}};
|
|
1334
|
+
|
|
1335
|
+
},{"util":191}],144:[function(require,module,exports){
|
|
1336
|
+
"use strict";module.exports={info:{key:"swift",title:"Swift",extname:".swift",default:"nsurlsession"},nsurlsession:require("./nsurlsession")};
|
|
1337
|
+
|
|
1338
|
+
},{"./nsurlsession":145}],145:[function(require,module,exports){
|
|
1339
|
+
"use strict";const helpers=require("./helpers"),CodeBuilder=require("../../helpers/code-builder");module.exports=function(e,a){const s=Object.assign({indent:" ",pretty:!0,timeout:"10"},a),t=new CodeBuilder(s.indent),r={hasHeaders:!1,hasBody:!1};if(t.push("import Foundation"),Object.keys(e.allHeaders).length&&(r.hasHeaders=!0,t.blank().push(helpers.literalDeclaration("headers",e.allHeaders,s))),e.postData.text||e.postData.jsonObj||e.postData.params)switch(r.hasBody=!0,e.postData.mimeType){case"application/x-www-form-urlencoded":t.blank().push('let postData = NSMutableData(data: "%s=%s".data(using: String.Encoding.utf8)!)',e.postData.params[0].name,e.postData.params[0].value);for(let a=1,s=e.postData.params.length;a<s;a++)t.push('postData.append("&%s=%s".data(using: String.Encoding.utf8)!)',e.postData.params[a].name,e.postData.params[a].value);break;case"application/json":e.postData.jsonObj&&t.push(helpers.literalDeclaration("parameters",e.postData.jsonObj,s),"as [String : Any]").blank().push("let postData = JSONSerialization.data(withJSONObject: parameters, options: [])");break;case"multipart/form-data":t.push(helpers.literalDeclaration("parameters",e.postData.params,s)).blank().push('let boundary = "%s"',e.postData.boundary).blank().push('var body = ""').push("var error: NSError? = nil").push("for param in parameters {").push(1,'let paramName = param["name"]!').push(1,'body += "--\\(boundary)\\r\\n"').push(1,'body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""').push(1,'if let filename = param["fileName"] {').push(2,'let contentType = param["content-type"]!').push(2,"let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)").push(2,"if (error != nil) {").push(3,"print(error)").push(2,"}").push(2,'body += "; filename=\\"\\(filename)\\"\\r\\n"').push(2,'body += "Content-Type: \\(contentType)\\r\\n\\r\\n"').push(2,"body += fileContent").push(1,'} else if let paramValue = param["value"] {').push(2,'body += "\\r\\n\\r\\n\\(paramValue)"').push(1,"}").push("}");break;default:t.blank().push('let postData = NSData(data: "%s".data(using: String.Encoding.utf8)!)',e.postData.text)}return t.blank().push('let request = NSMutableURLRequest(url: NSURL(string: "%s")! as URL,',e.fullUrl).push(" cachePolicy: .useProtocolCachePolicy,").push(" timeoutInterval: %s)",parseInt(s.timeout,10).toFixed(1)).push('request.httpMethod = "%s"',e.method),r.hasHeaders&&t.push("request.allHTTPHeaderFields = headers"),r.hasBody&&t.push("request.httpBody = postData as Data"),t.blank().push("let session = URLSession.shared").push("let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in").push(1,"if (error != nil) {").push(2,"print(error)").push(1,"} else {").push(2,"let httpResponse = response as? HTTPURLResponse").push(2,"print(httpResponse)").push(1,"}").push("})").blank().push("dataTask.resume()"),t.join()},module.exports.info={key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request"};
|
|
1340
|
+
|
|
1341
|
+
},{"../../helpers/code-builder":81,"./helpers":143}],146:[function(require,module,exports){
|
|
1342
|
+
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
|
|
1343
|
+
|
|
1344
|
+
},{}],147:[function(require,module,exports){
|
|
1345
|
+
"function"==typeof Object.create?module.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}};
|
|
1346
|
+
|
|
1347
|
+
},{}],148:[function(require,module,exports){
|
|
1348
|
+
function isBuffer(f){return!!f.constructor&&"function"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}function isSlowBuffer(f){return"function"==typeof f.readFloatLE&&"function"==typeof f.slice&&isBuffer(f.slice(0,0))}module.exports=function(f){return null!=f&&(isBuffer(f)||isSlowBuffer(f)||!!f._isBuffer)};
|
|
1349
|
+
|
|
1350
|
+
},{}],149:[function(require,module,exports){
|
|
1351
|
+
"use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};
|
|
1352
|
+
|
|
1353
|
+
},{}],150:[function(require,module,exports){
|
|
1354
|
+
"use strict";module.exports=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)};
|
|
1355
|
+
|
|
1356
|
+
},{}],151:[function(require,module,exports){
|
|
1357
|
+
var toString={}.toString;module.exports=Array.isArray||function(r){return"[object Array]"==toString.call(r)};
|
|
1358
|
+
|
|
1359
|
+
},{}],152:[function(require,module,exports){
|
|
1360
|
+
"use strict";var traverse=module.exports=function(e,r,t){"function"==typeof r&&(t=r,r={}),_traverse(r,"function"==typeof(t=r.cb||t)?t:t.pre||function(){},t.post||function(){},e,"",e)};function _traverse(e,r,t,s,i,a,n,o,p,m){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var f in r(s,i,a,n,o,p,m),s){var u=s[f];if(Array.isArray(u)){if(f in traverse.arrayKeywords)for(var v=0;v<u.length;v++)_traverse(e,r,t,u[v],i+"/"+f+"/"+v,a,i,f,s,v)}else if(f in traverse.propsKeywords){if(u&&"object"==typeof u)for(var y in u)_traverse(e,r,t,u[y],i+"/"+f+"/"+escapeJsonPtr(y),a,i,f,s,y)}else(f in traverse.keywords||e.allKeys&&!(f in traverse.skipKeywords))&&_traverse(e,r,t,u,i+"/"+f,a,i,f,s)}t(s,i,a,n,o,p,m)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}traverse.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},traverse.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},traverse.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},traverse.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};
|
|
1361
|
+
|
|
1362
|
+
},{}],153:[function(require,module,exports){
|
|
1363
|
+
(function (process){
|
|
1364
|
+
var Stream=require("stream").Stream;module.exports=function(r,e){var t=new Stream,i=this,n=0,a=0,o=!1,u=!1,s=!1,l=0,f=!1;this.opts=e||{};var c=this.opts.failures?"failure":"error",d={};function m(r,e){var i=l+1;if(e===i?(void 0!==r&&t.emit.apply(t,["data",r]),l++,i++):d[e]=r,d.hasOwnProperty(i)){var s=d[i];return delete d[i],m(s,i)}n===++a&&(u&&(u=!1,t.emit("drain")),o&&w())}function p(r,e,n){s||(f=!0,r&&!i.opts.failures||m(e,n),r&&t.emit.apply(t,[c,r]),f=!1)}function w(r){if(o=!0,t.writable=!1,void 0!==r)return m(r,n);n==a&&(t.readable=!1,t.emit("end"),t.destroy())}return t.writable=!0,t.readable=!0,t.write=function(e){if(o)throw new Error("map stream is not writable");f=!1,n++;try{var t=(i=e,a=n,s=p,r.call(null,i,function(r,e){s(r,e,a)}));return!(u=!1===t)}catch(r){if(f)throw r;return p(r),!u}var i,a,s},t.end=function(r){o||w()},t.destroy=function(){o=s=!0,t.writable=t.readable=u=!1,process.nextTick(function(){t.emit("close")})},t.pause=function(){u=!0},t.resume=function(){u=!1},t};
|
|
1365
|
+
|
|
1366
|
+
}).call(this,require('_process'))
|
|
1367
|
+
},{"_process":158,"stream":179}],154:[function(require,module,exports){
|
|
1368
|
+
var s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d;function parse(e){if(!((e=String(e)).length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*y;case"days":case"day":case"d":return a*d;case"hours":case"hour":case"hrs":case"hr":case"h":return a*h;case"minutes":case"minute":case"mins":case"min":case"m":return a*m;case"seconds":case"second":case"secs":case"sec":case"s":return a*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(s,e,r){if(!(s<e))return s<1.5*e?Math.floor(s/e)+" "+r:Math.ceil(s/e)+" "+r+"s"}module.exports=function(s,e){e=e||{};var r=typeof s;if("string"===r&&s.length>0)return parse(s);if("number"===r&&!1===isNaN(s))return e.long?fmtLong(s):fmtShort(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};
|
|
1369
|
+
|
|
1370
|
+
},{}],155:[function(require,module,exports){
|
|
1371
|
+
(function (global){
|
|
1372
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).OpenAPISampler=e()}}(function(){return function(){return function e(r,t,n){function i(a,u){if(!t[a]){if(!r[a]){var l="function"==typeof require&&require;if(!u&&l)return l(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=t[a]={exports:{}};r[a][0].call(c.exports,function(e){return i(r[a][1][e]||e)},c,c.exports,e,r,t,n)}return t[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}}()({1:[function(e,r,t){var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString;r.exports=function(e,r,t){if("[object Function]"!==i.call(r))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a<o;a++)r.call(t,e[a],a,e);else for(var u in e)n.call(e,u)&&r.call(t,e[u],u,e)}},{}],2:[function(e,r,t){"use strict";var n=e("foreach");function i(e,r,t){if(3===arguments.length)return i.set(e,r,t);if(2===arguments.length)return i.get(e,r);var n=i.bind(i,e);for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o].bind(n,e));return n}r.exports=i,i.get=function(e,r){for(var t=Array.isArray(r)?r:i.parse(r),n=0;n<t.length;++n){var o=t[n];if(!("object"==typeof e&&o in e))throw new Error("Invalid reference token: "+o);e=e[o]}return e},i.set=function(e,r,t){for(var n=Array.isArray(r)?r:i.parse(r),o=n[0],a=0;a<n.length-1;++a){var u=n[a];"-"===u&&Array.isArray(e)&&(u=e.length),o=n[a+1],u in e||(o.match(/^(\d+|-)$/)?e[u]=[]:e[u]={}),e=e[u]}return"-"===o&&Array.isArray(e)&&(o=e.length),e[o]=t,this},i.remove=function(e,r){var t=Array.isArray(r)?r:i.parse(r),n=t[t.length-1];if(void 0===n)throw new Error('Invalid JSON pointer for remove: "'+r+'"');var o=i.get(e,t.slice(0,-1));if(Array.isArray(o)){var a=+n;if(""===n&&isNaN(a))throw new Error('Invalid array index: "'+n+'"');Array.prototype.splice.call(o,a,1)}else delete o[n]},i.dict=function(e,r){var t={};return i.walk(e,function(e,r){t[r]=e},r),t},i.walk=function(e,r,t){var o=[];t=t||function(e){var r=Object.prototype.toString.call(e);return"[object Object]"===r||"[object Array]"===r},function e(a){n(a,function(n,a){o.push(String(a)),t(n)?e(n):r(n,i.compile(o)),o.pop()})}(e)},i.has=function(e,r){try{i.get(e,r)}catch(e){return!1}return!0},i.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")},i.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},i.parse=function(e){if(""===e)return[];if("/"!==e.charAt(0))throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(i.unescape)},i.compile=function(e){return 0===e.length?"":"/"+e.map(i.escape).join("/")}},{foreach:1}],3:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allOfSample=function(e,r,t,a){var u=(0,n.traverse)(e,t,a),l=[],f=!0,c=!1,s=void 0;try{for(var m,p=r[Symbol.iterator]();!(f=(m=p.next()).done);f=!0){var y=m.value,v=(0,n.traverse)(o({type:d},y),t,a),d=v.type,b=v.readOnly,g=v.writeOnly,O=v.value;if(u.type&&d&&d!==u.type)throw new Error("allOf: schemas with different types can't be merged");u.type=u.type||d,u.readOnly=u.readOnly||b,u.writeOnly=u.writeOnly||g,null!=O&&l.push(O)}}catch(e){c=!0,s=e}finally{try{f||null==p.return||p.return()}finally{if(c)throw s}}if("object"===u.type)return u.value=i.mergeDeep.apply(void 0,[u.value||{}].concat(l)),u;"array"===u.type&&(t.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));var h=l[l.length-1];return u.value=null!=h?h:u.value,u};var n=e("./traverse"),i=e("./utils");function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){a(e,r,t[r])})}return e}function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}},{"./traverse":12,"./utils":13}],4:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inferType=function(e){if(void 0!==e.type)return e.type;for(var r=Object.keys(n),t=0;t<r.length;t++){var i=r[t],o=n[i];if(void 0!==e[i])return o}return null};var n={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"}},{}],5:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=function(e,r,t){var i=Object.assign({},u,r);return(0,n.clearCache)(),(0,n.traverse)(e,i,t).value},t._registerSampler=l,Object.defineProperty(t,"inferType",{enumerable:!0,get:function(){return o.inferType}}),t._samplers=void 0;var n=e("./traverse"),i=e("./samplers/index"),o=e("./infer"),a={};t._samplers=a;var u={skipReadOnly:!1};function l(e,r){a[e]=r}l("array",i.sampleArray),l("boolean",i.sampleBoolean),l("integer",i.sampleNumber),l("number",i.sampleNumber),l("object",i.sampleObject),l("string",i.sampleString)},{"./infer":4,"./samplers/index":8,"./traverse":12}],6:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleArray=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,i=e.minItems||1;Array.isArray(e.items)&&(i=Math.max(i,e.items.length));var o=function(r){return Array.isArray(e.items)?e.items[r]||{}:e.items||{}},a=[];if(!e.items)return a;for(var u=0;u<i;u++){var l=o(u),f=(0,n.traverse)(l,r,t),c=f.value;a.push(c)}return a};var n=e("../traverse")},{"../traverse":12}],7:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleBoolean=function(e){return!0}},{}],8:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"sampleArray",{enumerable:!0,get:function(){return n.sampleArray}}),Object.defineProperty(t,"sampleBoolean",{enumerable:!0,get:function(){return i.sampleBoolean}}),Object.defineProperty(t,"sampleNumber",{enumerable:!0,get:function(){return o.sampleNumber}}),Object.defineProperty(t,"sampleObject",{enumerable:!0,get:function(){return a.sampleObject}}),Object.defineProperty(t,"sampleString",{enumerable:!0,get:function(){return u.sampleString}});var n=e("./array"),i=e("./boolean"),o=e("./number"),a=e("./object"),u=e("./string")},{"./array":6,"./boolean":7,"./number":9,"./object":10,"./string":11}],9:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleNumber=function(e){var r;if(e.maximum&&e.minimum)return r=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&r>=e.maximum||!e.exclusiveMaximum&&r>e.maximum)&&(r=(e.maximum+e.minimum)/2),r;if(e.minimum)return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(e.maximum)return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum;return 0}},{}],10:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleObject=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,o={};if(e&&"object"===i(e.properties)){var a=Array.isArray(e.required)?e.required:[],u=a.reduce(function(e,r){return e[r]=!0,e},{});Object.keys(e.properties).forEach(function(i){if(!r.skipNonRequired||u.hasOwnProperty(i)){var a=(0,n.traverse)(e.properties[i],r,t);r.skipReadOnly&&a.readOnly||r.skipWriteOnly&&a.writeOnly||(o[i]=a.value)}})}e&&"object"===i(e.additionalProperties)&&(o.property1=(0,n.traverse)(e.additionalProperties,r,t).value,o.property2=(0,n.traverse)(e.additionalProperties,r,t).value);return o};var n=e("../traverse");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{"../traverse":12}],11:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleString=function(e){var r=e.format||"default";return(u[r]||a)(0|e.minLength,e.maxLength)};var n=e("../utils"),i="qwerty!@#$%^123456";function o(e,r,t){var i=(0,n.toRFCDateTime)(new Date,t,!1);if(i.length<e)throw new Error("Using minLength = ".concat(e,' is incorrect with format "date-time"'));if(r&&i.length>r)throw new Error("Using maxLength = ".concat(r,' is incorrect with format "date-time"'));return i}function a(e,r){var t=(0,n.ensureMinLength)("string",e);return r&&t.length>r&&(t=t.substring(0,r)),t}var u={email:function(){return"user@example.com"},password:function(e,r){var t="pa$$word";return e>t.length&&(t+="_",t+=(0,n.ensureMinLength)(i,e-t.length).substring(0,e-t.length)),t},"date-time":function(e,r){return o(e,r)},date:function(e,r){return o(e,r,!0)},ipv4:function(){return"192.168.0.1"},ipv6:function(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"},hostname:function(){return"example.com"},uri:function(){return"http://example.com"},default:a}},{"../utils":13}],12:[function(e,r,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearCache=function(){f={}},t.traverse=function e(r,t,n){if(r.$ref){if(!n)throw new Error("Your schema contains $ref. You must provide specification in the third parameter.");var c=decodeURIComponent(r.$ref);c.startsWith("#")&&(c=c.substring(1));var s,m=u.default.get(n,c);if(!0!==f[c])f[c]=!0,s=e(m,t,n),f[c]=!1;else{var p=(0,a.inferType)(m);s={value:"object"===p?{}:"array"===p?[]:void 0}}return s}if(void 0!==r.example)return{value:r.example,readOnly:r.readOnly,writeOnly:r.writeOnly,type:r.type};if(void 0!==r.allOf)return(0,o.allOfSample)(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){l(e,r,t[r])})}return e}({},r,{allOf:void 0}),r.allOf,t,n);if(r.oneOf&&r.oneOf.length)return r.anyOf&&(t.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),e(r.oneOf[0],t,n);if(r.anyOf&&r.anyOf.length)return e(r.anyOf[0],t,n);var y=null;var v=null;if(void 0!==r.default)y=r.default;else if(void 0!==r.const)y=r.const;else if(void 0!==r.enum&&r.enum.length)y=r.enum[0];else if(void 0!==r.examples&&r.examples.length)y=r.examples[0];else{(v=r.type)||(v=(0,a.inferType)(r));var d=i._samplers[v];d&&(y=d(r,t,n))}return{value:y,readOnly:r.readOnly,writeOnly:r.writeOnly,type:v}};var n,i=e("./openapi-sampler"),o=e("./allOf"),a=e("./infer"),u=(n=e("json-pointer"))&&n.__esModule?n:{default:n};function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var f={}},{"./allOf":3,"./infer":4,"./openapi-sampler":5,"json-pointer":2}],13:[function(e,r,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return e<10?"0"+e:e}Object.defineProperty(t,"__esModule",{value:!0}),t.toRFCDateTime=function(e,r,t){var n=e.getUTCFullYear()+"-"+i(e.getUTCMonth()+1)+"-"+i(e.getUTCDate());r||(n+="T"+i(e.getUTCHours())+":"+i(e.getUTCMinutes())+":"+i(e.getUTCSeconds())+(t?"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z");return n},t.ensureMinLength=function(e,r){if(r>e.length)return e.repeat(Math.trunc(r/e.length)+1).substring(0,r);return e},t.mergeDeep=function e(){var r=function(e){return e&&"object"===n(e)};for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return i.reduce(function(t,n){return Object.keys(n).forEach(function(i){var o=t[i],a=n[i];r(o)&&r(a)?t[i]=e(o,a):t[i]=a}),t},Array.isArray(i[i.length-1])?[]:{})}},{}]},{},[5])(5)});
|
|
1373
|
+
|
|
1374
|
+
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1375
|
+
},{}],156:[function(require,module,exports){
|
|
1376
|
+
module.exports=require("through");
|
|
1377
|
+
|
|
1378
|
+
},{"through":183}],157:[function(require,module,exports){
|
|
1379
|
+
(function (process){
|
|
1380
|
+
"use strict";function nextTick(e,n,c,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,t,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,n)});case 3:return process.nextTick(function(){e.call(null,n,c)});case 4:return process.nextTick(function(){e.call(null,n,c,r)});default:for(s=new Array(o-1),t=0;t<s.length;)s[t++]=arguments[t];return process.nextTick(function(){e.apply(null,s)})}}"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?module.exports={nextTick:nextTick}:module.exports=process;
|
|
1381
|
+
|
|
1382
|
+
}).call(this,require('_process'))
|
|
1383
|
+
},{"_process":158}],158:[function(require,module,exports){
|
|
1384
|
+
var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
|
|
1385
|
+
|
|
1386
|
+
},{}],159:[function(require,module,exports){
|
|
1387
|
+
"use strict";function hasOwnProperty(r,e){return Object.prototype.hasOwnProperty.call(r,e)}module.exports=function(r,e,t,n){e=e||"&",t=t||"=";var o={};if("string"!=typeof r||0===r.length)return o;var a=/\+/g;r=r.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var p=r.length;s>0&&p>s&&(p=s);for(var y=0;y<p;++y){var u,c,i,l,f=r[y].replace(a,"%20"),v=f.indexOf(t);v>=0?(u=f.substr(0,v),c=f.substr(v+1)):(u=f,c=""),i=decodeURIComponent(u),l=decodeURIComponent(c),hasOwnProperty(o,i)?isArray(o[i])?o[i].push(l):o[i]=[o[i],l]:o[i]=l}return o};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};
|
|
1388
|
+
|
|
1389
|
+
},{}],160:[function(require,module,exports){
|
|
1390
|
+
"use strict";var stringifyPrimitive=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}};module.exports=function(r,e,t,n){return e=e||"&",t=t||"=",null===r&&(r=void 0),"object"==typeof r?map(objectKeys(r),function(n){var i=encodeURIComponent(stringifyPrimitive(n))+t;return isArray(r[n])?map(r[n],function(r){return i+encodeURIComponent(stringifyPrimitive(r))}).join(e):i+encodeURIComponent(stringifyPrimitive(r[n]))}).join(e):n?encodeURIComponent(stringifyPrimitive(n))+t+encodeURIComponent(stringifyPrimitive(r)):""};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};function map(r,e){if(r.map)return r.map(e);for(var t=[],n=0;n<r.length;n++)t.push(e(r[n],n));return t}var objectKeys=Object.keys||function(r){var e=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.push(t);return e};
|
|
1391
|
+
|
|
1392
|
+
},{}],161:[function(require,module,exports){
|
|
1393
|
+
"use strict";exports.decode=exports.parse=require("./decode"),exports.encode=exports.stringify=require("./encode");
|
|
1394
|
+
|
|
1395
|
+
},{"./decode":159,"./encode":160}],162:[function(require,module,exports){
|
|
1396
|
+
module.exports=require("./lib/_stream_duplex.js");
|
|
1397
|
+
|
|
1398
|
+
},{"./lib/_stream_duplex.js":163}],163:[function(require,module,exports){
|
|
1399
|
+
"use strict";var pna=require("process-nextick-args"),objectKeys=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};module.exports=Duplex;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Duplex.prototype._destroy=function(e,t){this.push(null),this.end(),pna.nextTick(t,e)};
|
|
1400
|
+
|
|
1401
|
+
},{"./_stream_readable":165,"./_stream_writable":167,"core-util-is":49,"inherits":147,"process-nextick-args":157}],164:[function(require,module,exports){
|
|
1402
|
+
"use strict";module.exports=PassThrough;var Transform=require("./_stream_transform"),util=Object.create(require("core-util-is"));function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);Transform.call(this,r)}util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,t){t(null,r)};
|
|
1403
|
+
|
|
1404
|
+
},{"./_stream_transform":166,"core-util-is":49,"inherits":147}],165:[function(require,module,exports){
|
|
1405
|
+
(function (process,global){
|
|
1406
|
+
"use strict";var pna=require("process-nextick-args");module.exports=Readable;var Duplex,isArray=require("isarray");Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(e,t){return e.listeners(t).length},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var debugUtil=require("util"),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=require("./internal/streams/BufferList"),destroyImpl=require("./internal/streams/destroy");util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function ReadableState(e,t){e=e||{};var r=t instanceof(Duplex=Duplex||require("./_stream_duplex"));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,a=e.readableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(a||0===a)?a:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),Stream.call(this)}function readableAddChunk(e,t,r,n,a){var i,d=e._readableState;null===t?(d.reading=!1,onEofChunk(e,d)):(a||(i=chunkInvalid(d,t)),i?e.emit("error",i):d.objectMode||t&&t.length>0?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===Buffer.prototype||(t=_uint8ArrayToBuffer(t)),n?d.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):addChunk(e,d,t,!0):d.ended?e.emit("error",new Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!r?(t=d.decoder.write(t),d.objectMode||0!==t.length?addChunk(e,d,t,!1):maybeReadMore(e,d)):addChunk(e,d,t,!1))):n||(d.reading=!1));return needMoreData(d)}function addChunk(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&emitReadable(e)),maybeReadMore(e,t)}function chunkInvalid(e,t){var r;return _isUint8Array(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(e,t){this.push(null),t(e)},Readable.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=Buffer.from(e,t),t=""),r=!0),readableAddChunk(this,e,t,!1,r)},Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(e){return StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?pna.nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,pna.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&EElistenerCount(e,"data")&&(t.flowing=!0,flow(e))}}function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,pna.nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=fromListPartial(e,t.buffer,t.decoder),r);var r}function fromListPartial(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?copyFromBufferString(e,t):copyFromBuffer(e,t),n}function copyFromBufferString(e,t){var r=t.head,n=1,a=r.data;for(e-=a.length;r=r.next;){var i=r.data,d=e>i.length?i.length:e;if(d===i.length?a+=i:a+=i.slice(0,e),0===(e-=d)){d===i.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(d));break}++n}return t.length-=n,a}function copyFromBuffer(e,t){var r=Buffer.allocUnsafe(e),n=t.head,a=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var i=n.data,d=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,d),0===(e-=d)){d===i.length?(++a,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(d));break}++a}return t.length-=a,r}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,pna.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function indexOf(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var n,a=t.needReadable;return debug("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&debug("length less than watermark",a=!0),t.ended||t.reading?debug("reading or ended",a=!1):a&&(debug("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(r,t))),null===(n=e>0?fromList(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&endReadable(this)),null!==n&&this.emit("data",n),n},Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,debug("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?d:b;function i(t,a){debug("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,debug("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",o),e.removeListener("error",h),e.removeListener("unpipe",i),r.removeListener("end",d),r.removeListener("end",b),r.removeListener("data",s),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||o())}function d(){debug("onend"),e.end()}n.endEmitted?pna.nextTick(a):r.once("end",a),e.on("unpipe",i);var o=pipeOnDrain(r);e.on("drain",o);var u=!1;var l=!1;function s(t){debug("ondata"),l=!1,!1!==e.write(t)||l||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==indexOf(n.pipes,e))&&!u&&(debug("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function h(t){debug("onerror",t),b(),e.removeListener("error",h),0===EElistenerCount(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",p),b()}function p(){debug("onfinish"),e.removeListener("close",f),b()}function b(){debug("unpipe"),r.unpipe(e)}return r.on("data",s),prependListener(e,"error",h),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(debug("pipe resume"),r.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)n[i].emit("unpipe",this,r);return this}var d=indexOf(t.pipes,e);return-1===d?this:(t.pipes.splice(d,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},Readable.prototype.on=function(e,t){var r=Stream.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return r},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",function(){if(debug("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){(debug("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<kProxyEvents.length;i++)e.on(kProxyEvents[i],this.emit.bind(this,kProxyEvents[i]));return this._read=function(t){debug("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList;
|
|
1407
|
+
|
|
1408
|
+
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1409
|
+
},{"./_stream_duplex":163,"./internal/streams/BufferList":168,"./internal/streams/destroy":169,"./internal/streams/stream":170,"_process":158,"core-util-is":49,"events":54,"inherits":147,"isarray":151,"process-nextick-args":157,"safe-buffer":171,"string_decoder/":172,"util":46}],166:[function(require,module,exports){
|
|
1410
|
+
"use strict";module.exports=Transform;var Duplex=require("./_stream_duplex"),util=Object.create(require("core-util-is"));function afterTransform(r,t){var e=this._transformState;e.transforming=!1;var n=e.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));e.writechunk=null,e.writecb=null,null!=t&&this.push(t),n(r);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Transform(r){if(!(this instanceof Transform))return new Transform(r);Duplex.call(this,r),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&("function"==typeof r.transform&&(this._transform=r.transform),"function"==typeof r.flush&&(this._flush=r.flush)),this.on("prefinish",prefinish)}function prefinish(){var r=this;"function"==typeof this._flush?this._flush(function(t,e){done(r,t,e)}):done(this,null,null)}function done(r,t,e){if(t)return r.emit("error",t);if(null!=e&&r.push(e),r._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(r._transformState.transforming)throw new Error("Calling transform done when still transforming");return r.push(null)}util.inherits=require("inherits"),util.inherits(Transform,Duplex),Transform.prototype.push=function(r,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,r,t)},Transform.prototype._transform=function(r,t,e){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(r,t,e){var n=this._transformState;if(n.writecb=e,n.writechunk=r,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(r){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Transform.prototype._destroy=function(r,t){var e=this;Duplex.prototype._destroy.call(this,r,function(r){t(r),e.emit("close")})};
|
|
1411
|
+
|
|
1412
|
+
},{"./_stream_duplex":163,"core-util-is":49,"inherits":147}],167:[function(require,module,exports){
|
|
1413
|
+
(function (process,global,setImmediate){
|
|
1414
|
+
"use strict";var pna=require("process-nextick-args");function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(t,e)}}module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var realHasInstance,destroyImpl=require("./internal/streams/destroy");function nop(){}function WritableState(e,t){Duplex=Duplex||require("./_stream_duplex"),e=e||{};var r=t instanceof Duplex;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(n||0===n)?n:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),Stream.call(this)}function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r),pna.nextTick(t,r)}function validChunk(e,t,r,i){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),pna.nextTick(i,o),n=!1),n}function decodeChunk(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r)),t}function writeOrBuffer(e,t,r,i,n,o){if(!r){var a=decodeChunk(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,s,i,n,o);return f}function doWrite(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function onwriteError(e,t,r,i,n){--t.pendingcb,r?(pna.nextTick(n,i),pna.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),finishMaybe(e,t))}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,i,t,n);else{var o=needFinish(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),i?asyncWrite(afterWrite,e,r,o,n):afterWrite(e,r,o,n)}}function afterWrite(e,t,r,i){r||onwriteDrain(e,t),t.pendingcb--,i(),finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,doWrite(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,u=r.encoding,l=r.callback;if(doWrite(e,t,!1,t.objectMode?1:f.length,f,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),finishMaybe(e,t)})}function prefinish(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,pna.nextTick(callFinal,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function finishMaybe(e,t){var r=needFinish(t);return r&&(prefinish(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?pna.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function onCorkedFinish(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(e){return!!realHasInstance.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):realHasInstance=function(e){return e instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&_isUint8Array(e);return o&&!Buffer.isBuffer(e)&&(e=_uint8ArrayToBuffer(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=nop),i.ended?writeAfterEnd(this,r):(o||validChunk(this,i,e,r))&&(i.pendingcb++,n=writeOrBuffer(this,i,o,e,t,r)),n},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||endWritable(this,i,r)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(e,t){this.end(),t(e)};
|
|
1415
|
+
|
|
1416
|
+
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
|
|
1417
|
+
},{"./_stream_duplex":163,"./internal/streams/destroy":169,"./internal/streams/stream":170,"_process":158,"core-util-is":49,"inherits":147,"process-nextick-args":157,"safe-buffer":171,"timers":184,"util-deprecate":188}],168:[function(require,module,exports){
|
|
1418
|
+
"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Buffer=require("safe-buffer").Buffer,util=require("util");function copyBuffer(t,e,i){t.copy(e,i)}module.exports=function(){function t(){_classCallCheck(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},t.prototype.concat=function(t){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var e=Buffer.allocUnsafe(t>>>0),i=this.head,n=0;i;)copyBuffer(i.data,e,n),n+=i.data.length,i=i.next;return e},t}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var t=util.inspect({length:this.length});return this.constructor.name+" "+t});
|
|
1419
|
+
|
|
1420
|
+
},{"safe-buffer":171,"util":46}],169:[function(require,module,exports){
|
|
1421
|
+
"use strict";var pna=require("process-nextick-args");function destroy(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return a||i?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(pna.nextTick(emitErrorNT,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(t,e){t.emit("error",e)}module.exports={destroy:destroy,undestroy:undestroy};
|
|
1422
|
+
|
|
1423
|
+
},{"process-nextick-args":157}],170:[function(require,module,exports){
|
|
1424
|
+
module.exports=require("events").EventEmitter;
|
|
1425
|
+
|
|
1426
|
+
},{"events":54}],171:[function(require,module,exports){
|
|
1427
|
+
var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,r){for(var e in f)r[e]=f[e]}function SafeBuffer(f,r,e){return Buffer(f,r,e)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,r,e){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,r,e)},SafeBuffer.alloc=function(f,r,e){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==r?"string"==typeof e?u.fill(r,e):u.fill(r):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)};
|
|
1428
|
+
|
|
1429
|
+
},{"buffer":48}],172:[function(require,module,exports){
|
|
1430
|
+
"use strict";var Buffer=require("safe-buffer").Buffer,isEncoding=Buffer.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function normalizeEncoding(t){var e=_normalizeEncoding(t);if("string"!=typeof e&&(Buffer.isEncoding===isEncoding||!isEncoding(t)))throw new Error("Unknown encoding: "+t);return e||t}function StringDecoder(t){var e;switch(this.encoding=normalizeEncoding(t),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,e=4;break;case"utf8":this.fillLast=utf8FillLast,e=4;break;case"base64":this.text=base64Text,this.end=base64End,e=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(e)}function utf8CheckByte(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function utf8CheckIncomplete(t,e,s){var i=e.length-1;if(i<s)return 0;var n=utf8CheckByte(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<s||-2===n?0:(n=utf8CheckByte(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<s||-2===n?0:(n=utf8CheckByte(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}function utf8CheckExtraBytes(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}function utf8FillLast(t){var e=this.lastTotal-this.lastNeed,s=utf8CheckExtraBytes(this,t,e);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function utf8Text(t,e){var s=utf8CheckIncomplete(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=s;var i=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function utf8End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function utf16Text(t,e){if((t.length-e)%2==0){var s=t.toString("utf16le",e);if(s){var i=s.charCodeAt(s.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function utf16End(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,s)}return e}function base64Text(t,e){var s=(t.length-e)%3;return 0===s?t.toString("base64",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-s))}function base64End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(t){if(0===t.length)return"";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<t.length?e?e+this.text(t,s):this.text(t,s):e||""},StringDecoder.prototype.end=utf8End,StringDecoder.prototype.text=utf8Text,StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};
|
|
1431
|
+
|
|
1432
|
+
},{"safe-buffer":171}],173:[function(require,module,exports){
|
|
1433
|
+
module.exports=require("./readable").PassThrough;
|
|
1434
|
+
|
|
1435
|
+
},{"./readable":174}],174:[function(require,module,exports){
|
|
1436
|
+
exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js");
|
|
1437
|
+
|
|
1438
|
+
},{"./lib/_stream_duplex.js":163,"./lib/_stream_passthrough.js":164,"./lib/_stream_readable.js":165,"./lib/_stream_transform.js":166,"./lib/_stream_writable.js":167}],175:[function(require,module,exports){
|
|
1439
|
+
module.exports=require("./readable").Transform;
|
|
1440
|
+
|
|
1441
|
+
},{"./readable":174}],176:[function(require,module,exports){
|
|
1442
|
+
module.exports=require("./lib/_stream_writable.js");
|
|
1443
|
+
|
|
1444
|
+
},{"./lib/_stream_writable.js":167}],177:[function(require,module,exports){
|
|
1445
|
+
var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,e){for(var r in f)e[r]=f[r]}function SafeBuffer(f,e,r){return Buffer(f,e,r)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(Buffer.prototype),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,e,r){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,e,r)},SafeBuffer.alloc=function(f,e,r){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==e?"string"==typeof r?u.fill(e,r):u.fill(e):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)};
|
|
1446
|
+
|
|
1447
|
+
},{"buffer":48}],178:[function(require,module,exports){
|
|
1448
|
+
var through=require("through"),Decoder=require("string_decoder").StringDecoder;function split(e,r,t){var n=new Decoder,u="",i=t&&t.maxLength;function o(e,t){if(r){try{t=r(t)}catch(r){return e.emit("error",r)}void 0!==t&&e.queue(t)}else e.queue(t)}function h(r,t){var n=((null!=u?u:"")+t).split(e);u=n.pop(),i&&u.length>i&&r.emit("error",new Error("maximum buffer reached"));for(var h=0;h<n.length;h++){o(r,n[h])}}return"function"==typeof e&&(r=e,e=null),e||(e=/\r?\n/),through(function(e){h(this,n.write(e))},function(){n.end&&h(this,n.end()),null!=u&&o(this,u),this.queue(null)})}module.exports=split;
|
|
1449
|
+
|
|
1450
|
+
},{"string_decoder":181,"through":183}],179:[function(require,module,exports){
|
|
1451
|
+
module.exports=Stream;var EE=require("events").EventEmitter,inherits=require("inherits");function Stream(){EE.call(this)}inherits(Stream,EE),Stream.Readable=require("readable-stream/readable.js"),Stream.Writable=require("readable-stream/writable.js"),Stream.Duplex=require("readable-stream/duplex.js"),Stream.Transform=require("readable-stream/transform.js"),Stream.PassThrough=require("readable-stream/passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(e,r){var t=this;function n(r){e.writable&&!1===e.write(r)&&t.pause&&t.pause()}function a(){t.readable&&t.resume&&t.resume()}t.on("data",n),e.on("drain",a),e._isStdio||r&&!1===r.end||(t.on("end",i),t.on("close",s));var o=!1;function i(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function m(e){if(u(),0===EE.listenerCount(this,"error"))throw e}function u(){t.removeListener("data",n),e.removeListener("drain",a),t.removeListener("end",i),t.removeListener("close",s),t.removeListener("error",m),e.removeListener("error",m),t.removeListener("end",u),t.removeListener("close",u),e.removeListener("close",u)}return t.on("error",m),e.on("error",m),t.on("end",u),t.on("close",u),e.on("close",u),e.emit("pipe",t),e};
|
|
1452
|
+
|
|
1453
|
+
},{"events":54,"inherits":147,"readable-stream/duplex.js":162,"readable-stream/passthrough.js":173,"readable-stream/readable.js":174,"readable-stream/transform.js":175,"readable-stream/writable.js":176}],180:[function(require,module,exports){
|
|
1454
|
+
var duplexer=require("duplexer");module.exports=function(){var e=[].slice.call(arguments),r=e[0],l=e[e.length-1],n=duplexer(r,l);if(1==e.length)return e[0];if(!e.length)throw new Error("connect called with empty args");function t(){var e=[].slice.call(arguments);e.unshift("error"),n.emit.apply(n,e)}!function e(r){r.length<2||(r[0].pipe(r[1]),e(r.slice(1)))}(e);for(var i=1;i<e.length-1;i++)e[i].on("error",t);return n};
|
|
1455
|
+
|
|
1456
|
+
},{"duplexer":52}],181:[function(require,module,exports){
|
|
1457
|
+
"use strict";var Buffer=require("safe-buffer").Buffer,isEncoding=Buffer.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function normalizeEncoding(t){var e=_normalizeEncoding(t);if("string"!=typeof e&&(Buffer.isEncoding===isEncoding||!isEncoding(t)))throw new Error("Unknown encoding: "+t);return e||t}function StringDecoder(t){var e;switch(this.encoding=normalizeEncoding(t),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,e=4;break;case"utf8":this.fillLast=utf8FillLast,e=4;break;case"base64":this.text=base64Text,this.end=base64End,e=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(e)}function utf8CheckByte(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function utf8CheckIncomplete(t,e,s){var i=e.length-1;if(i<s)return 0;var n=utf8CheckByte(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<s||-2===n?0:(n=utf8CheckByte(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<s||-2===n?0:(n=utf8CheckByte(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}function utf8CheckExtraBytes(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}function utf8FillLast(t){var e=this.lastTotal-this.lastNeed,s=utf8CheckExtraBytes(this,t,e);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function utf8Text(t,e){var s=utf8CheckIncomplete(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=s;var i=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function utf8End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function utf16Text(t,e){if((t.length-e)%2==0){var s=t.toString("utf16le",e);if(s){var i=s.charCodeAt(s.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function utf16End(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,s)}return e}function base64Text(t,e){var s=(t.length-e)%3;return 0===s?t.toString("base64",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-s))}function base64End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(t){if(0===t.length)return"";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<t.length?e?e+this.text(t,s):this.text(t,s):e||""},StringDecoder.prototype.end=utf8End,StringDecoder.prototype.text=utf8Text,StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};
|
|
1458
|
+
|
|
1459
|
+
},{"safe-buffer":177}],182:[function(require,module,exports){
|
|
1460
|
+
"use strict";const isRegexp=require("is-regexp"),isObj=require("is-obj"),getOwnEnumPropSymbols=require("get-own-enumerable-property-symbols").default;module.exports=((e,n,r)=>{const t=[];return function e(n,r,i){let p;(r=r||{}).indent=r.indent||"\t",i=i||"",p=void 0===r.inlineCharacterLimit?{newLine:"\n",newLineOrSpace:"\n",pad:i,indent:i+r.indent}:{newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const a=e=>{if(void 0===r.inlineCharacterLimit)return e;const n=e.replace(new RegExp(p.newLine,"g"),"").replace(new RegExp(p.newLineOrSpace,"g")," ").replace(new RegExp(p.pad+"|"+p.indent,"g"),"");return n.length<=r.inlineCharacterLimit?n:e.replace(new RegExp(p.newLine+"|"+p.newLineOrSpace,"g"),"\n").replace(new RegExp(p.pad,"g"),i).replace(new RegExp(p.indent,"g"),i+r.indent)};if(-1!==t.indexOf(n))return'"[Circular]"';if(null==n||"number"==typeof n||"boolean"==typeof n||"function"==typeof n||"symbol"==typeof n||isRegexp(n))return String(n);if(n instanceof Date)return`new Date('${n.toISOString()}')`;if(Array.isArray(n)){if(0===n.length)return"[]";t.push(n);const o="["+p.newLine+n.map((t,a)=>{const o=n.length-1===a?p.newLine:","+p.newLineOrSpace;let l=e(t,r,i+r.indent);return r.transform&&(l=r.transform(n,a,l)),p.indent+l+o}).join("")+p.pad+"]";return t.pop(),a(o)}if(isObj(n)){let o=Object.keys(n).concat(getOwnEnumPropSymbols(n));if(r.filter&&(o=o.filter(e=>r.filter(n,e))),0===o.length)return"{}";t.push(n);const l="{"+p.newLine+o.map((t,a)=>{const l=o.length-1===a?p.newLine:","+p.newLineOrSpace,s="symbol"==typeof t,c=!s&&/^[a-z$_][a-z$_0-9]*$/i.test(t),g=s||c?t:e(t,r);let u=e(n[t],r,i+r.indent);return r.transform&&(u=r.transform(n,t,u)),p.indent+String(g)+": "+u+l}).join("")+p.pad+"}";return t.pop(),a(l)}return n=String(n).replace(/[\r\n]/g,e=>"\n"===e?"\\n":"\\r"),!1===r.singleQuotes?`"${n=n.replace(/"/g,'\\"')}"`:`'${n=n.replace(/\\?'/g,"\\'")}'`}(e,n,r)});
|
|
1461
|
+
|
|
1462
|
+
},{"get-own-enumerable-property-symbols":59,"is-obj":149,"is-regexp":150}],183:[function(require,module,exports){
|
|
1463
|
+
(function (process){
|
|
1464
|
+
var Stream=require("stream");function through(e,t,r){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var u=!1,n=!1,a=[],o=!1,i=new Stream;function s(){for(;a.length&&!i.paused;){var e=a.shift();if(null===e)return i.emit("end");i.emit("data",e)}}return i.readable=i.writable=!0,i.paused=!1,i.autoDestroy=!(r&&!1===r.autoDestroy),i.write=function(t){return e.call(this,t),!i.paused},i.queue=i.push=function(e){return o?i:(null===e&&(o=!0),a.push(e),s(),i)},i.on("end",function(){i.readable=!1,!i.writable&&i.autoDestroy&&process.nextTick(function(){i.destroy()})}),i.end=function(e){if(!u)return u=!0,arguments.length&&i.write(e),i.writable=!1,t.call(i),!i.readable&&i.autoDestroy&&i.destroy(),i},i.destroy=function(){if(!n)return n=!0,u=!0,a.length=0,i.writable=i.readable=!1,i.emit("close"),i},i.pause=function(){if(!i.paused)return i.paused=!0,i},i.resume=function(){return i.paused&&(i.paused=!1,i.emit("resume")),s(),i.paused||i.emit("drain"),i},i}exports=module.exports=through,through.through=through;
|
|
1465
|
+
|
|
1466
|
+
}).call(this,require('_process'))
|
|
1467
|
+
},{"_process":158,"stream":179}],184:[function(require,module,exports){
|
|
1468
|
+
(function (setImmediate,clearImmediate){
|
|
1469
|
+
var nextTick=require("process/browser.js").nextTick,apply=Function.prototype.apply,slice=Array.prototype.slice,immediateIds={},nextImmediateId=0;function Timeout(e,t){this._id=e,this._clearFn=t}exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(e){e.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},exports.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},exports._unrefActive=exports.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},exports.setImmediate="function"==typeof setImmediate?setImmediate:function(e){var t=nextImmediateId++,i=!(arguments.length<2)&&slice.call(arguments,1);return immediateIds[t]=!0,nextTick(function(){immediateIds[t]&&(i?e.apply(null,i):e.call(null),exports.clearImmediate(t))}),t},exports.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(e){delete immediateIds[e]};
|
|
1470
|
+
|
|
1471
|
+
}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
1472
|
+
},{"process/browser.js":158,"timers":184}],185:[function(require,module,exports){
|
|
1473
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length>1){r[0]=r[0].slice(0,-1);for(var n=r.length-1,o=1;o<n;++o)r[o]=r[o].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}return r[0]}function t(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){var n=r("[0-9]","[A-Fa-f]"),o=t(t("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+t("%[89A-Fa-f]"+n+"%"+n+n)+"|"+t("%"+n+n)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=r("[\\:\\/\\?\\#\\[\\]\\@]",a),s=e?"[\\uE000-\\uF8FF]":"[]",u=r("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=t("[A-Za-z]"+r("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),p=t(t(o+"|"+r(u,a,"[\\:]"))+"*"),h=(t(t("25[0-5]")+"|"+t("2[0-4][0-9]")+"|"+t("1[0-9][0-9]")+"|"+t("[1-9][0-9]")+"|[0-9]"),t(t("25[0-5]")+"|"+t("2[0-4][0-9]")+"|"+t("1[0-9][0-9]")+"|"+t("0?[1-9][0-9]")+"|0?0?[0-9]")),f=t(h+"\\."+h+"\\."+h+"\\."+h),l=t(n+"{1,4}"),v=t(t(l+"\\:"+l)+"|"+f),d=t(t(l+"\\:")+"{6}"+v),g=t("\\:\\:"+t(l+"\\:")+"{5}"+v),m=t(t(l)+"?\\:\\:"+t(l+"\\:")+"{4}"+v),E=t(t(t(l+"\\:")+"{0,1}"+l)+"?\\:\\:"+t(l+"\\:")+"{3}"+v),C=t(t(t(l+"\\:")+"{0,2}"+l)+"?\\:\\:"+t(l+"\\:")+"{2}"+v),y=t(t(t(l+"\\:")+"{0,3}"+l)+"?\\:\\:"+l+"\\:"+v),S=t(t(t(l+"\\:")+"{0,4}"+l)+"?\\:\\:"+v),A=t(t(t(l+"\\:")+"{0,5}"+l)+"?\\:\\:"+l),D=t(t(t(l+"\\:")+"{0,6}"+l)+"?\\:\\:"),w=t([d,g,m,E,C,y,S,A,D].join("|")),b=t(t(u+"|"+o)+"+"),x=(t(w+"\\%25"+b),t(w+t("\\%25|\\%(?!"+n+"{2})")+b)),O=t("[vV]"+n+"+\\."+r(u,a,"[\\:]")+"+"),I=t("\\["+t(x+"|"+w+"|"+O)+"\\]"),F=t(t(o+"|"+r(u,a))+"*"),N=t(I+"|"+f+"(?!"+F+")|"+F),R=t("[0-9]*"),T=t(t(p+"@")+"?"+N+t("\\:"+R)+"?"),_=t(o+"|"+r(u,a,"[\\:\\@]")),P=t(_+"*"),U=t(_+"+"),j=t(t(o+"|"+r(u,a,"[\\@]"))+"+"),q=t(t("\\/"+P)+"*"),H=t("\\/"+t(U+q)+"?"),z=t(j+q),L=t(U+q),$="(?!"+_+")",V=(t(q+"|"+H+"|"+z+"|"+L+"|"+$),t(t(_+"|"+r("[\\/\\?]",s))+"*")),M=t(t(_+"|[\\/\\?]")+"*"),Z=t(t("\\/\\/"+T+q)+"|"+H+"|"+L+"|"+$),k=t(c+"\\:"+Z+t("\\?"+V)+"?"+t("\\#"+M)+"?"),G=t(t("\\/\\/"+T+q)+"|"+H+"|"+z+"|"+$),Q=t(G+t("\\?"+V)+"?"+t("\\#"+M)+"?");t(k+"|"+Q),t(c+"\\:"+Z+t("\\?"+V)+"?"),t(t("\\/\\/("+t("("+p+")@")+"?("+N+")"+t("\\:("+R+")")+"?)")+"?("+q+"|"+H+"|"+L+"|"+$+")"),t("\\?("+V+")"),t("\\#("+M+")"),t(t("\\/\\/("+t("("+p+")@")+"?("+N+")"+t("\\:("+R+")")+"?)")+"?("+q+"|"+H+"|"+z+"|"+$+")"),t("\\?("+V+")"),t("\\#("+M+")"),t(t("\\/\\/("+t("("+p+")@")+"?("+N+")"+t("\\:("+R+")")+"?)")+"?("+q+"|"+H+"|"+L+"|"+$+")"),t("\\?("+V+")"),t("\\#("+M+")"),t("("+p+")@"),t("\\:("+R+")");return{NOT_SCHEME:new RegExp(r("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",u,a),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",u,a),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",u,a),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",u,a),"g"),NOT_QUERY:new RegExp(r("[^\\%]",u,a,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",u,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",u,a),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",u,i),"g"),PCT_ENCODED:new RegExp(o,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+w+")"+t(t("\\%25|\\%(?!"+n+"{2})")+"("+b+")")+"?\\]?$")}}var i=a(!1),s=a(!0),u=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=2147483647,p=/^xn--/,h=/[^\0-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=Math.floor,d=String.fromCharCode;function g(e){throw new RangeError(l[e])}function m(e,r){var t=e.split("@"),n="";t.length>1&&(n=t[0]+"@",e=t[1]);var o=function(e,r){for(var t=[],n=e.length;n--;)t[n]=r(e[n]);return t}((e=e.replace(f,".")).split("."),r).join(".");return n+o}function E(e){for(var r=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var a=e.charCodeAt(t++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),t--)}else r.push(o)}return r}var C=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},y=function(e,r,t){var n=0;for(e=t?v(e/700):e>>1,e+=v(e/r);e>455;n+=36)e=v(e/35);return v(n+36*e/(e+38))},S=function(e){var r,t=[],n=e.length,o=0,a=128,i=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var u=0;u<s;++u)e.charCodeAt(u)>=128&&g("not-basic"),t.push(e.charCodeAt(u));for(var p=s>0?s+1:0;p<n;){for(var h=o,f=1,l=36;;l+=36){p>=n&&g("invalid-input");var d=(r=e.charCodeAt(p++))-48<10?r-22:r-65<26?r-65:r-97<26?r-97:36;(d>=36||d>v((c-o)/f))&&g("overflow"),o+=d*f;var m=l<=i?1:l>=i+26?26:l-i;if(d<m)break;var E=36-m;f>v(c/E)&&g("overflow"),f*=E}var C=t.length+1;i=y(o-h,C,0==h),v(o/C)>c-a&&g("overflow"),a+=v(o/C),o%=C,t.splice(o++,0,a)}return String.fromCodePoint.apply(String,t)},A=function(e){var r=[],t=(e=E(e)).length,n=128,o=0,a=72,i=!0,s=!1,u=void 0;try{for(var p,h=e[Symbol.iterator]();!(i=(p=h.next()).done);i=!0){var f=p.value;f<128&&r.push(d(f))}}catch(e){s=!0,u=e}finally{try{!i&&h.return&&h.return()}finally{if(s)throw u}}var l=r.length,m=l;for(l&&r.push("-");m<t;){var S=c,A=!0,D=!1,w=void 0;try{for(var b,x=e[Symbol.iterator]();!(A=(b=x.next()).done);A=!0){var O=b.value;O>=n&&O<S&&(S=O)}}catch(e){D=!0,w=e}finally{try{!A&&x.return&&x.return()}finally{if(D)throw w}}var I=m+1;S-n>v((c-o)/I)&&g("overflow"),o+=(S-n)*I,n=S;var F=!0,N=!1,R=void 0;try{for(var T,_=e[Symbol.iterator]();!(F=(T=_.next()).done);F=!0){var P=T.value;if(P<n&&++o>c&&g("overflow"),P==n){for(var U=o,j=36;;j+=36){var q=j<=a?1:j>=a+26?26:j-a;if(U<q)break;var H=U-q,z=36-q;r.push(d(C(q+H%z,0))),U=v(H/z)}r.push(d(C(U,0))),a=y(o,I,m==l),o=0,++m}}}catch(e){N=!0,R=e}finally{try{!F&&_.return&&_.return()}finally{if(N)throw R}}++o,++n}return r.join("")},D={version:"2.1.0",ucs2:{decode:E,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}(e))}},decode:S,encode:A,toASCII:function(e){return m(e,function(e){return h.test(e)?"xn--"+A(e):e})},toUnicode:function(e){return m(e,function(e){return p.test(e)?S(e.slice(4).toLowerCase()):e})}},w={};function b(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function x(e){for(var r="",t=0,n=e.length;t<n;){var o=parseInt(e.substr(t+1,2),16);if(o<128)r+=String.fromCharCode(o),t+=3;else if(o>=194&&o<224){if(n-t>=6){var a=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(t,6);t+=6}else if(o>=224){if(n-t>=9){var i=parseInt(e.substr(t+4,2),16),s=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&s)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function O(e,r){function t(e){var t=x(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,b).replace(r.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,b).replace(r.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,b).replace(r.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,b).replace(r.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,b).replace(r.PCT_ENCODED,o)),e}function I(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,r){var t=e.match(r.IPV4ADDRESS)||[],n=u(t,2)[1];return n?n.split(".").map(I).join("."):e}function N(e,r){var t=e.match(r.IPV6ADDRESS)||[],n=u(t,3),o=n[1],a=n[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),s=u(i,2),c=s[0],p=s[1],h=p?p.split(":").map(I):[],f=c.split(":").map(I),l=r.IPV4ADDRESS.test(f[f.length-1]),v=l?7:8,d=f.length-v,g=Array(v),m=0;m<v;++m)g[m]=h[m]||f[d+m]||"";l&&(g[v-1]=F(g[v-1],r));var E=g.reduce(function(e,r,t){if(!r||"0"===r){var n=e[e.length-1];n&&n.index+n.length===t?n.length++:e.push({index:t,length:1})}return e},[]).sort(function(e,r){return r.length-e.length})[0],C=void 0;if(E&&E.length>1){var y=g.slice(0,E.index),S=g.slice(E.index+E.length);C=y.join(":")+"::"+S.join(":")}else C=g.join(":");return a&&(C+="%"+a),C}return e}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,T=void 0==="".match(/(){0}/)[1];function _(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={},n=!1!==r.iri?s:i;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(R);if(o){T?(t.scheme=o[1],t.userinfo=o[3],t.host=o[4],t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=o[7],t.fragment=o[8],isNaN(t.port)&&(t.port=o[5])):(t.scheme=o[1]||void 0,t.userinfo=-1!==e.indexOf("@")?o[3]:void 0,t.host=-1!==e.indexOf("//")?o[4]:void 0,t.port=parseInt(o[5],10),t.path=o[6]||"",t.query=-1!==e.indexOf("?")?o[7]:void 0,t.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),t.host&&(t.host=N(F(t.host,n),n)),void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?t.reference="relative":void 0===t.fragment?t.reference="absolute":t.reference="uri":t.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var a=w[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)O(t,n);else{if(t.host&&(r.domainHost||a&&a.domainHost))try{t.host=D.toASCII(t.host.replace(n.PCT_ENCODED,x).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(t,i)}a&&a.parse&&a.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}var P=/^\.\.?\//,U=/^\/\.(\/|$)/,j=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function H(e){for(var r=[];e.length;)if(e.match(P))e=e.replace(P,"");else if(e.match(U))e=e.replace(U,"/");else if(e.match(j))e=e.replace(j,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(q);if(!t)throw new Error("Unexpected dot segment condition");var n=t[0];e=e.slice(n.length),r.push(n)}return r.join("")}function z(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.iri?s:i,n=[],o=w[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(t.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?D.toUnicode(e.host):D.toASCII(e.host.replace(t.PCT_ENCODED,x).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+t}O(e,t),"suffix"!==r.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var a=function(e,r){var t=!1!==r.iri?s:i,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(N(F(String(e.host),t),t).replace(t.IPV6ADDRESS,function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})),"number"==typeof e.port&&(n.push(":"),n.push(e.port.toString(10))),n.length?n.join(""):void 0}(e,r);if(void 0!==a&&("suffix"!==r.reference&&n.push("//"),n.push(a),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var u=e.path;r.absolutePath||o&&o.absolutePath||(u=H(u)),void 0===a&&(u=u.replace(/^\/\//,"/%2F")),n.push(u)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function L(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=_(z(e,t),t),r=_(z(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(n.scheme=r.scheme,n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=H(r.path||""),n.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(n.userinfo=r.userinfo,n.host=r.host,n.port=r.port,n.path=H(r.path||""),n.query=r.query):(r.path?("/"===r.path.charAt(0)?n.path=H(r.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:n.path=r.path:n.path="/"+r.path,n.path=H(n.path)),n.query=r.query):(n.path=e.path,void 0!==r.query?n.query=r.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=r.fragment,n}function $(e,r){return e&&e.toString().replace(r&&r.iri?s.PCT_ENCODED:i.PCT_ENCODED,x)}var V={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},M={scheme:"https",domainHost:V.domainHost,parse:V.parse,serialize:V.serialize},Z={},k="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",G="[0-9A-Fa-f]",Q=t(t("%[EFef][0-9A-Fa-f]%"+G+G+"%"+G+G)+"|"+t("%[89A-Fa-f][0-9A-Fa-f]%"+G+G)+"|"+t("%"+G+G)),Y=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),B=new RegExp(k,"g"),J=new RegExp(Q,"g"),K=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Y),"g"),W=new RegExp(r("[^]",k,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),X=W;function ee(e){var r=x(e);return r.match(B)?r:e}var re={scheme:"mailto",parse:function(e,r){var t=e,n=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var o=!1,a={},i=t.query.split("&"),s=0,u=i.length;s<u;++s){var c=i[s].split("=");switch(c[0]){case"to":for(var p=c[1].split(","),h=0,f=p.length;h<f;++h)n.push(p[h]);break;case"subject":t.subject=$(c[1],r);break;case"body":t.body=$(c[1],r);break;default:o=!0,a[$(c[0],r)]=$(c[1],r)}}o&&(t.headers=a)}t.query=void 0;for(var l=0,v=n.length;l<v;++l){var d=n[l].split("@");if(d[0]=$(d[0]),r.unicodeSupport)d[1]=$(d[1],r).toLowerCase();else try{d[1]=D.toASCII($(d[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[l]=d.join("@")}return t},serialize:function(e,r){var t,n=e,a=null!=(t=e.to)?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[];if(a){for(var i=0,s=a.length;i<s;++i){var u=String(a[i]),c=u.lastIndexOf("@"),p=u.slice(0,c).replace(J,ee).replace(J,o).replace(K,b),h=u.slice(c+1);try{h=r.iri?D.toUnicode(h):D.toASCII($(h,r).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}a[i]=p+"@"+h}n.path=a.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var l=[];for(var v in f)f[v]!==Z[v]&&l.push(v.replace(J,ee).replace(J,o).replace(W,b)+"="+f[v].replace(J,ee).replace(J,o).replace(X,b));return l.length&&(n.query=l.join("&")),n}},te=/^([^\:]+)\:(.*)/,ne={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(te),n=e;if(t){var o=r.scheme||n.scheme||"urn",a=t[1].toLowerCase(),i=t[2],s=o+":"+(r.nid||a),u=w[s];n.nid=a,n.nss=i,n.path=void 0,u&&(n=u.parse(n,r))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,r){var t=r.scheme||e.scheme||"urn",n=e.nid,o=t+":"+(r.nid||n),a=w[o];a&&(e=a.serialize(e,r));var i=e,s=e.nss;return i.path=(n||r.nid)+":"+s,i}},oe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ae={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(oe)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};w[V.scheme]=V,w[M.scheme]=M,w[re.scheme]=re,w[ne.scheme]=ne,w[ae.scheme]=ae,e.SCHEMES=w,e.pctEncChar=b,e.pctDecChars=x,e.parse=_,e.removeDotSegments=H,e.serialize=z,e.resolveComponents=L,e.resolve=function(e,r,t){var n=function(e,r){var t=e;if(r)for(var n in r)t[n]=r[n];return t}({scheme:"null"},t);return z(L(_(e,n),_(r,n),n,!0),n)},e.normalize=function(e,r){return"string"==typeof e?e=z(_(e,r),r):"object"===n(e)&&(e=_(z(e,r),r)),e},e.equal=function(e,r,t){return"string"==typeof e?e=z(_(e,t),t):"object"===n(e)&&(e=z(e,t)),"string"==typeof r?r=z(_(r,t),t):"object"===n(r)&&(r=z(r,t)),e===r},e.escapeComponent=function(e,r){return e&&e.toString().replace(r&&r.iri?s.ESCAPE:i.ESCAPE,b)},e.unescapeComponent=$,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1474
|
+
|
|
1475
|
+
},{}],186:[function(require,module,exports){
|
|
1476
|
+
"use strict";var punycode=require("punycode"),util=require("./util");function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=require("querystring");function urlParse(t,s,e){if(t&&util.isObject(t)&&t instanceof Url)return t;var h=new Url;return h.parse(t,s,e),h}function urlFormat(t){return util.isString(t)&&(t=urlParse(t)),t instanceof Url?t.format():Url.prototype.format.call(t)}function urlResolve(t,s){return urlParse(t,!1,!0).resolve(s)}function urlResolveObject(t,s){return t?urlParse(t,!1,!0).resolveObject(s):s}Url.prototype.parse=function(t,s,e){if(!util.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var h=t.indexOf("?"),r=-1!==h&&h<t.indexOf("#")?"?":"#",a=t.split(r);a[0]=a[0].replace(/\\/g,"/");var o=t=a.join(r);if(o=o.trim(),!e&&1===t.split("#").length){var n=simplePathPattern.exec(o);if(n)return this.path=o,this.href=o,this.pathname=n[1],n[2]?(this.search=n[2],this.query=s?querystring.parse(this.search.substr(1)):this.search.substr(1)):s&&(this.search="",this.query={}),this}var i=protocolPattern.exec(o);if(i){var l=(i=i[0]).toLowerCase();this.protocol=l,o=o.substr(i.length)}if(e||i||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var u="//"===o.substr(0,2);!u||i&&hostlessProtocol[i]||(o=o.substr(2),this.slashes=!0)}if(!hostlessProtocol[i]&&(u||i&&!slashedProtocol[i])){for(var p,c,f=-1,m=0;m<hostEndingChars.length;m++){-1!==(v=o.indexOf(hostEndingChars[m]))&&(-1===f||v<f)&&(f=v)}-1!==(c=-1===f?o.lastIndexOf("@"):o.lastIndexOf("@",f))&&(p=o.slice(0,c),o=o.slice(c+1),this.auth=decodeURIComponent(p)),f=-1;for(m=0;m<nonHostChars.length;m++){var v;-1!==(v=o.indexOf(nonHostChars[m]))&&(-1===f||v<f)&&(f=v)}-1===f&&(f=o.length),this.host=o.slice(0,f),o=o.slice(f),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var y=this.hostname.split(/\./),P=(m=0,y.length);m<P;m++){var d=y[m];if(d&&!d.match(hostnamePartPattern)){for(var b="",q=0,O=d.length;q<O;q++)d.charCodeAt(q)>127?b+="x":b+=d[q];if(!b.match(hostnamePartPattern)){var j=y.slice(0,m),x=y.slice(m+1),U=d.match(hostnamePartStart);U&&(j.push(U[1]),x.unshift(U[2])),x.length&&(o="/"+x.join(".")+o),this.hostname=j.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=punycode.toASCII(this.hostname));var C=this.port?":"+this.port:"",A=this.hostname||"";this.host=A+C,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!unsafeProtocol[l])for(m=0,P=autoEscape.length;m<P;m++){var w=autoEscape[m];if(-1!==o.indexOf(w)){var E=encodeURIComponent(w);E===w&&(E=escape(w)),o=o.split(w).join(E)}}var I=o.indexOf("#");-1!==I&&(this.hash=o.substr(I),o=o.slice(0,I));var R=o.indexOf("?");if(-1!==R?(this.search=o.substr(R),this.query=o.substr(R+1),s&&(this.query=querystring.parse(this.query)),o=o.slice(0,R)):s&&(this.search="",this.query={}),o&&(this.pathname=o),slashedProtocol[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){C=this.pathname||"";var S=this.search||"";this.path=C+S}return this.href=this.format(),this},Url.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var s=this.protocol||"",e=this.pathname||"",h=this.hash||"",r=!1,a="";this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&util.isObject(this.query)&&Object.keys(this.query).length&&(a=querystring.stringify(this.query));var o=this.search||a&&"?"+a||"";return s&&":"!==s.substr(-1)&&(s+=":"),this.slashes||(!s||slashedProtocol[s])&&!1!==r?(r="//"+(r||""),e&&"/"!==e.charAt(0)&&(e="/"+e)):r||(r=""),h&&"#"!==h.charAt(0)&&(h="#"+h),o&&"?"!==o.charAt(0)&&(o="?"+o),s+r+(e=e.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(o=o.replace("#","%23"))+h},Url.prototype.resolve=function(t){return this.resolveObject(urlParse(t,!1,!0)).format()},Url.prototype.resolveObject=function(t){if(util.isString(t)){var s=new Url;s.parse(t,!1,!0),t=s}for(var e=new Url,h=Object.keys(this),r=0;r<h.length;r++){var a=h[r];e[a]=this[a]}if(e.hash=t.hash,""===t.href)return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(var o=Object.keys(t),n=0;n<o.length;n++){var i=o[n];"protocol"!==i&&(e[i]=t[i])}return slashedProtocol[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}if(t.protocol&&t.protocol!==e.protocol){if(!slashedProtocol[t.protocol]){for(var l=Object.keys(t),u=0;u<l.length;u++){var p=l[u];e[p]=t[p]}return e.href=e.format(),e}if(e.protocol=t.protocol,t.host||hostlessProtocol[t.protocol])e.pathname=t.pathname;else{for(var c=(t.pathname||"").split("/");c.length&&!(t.host=c.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==c[0]&&c.unshift(""),c.length<2&&c.unshift(""),e.pathname=c.join("/")}if(e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,e.pathname||e.search){var f=e.pathname||"",m=e.search||"";e.path=f+m}return e.slashes=e.slashes||t.slashes,e.href=e.format(),e}var v=e.pathname&&"/"===e.pathname.charAt(0),g=t.host||t.pathname&&"/"===t.pathname.charAt(0),y=g||v||e.host&&t.pathname,P=y,d=e.pathname&&e.pathname.split("/")||[],b=(c=t.pathname&&t.pathname.split("/")||[],e.protocol&&!slashedProtocol[e.protocol]);if(b&&(e.hostname="",e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===c[0]?c[0]=t.host:c.unshift(t.host)),t.host=null),y=y&&(""===c[0]||""===d[0])),g)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,d=c;else if(c.length)d||(d=[]),d.pop(),d=d.concat(c),e.search=t.search,e.query=t.query;else if(!util.isNullOrUndefined(t.search)){if(b)e.hostname=e.host=d.shift(),(U=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=U.shift(),e.host=e.hostname=U.shift());return e.search=t.search,e.query=t.query,util.isNull(e.pathname)&&util.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!d.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var q=d.slice(-1)[0],O=(e.host||t.host||d.length>1)&&("."===q||".."===q)||""===q,j=0,x=d.length;x>=0;x--)"."===(q=d[x])?d.splice(x,1):".."===q?(d.splice(x,1),j++):j&&(d.splice(x,1),j--);if(!y&&!P)for(;j--;j)d.unshift("..");!y||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),O&&"/"!==d.join("/").substr(-1)&&d.push("");var U,C=""===d[0]||d[0]&&"/"===d[0].charAt(0);b&&(e.hostname=e.host=C?"":d.length?d.shift():"",(U=!!(e.host&&e.host.indexOf("@")>0)&&e.host.split("@"))&&(e.auth=U.shift(),e.host=e.hostname=U.shift()));return(y=y||e.host&&d.length)&&!C&&d.unshift(""),d.length?e.pathname=d.join("/"):(e.pathname=null,e.path=null),util.isNull(e.pathname)&&util.isNull(e.search)||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Url.prototype.parseHost=function(){var t=this.host,s=portPattern.exec(t);s&&(":"!==(s=s[0])&&(this.port=s.substr(1)),t=t.substr(0,t.length-s.length)),t&&(this.hostname=t)};
|
|
1477
|
+
|
|
1478
|
+
},{"./util":187,"punycode":47,"querystring":161}],187:[function(require,module,exports){
|
|
1479
|
+
"use strict";module.exports={isString:function(n){return"string"==typeof n},isObject:function(n){return"object"==typeof n&&null!==n},isNull:function(n){return null===n},isNullOrUndefined:function(n){return null==n}};
|
|
1480
|
+
|
|
1481
|
+
},{}],188:[function(require,module,exports){
|
|
1482
|
+
(function (global){
|
|
1483
|
+
function deprecate(r,e){if(config("noDeprecation"))return r;var o=!1;return function(){if(!o){if(config("throwDeprecation"))throw new Error(e);config("traceDeprecation")?console.trace(e):console.warn(e),o=!0}return r.apply(this,arguments)}}function config(r){try{if(!global.localStorage)return!1}catch(r){return!1}var e=global.localStorage[r];return null!=e&&"true"===String(e).toLowerCase()}module.exports=deprecate;
|
|
1484
|
+
|
|
1485
|
+
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1486
|
+
},{}],189:[function(require,module,exports){
|
|
1487
|
+
"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
|
|
1488
|
+
|
|
1489
|
+
},{}],190:[function(require,module,exports){
|
|
1490
|
+
module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
|
|
1491
|
+
|
|
1492
|
+
},{}],191:[function(require,module,exports){
|
|
1493
|
+
(function (process,global){
|
|
1494
|
+
var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},exports.deprecate=function(e,r){if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var t=!1;return function(){if(!t){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}};var debugEnviron,debugs={};function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,a="",l=!1,p=["{","}"];(isArray(r)&&(l=!0,p=["[","]"]),isFunction(r))&&(a=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(a=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(a=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(a=" "+formatError(r)),0!==o.length||l&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,l)}),e.seen.pop(),reduceToSingleString(c,a,p)):p[0]+a+p[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if((c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce(function(e,r){return 0,r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};
|
|
1495
|
+
|
|
1496
|
+
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1497
|
+
},{"./support/isBuffer":190,"_process":158,"inherits":189}],192:[function(require,module,exports){
|
|
1498
|
+
const OpenAPISampler=require("openapi-sampler"),createHar=function(e,t,r,a){void 0===a&&(a={});const s=getBaseUrl(e,t,r),o={method:r.toUpperCase(),url:s+getFullPath(e,t,r),headers:getHeadersArray(e,t,r),queryString:getQueryStrings(e,t,r,a),httpVersion:"HTTP/1.1",cookies:getCookies(e,t,r),headersSize:0,bodySize:0};let n=[];const i=getPayloads(e,t,r);if(i.length>0)for(let e in i){const t=i[e],r=JSON.parse(JSON.stringify(o));r.postData=t,r.comment=t.mimeType,r.headers.push({name:"content-type",value:t.mimeType}),n.push(r)}else n=[o];return n},isPrimitive=function(e){if(null===e)return!0;const t=typeof e;return"function"!==t&&"object"!==t},getPrefix=function(e){return"label"===e?".":"matrix"===e?";":""},getSeparator=function(e){return"label"===e?".":"matrix"===e?";":","},getParamId=function(e,t){return"matrix"===e?`${t}=`:""},getDefaultStyleForLocation=function(e){return"path"===e||"header"===e?"simple":"query"===e||"cookie"===e?"form":void 0},getDefaultExplodeForStyle=function(e){return"form"===e},getArrayElementSeparator=function(e){let t=",";return"spaceDelimited"===e?t=" ":"pipeDelimited"===e&&(t="|"),t},objectJoin=function(e,t=",",r=","){return Object.entries(e).map(([e,r])=>`${e}${t}${r}`).join(r)},createHarParameterObjects=function({name:e,in:t,style:r,explode:a},s){if(!e||!t||void 0===s)throw"Required parameters missing";const o=getPrefix(r),n=getParamId(r,e);if(isPrimitive(s))return[{name:e,value:o+n+s}];const i=[];if(r=r||getDefaultStyleForLocation(t),a=a||getDefaultExplodeForStyle(r),"query"===t||"cookie"===t){const t=getArrayElementSeparator(r);Array.isArray(s)?a?i.push(...s.map(t=>({name:e,value:t+""}))):i.push({name:e,value:s.join(t)}):s&&"object"==typeof s&&("deepObject"===r?i.push(...Object.entries(s).map(([t,r])=>({name:`${e}[${t}]`,value:r+""}))):a?i.push(...Object.entries(s).map(([e,t])=>({name:e,value:t+""}))):i.push({name:e,value:objectJoin(s)}))}else if("path"===t||"header"===t){const t=getSeparator(r);Array.isArray(s)?i.push({name:e,value:o+n+s.join(a?t+n:",")}):s&&"object"==typeof s&&(a?i.push({name:e,value:o+objectJoin(s,"=",t)}):i.push({name:e,value:o+n+objectJoin(s)}))}return i},getPayloads=function(e,t,r){if(void 0!==e.paths[t][r].parameters)for(let a in e.paths[t][r].parameters){const s=e.paths[t][r].parameters[a];if(void 0!==s.in&&"body"===s.in.toLowerCase()&&void 0!==s.schema)try{const t=OpenAPISampler.sample(s.schema,{skipReadOnly:!0},e);return[{mimeType:"application/json",text:JSON.stringify(t)}]}catch(e){return console.log(e),null}}e.paths[t][r].requestBody&&e.paths[t][r].requestBody.$ref&&(e.paths[t][r].requestBody=resolveRef(e,e.paths[t][r].requestBody.$ref));const a=[];return e.paths[t][r].requestBody&&e.paths[t][r].requestBody.content&&["application/json","application/x-www-form-urlencoded","multipart/form-data"].forEach(s=>{const o=e.paths[t][r].requestBody.content[s];if(o&&o.schema){const t=OpenAPISampler.sample(o.schema,{skipReadOnly:!0},e);if("application/json"===s)a.push({mimeType:s,text:JSON.stringify(t)});else if("multipart/form-data"===s){if(void 0!==t){const e=[];Object.keys(t).forEach(r=>{let a=t[r];"string"!=typeof t[r]&&(a=JSON.stringify(t[r])),e.push({name:r,value:a})}),a.push({mimeType:s,params:e})}}else if("application/x-www-form-urlencoded"==s){if(void 0===t)return null;const e=[];Object.keys(t).map(r=>e.push({name:encodeURIComponent(r).replace(/\%20/g,"+"),value:encodeURIComponent(t[r]).replace(/\%20/g,"+")})),a.push({mimeType:"application/x-www-form-urlencoded",params:e,text:Object.keys(e).map(e=>e+"="+t[e]).join("&")})}}}),a},getBaseUrl=function(e,t,r){if(e.paths[t][r].servers)return e.paths[t][r].servers[0].url;if(e.paths[t].servers)return e.paths[t].servers[0].url;if(e.servers)return e.servers[0].url;let a="";return void 0!==e.schemes?a+=e.schemes[0]:a+="http","/"===e.basePath?a+="://"+e.host:a+="://"+e.host+e.basePath,a},getParameterValues=function(e,t,r,a){let s="SOME_"+(t.type||t.schema.type).toUpperCase()+"_VALUE";if("path"===r&&(s=`{${t.name}}`),a&&void 0!==a[t.name])s=a[t.name];else if(void 0!==t.example)s=t.example;else if(void 0!==t.examples){let r=Object.values(t.examples)[0];"string"==typeof r.$ref&&/^#/.test(r.$ref)&&(r=resolveRef(e,r.$ref)),s=r.value}else void 0!==t.schema&&void 0!==t.schema.example?s=t.schema.example:void 0!==t.default&&(s=t.default);return createHarParameterObjects(t,s)},parseParametersToQuery=function(e,t,r,a){const s={};for(let o in t){let n=t[o];"string"==typeof n.$ref&&/^#/.test(n.$ref)&&(n=resolveRef(e,n.$ref)),void 0!==n.schema&&"string"==typeof n.schema.$ref&&/^#/.test(n.schema.$ref)&&(n.schema=resolveRef(e,n.schema.$ref),void 0===n.schema.type&&(n.schema.type="object")),void 0!==n.in&&n.in.toLowerCase()===r&&(s[n.name]=getParameterValues(e,n,r,a))}return s},getParameterCollectionIn=function(e,t,r,a,s){void 0===s&&(s={});let o={},n={};void 0!==e.paths[t].parameters&&(o=parseParametersToQuery(e,e.paths[t].parameters,a,s)),void 0!==e.paths[t][r].parameters&&(n=parseParametersToQuery(e,e.paths[t][r].parameters,a,s));const i=Object.assign(o,n);return Object.values(i).flatMap(e=>e)},getQueryStrings=function(e,t,r,a){return getParameterCollectionIn(e,t,r,"query",a)},getFullPath=function(e,t,r){let a=t;return getParameterCollectionIn(e,t,r,"path").forEach(({name:e,value:t})=>{a=a.replace("{"+e+"}",t)}),a},getCookies=function(e,t,r){return getParameterCollectionIn(e,t,r,"cookie")},getHeadersArray=function(e,t,r){const a=[],s=e.paths[t][r];if(void 0!==s.consumes)for(let e in s.consumes){const t=s.consumes[e];a.push({name:"accept",value:t})}let o,n,i;if(a.push(...getParameterCollectionIn(e,t,r,"header")),void 0!==s.security)for(var c in s.security){const t=Object.keys(s.security[c])[0],r=e.securityDefinitions?e.securityDefinitions[t]:e.components.securitySchemes[t],a=r.type.toLowerCase();let p=null;switch("apikey"!==a&&null!=r.scheme&&(p=r.scheme.toLowerCase()),a){case"basic":o=t;break;case"apikey":"header"===r.in&&(n=r);break;case"oauth2":i=t;break;case"http":switch(p){case"bearer":i=t;break;case"basic":o=t}}}else if(void 0!==e.security)for(let t in e.security){const r=Object.keys(e.security[t])[0],a=e.components.securitySchemes[r],s=a.type.toLowerCase();let c=null;switch("apikey"!==s&&"oauth2"!==s&&(c=a.scheme.toLowerCase()),s){case"http":switch(c){case"bearer":i=r;break;case"basic":o=r}break;case"basic":o=r;break;case"apikey":"header"===a.in&&(n=a);break;case"oauth2":i=r}}return o?a.push({name:"Authorization",value:"Basic REPLACE_BASIC_AUTH"}):n?a.push({name:n.name,value:"REPLACE_KEY_VALUE"}):i&&a.push({name:"Authorization",value:"Bearer REPLACE_BEARER_TOKEN"}),a},openApiToHarList=function(e){try{const t=[];for(let r in e.paths)for(let a in e.paths[r]){const s=getBaseUrl(e,r,a)+r,o=createHar(e,r,a);t.push({method:a.toUpperCase(),url:s,description:e.paths[r][a].description||"No description available",hars:o})}return t}catch(e){console.log(e)}},resolveRef=function(e,t){const r=t.split("/");if(r.length<=1)return{};const a=function(e,t){if(t+1<r.length){let s=t+1;return a(e[r[t]],s)}return e[r[t]]};return a(e,1)};module.exports={getAll:openApiToHarList,getEndpoint:createHar,createHarParameterObjects:createHarParameterObjects};
|
|
1499
|
+
|
|
1500
|
+
},{"openapi-sampler":155}]},{},[1]);
|