@digi-frontend/dgate-api-documentation 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{__require as e}from"../node_modules/tiny-case/index.js";var r=e();export{r as t};
1
+ import{__require as r}from"../node_modules/property-expr/index.js";var e=r();export{e as p};
2
2
  //# sourceMappingURL=index4.js.map
@@ -1,2 +1,2 @@
1
- import{getDefaultExportFromCjs as o}from"./_commonjsHelpers.js";import{__require as r}from"../node_modules/toposort/index.js";var e=o(r());export{e as default};
1
+ import{__require as e}from"../node_modules/tiny-case/index.js";var r=e();export{r as t};
2
2
  //# sourceMappingURL=index5.js.map
@@ -1,2 +1,2 @@
1
- var e={exports:{}};export{e as __module};
1
+ import{getDefaultExportFromCjs as o}from"./_commonjsHelpers.js";import{__require as r}from"../node_modules/toposort/index.js";var e=o(r());export{e as default};
2
2
  //# sourceMappingURL=index6.js.map
@@ -1,2 +1,2 @@
1
- import{__require as r}from"../node_modules/property-expr/index.js";var e=r();export{e as p};
1
+ var e={exports:{}};export{e as __module};
2
2
  //# sourceMappingURL=index7.js.map
@@ -1,2 +1,2 @@
1
- import{__module as r}from"../../_virtual/index6.js";var e;function n(){if(e)return r.exports;function n(r,e){var n=r.length,t=new Array(n),o={},a=n,i=function(r){for(var e=new Map,n=0,t=r.length;n<t;n++){var o=r[n];e.has(o[0])||e.set(o[0],new Set),e.has(o[1])||e.set(o[1],new Set),e.get(o[0]).add(o[1])}return e}(e),d=function(r){for(var e=new Map,n=0,t=r.length;n<t;n++)e.set(r[n],n);return e}(r);for(e.forEach(function(r){if(!d.has(r[0])||!d.has(r[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)o[a]||f(r[a],a,new Set);return t;function f(r,e,a){if(a.has(r)){var s;try{s=", node was:"+JSON.stringify(r)}catch(r){s=""}throw new Error("Cyclic dependency"+s)}if(!d.has(r))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(r));if(!o[e]){o[e]=!0;var u=i.get(r)||new Set;if(e=(u=Array.from(u)).length){a.add(r);do{var w=u[--e];f(w,d.get(w),a)}while(e);a.delete(r)}t[--n]=r}}}return e=1,r.exports=function(r){return n(function(r){for(var e=new Set,n=0,t=r.length;n<t;n++){var o=r[n];e.add(o[0]),e.add(o[1])}return Array.from(e)}(r),r)},r.exports.array=n,r.exports}export{n as __require};
1
+ import{__module as r}from"../../_virtual/index7.js";var e;function n(){if(e)return r.exports;function n(r,e){var n=r.length,t=new Array(n),o={},a=n,i=function(r){for(var e=new Map,n=0,t=r.length;n<t;n++){var o=r[n];e.has(o[0])||e.set(o[0],new Set),e.has(o[1])||e.set(o[1],new Set),e.get(o[0]).add(o[1])}return e}(e),d=function(r){for(var e=new Map,n=0,t=r.length;n<t;n++)e.set(r[n],n);return e}(r);for(e.forEach(function(r){if(!d.has(r[0])||!d.has(r[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)o[a]||f(r[a],a,new Set);return t;function f(r,e,a){if(a.has(r)){var s;try{s=", node was:"+JSON.stringify(r)}catch(r){s=""}throw new Error("Cyclic dependency"+s)}if(!d.has(r))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(r));if(!o[e]){o[e]=!0;var u=i.get(r)||new Set;if(e=(u=Array.from(u)).length){a.add(r);do{var w=u[--e];f(w,d.get(w),a)}while(e);a.delete(r)}t[--n]=r}}}return e=1,r.exports=function(r){return n(function(r){for(var e=new Set,n=0,t=r.length;n<t;n++){var o=r[n];e.add(o[0]),e.add(o[1])}return Array.from(e)}(r),r)},r.exports.array=n,r.exports}export{n as __require};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{p as e}from"../../_virtual/index7.js";import{t}from"../../_virtual/index4.js";import s from"../../_virtual/index5.js";const r=Object.prototype.toString,n=Error.prototype.toString,i=RegExp.prototype.toString,a="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",o=/^Symbol\((.*)\)(.*)$/;function l(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const s=typeof e;if("number"===s)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===s)return t?`"${e}"`:e;if("function"===s)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===s)return a.call(e).replace(o,"Symbol($1)");const l=r.call(e).slice(8,-1);return"Date"===l?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===l||e instanceof Error?"["+n.call(e)+"]":"RegExp"===l?i.call(e):null}function u(e,t){let s=l(e,t);return null!==s?s:JSON.stringify(e,function(e,s){let r=l(this[e],t);return null!==r?r:s},2)}function c(e){return null==e?[]:[].concat(e)}let h,p,d,f=/\$\{\s*(\w+)\s*\}/g;h=Symbol.toStringTag;class m{constructor(e,t,s,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[h]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=r,this.errors=[],this.inner=[],c(e).forEach(e=>{if(y.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}p=Symbol.hasInstance,d=Symbol.toStringTag;class y extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),"string"==typeof e?e.replace(f,(e,s)=>u(t[s])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,s,r,n){const i=new m(e,t,s,r);if(n)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[d]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,y)}static[p](e){return m[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let v={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:s,originalValue:r})=>{const n=null!=r&&r!==s?` (cast from the value \`${u(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${u(s,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${u(s,!0)}\``+n}},g={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},b={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},F={isValue:"${path} field must be ${value}"},_={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},w={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},x={notType:e=>{const{path:t,value:s,spec:r}=e,n=r.types.length;if(Array.isArray(s)){if(s.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${s.length} for value: \`${u(s,!0)}\``;if(s.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${s.length} for value: \`${u(s,!0)}\``}return y.formatError(v.notType,e)}};Object.assign(Object.create(null),{mixed:v,string:g,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:b,object:_,array:w,boolean:F,tuple:x});const T=e=>e&&e.__isYupSchema__;class ${static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:r,otherwise:n}=t,i="function"==typeof s?s:(...e)=>e.every(e=>e===s);return new $(e,(e,t)=>{var s;let a=i(...e)?r:n;return null!=(s=null==a?void 0:a(t))?s:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn(s,e,t);if(void 0===r||r===e)return e;if(!T(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}const O="$",k=".";class E{constructor(t,s={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof t)throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),""===t)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===O,this.isValue=this.key[0]===k,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?O:this.isValue?k:"";this.path=this.key.slice(r.length),this.getter=this.path&&e.getter(this.path,!0),this.map=s.map}getValue(e,t,s){let r=this.isContext?s:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}E.prototype.__isYupRef=!0;const S=e=>null==e;function j(e){function t({value:t,path:s="",options:r,originalValue:n,schema:i},a,o){const{name:l,test:u,params:c,message:h,skipAbsent:p}=e;let{parent:d,context:f,abortEarly:m=i.spec.abortEarly,disableStackTrace:v=i.spec.disableStackTrace}=r;function g(e){return E.isRef(e)?e.getValue(t,d,f):e}function b(e={}){const r=Object.assign({value:t,originalValue:n,label:i.spec.label,path:e.path||s,spec:i.spec,disableStackTrace:e.disableStackTrace||v},c,e.params);for(const e of Object.keys(r))r[e]=g(r[e]);const a=new y(y.formatError(e.message||h,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const F=m?a:o;let _={path:s,parent:d,type:l,from:r.from,createError:b,resolve:g,options:r,originalValue:n,schema:i};const w=e=>{y.isError(e)?F(e):e?o(null):F(b())},x=e=>{y.isError(e)?F(e):a(e)};if(p&&S(t))return w(!0);let T;try{var $;if(T=u.call(_,t,_),"function"==typeof(null==($=T)?void 0:$.then)){if(r.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(T).then(w,x)}}catch(e){return void x(e)}w(T)}return t.OPTIONS=e,t}function A(t,s,r,n=r){let i,a,o;return s?(e.forEach(s,(e,l,u)=>{let c=l?e.slice(1,e.length-1):e,h="tuple"===(t=t.resolve({context:n,parent:i,value:r})).type,p=u?parseInt(c,10):0;if(t.innerType||h){if(h&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${e}, in the path: ${s}. because there is no value at that index. `);i=r,r=r&&r[p],t=h?t.spec.types[p]:t.innerType}if(!u){if(!t.fields||!t.fields[c])throw new Error(`The schema does not contain the path: ${s}. (failed at: ${o} which is a type: "${t.type}")`);i=r,r=r&&r[c],t=t.fields[c]}a=c,o=l?"["+e+"]":"."+e}),{schema:t,parent:i,parentPath:a}):{parent:i,parentPath:s,schema:t}}class D extends Set{describe(){const e=[];for(const t of this.values())e.push(E.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new D(this.values())}merge(e,t){const s=this.clone();return e.forEach(e=>s.add(e)),t.forEach(e=>s.delete(e)),s}}function C(e,t=new Map){if(T(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let s;if(e instanceof Date)s=new Date(e.getTime()),t.set(e,s);else if(e instanceof RegExp)s=new RegExp(e),t.set(e,s);else if(Array.isArray(e)){s=new Array(e.length),t.set(e,s);for(let r=0;r<e.length;r++)s[r]=C(e[r],t)}else if(e instanceof Map){s=new Map,t.set(e,s);for(const[r,n]of e.entries())s.set(r,C(n,t))}else if(e instanceof Set){s=new Set,t.set(e,s);for(const r of e)s.add(C(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);s={},t.set(e,s);for(const[r,n]of Object.entries(e))s[r]=C(n,t)}return s}class V{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new D,this._blacklist=new D,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(v.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=C(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const r=Object.assign({},t.spec,s.spec);return s.spec=r,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((t,s)=>s.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,r,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(s=e.abortEarly)?s:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(n=e.disableStackTrace)?n:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),r="ignore-optionality"===t.assert,n=s._cast(e,t);if(!1!==t.assert&&!s.isType(n)){if(r&&S(n))return n;let i=u(e),a=u(n);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return n}_cast(e,t){let s=void 0===e?e:this.transforms.reduce((t,s)=>s.call(this,t,e,this),e);return void 0===s&&(s=this.getDefault(t)),s}_validate(e,t={},s,r){let{path:n,originalValue:i=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:n,value:o,originalValue:i,options:t,tests:l},s,e=>{if(e.length)return r(e,o);this.runTests({path:n,value:o,originalValue:i,options:t,tests:this.tests},s,r)})}runTests(e,t,s){let r=!1,{tests:n,value:i,originalValue:a,path:o,options:l}=e,u=e=>{r||(r=!0,t(e,i))},c=e=>{r||(r=!0,s(e,i))},h=n.length,p=[];if(!h)return c([]);let d={value:i,originalValue:a,path:o,options:l,schema:this};for(let e=0;e<n.length;e++){(0,n[e])(d,u,function(e){e&&(Array.isArray(e)?p.push(...e):p.push(e)),--h<=0&&c(p)})}}asNestedTest({key:e,index:t,parent:s,parentPath:r,originalParent:n,options:i}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof a;let l=s[a];const u=Object.assign({},i,{strict:!0,parent:s,value:l,originalValue:n[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${r||""}[${o?a:`"${a}"`}]`:(r?`${r}.`:"")+e});return(e,t,s)=>this.resolve(u)._validate(l,u,t,s)}validate(e,t){var s;let r=this.resolve(Object.assign({},t,{value:e})),n=null!=(s=null==t?void 0:t.disableStackTrace)?s:r.spec.disableStackTrace;return new Promise((s,i)=>r._validate(e,t,(e,t)=>{y.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new y(e,t,void 0,void 0,n)):s(t)}))}validateSync(e,t){var s;let r,n=this.resolve(Object.assign({},t,{value:e})),i=null!=(s=null==t?void 0:t.disableStackTrace)?s:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw y.isError(e)&&(e.value=t),e},(t,s)=>{if(t.length)throw new y(t,e,void 0,void 0,i);r=s}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(y.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(y.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):C(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const s=this.clone({nullable:e});return s.internalTests.nullable=j({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),s}optionality(e,t){const s=this.clone({optional:e});return s.internalTests.optionality=j({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),s}optional(){return this.optionality(!0)}defined(e=v.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=v.notNull){return this.nullability(!1,e)}required(e=v.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=v.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let s=this.clone(),r=j(t),n=t.exclusive||t.name&&!0===s.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(n)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0}),s.tests.push(r),s}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let s=this.clone(),r=c(e).map(e=>new E(e));return r.forEach(e=>{e.isSibling&&s.deps.push(e.key)}),s.conditions.push("function"==typeof t?new $(r,t):$.fromOptions(r,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=j({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=v.oneOf){let s=this.clone();return e.forEach(e=>{s._whitelist.add(e),s._blacklist.delete(e)}),s.internalTests.whiteList=j({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,s=t.resolveAll(this.resolve);return!!s.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:s}})}}),s}notOneOf(e,t=v.notOneOf){let s=this.clone();return e.forEach(e=>{s._blacklist.add(e),s._whitelist.delete(e)}),s.internalTests.blacklist=j({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,s=t.resolveAll(this.resolve);return!s.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:s}})}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:s,meta:r,optional:n,nullable:i}=t.spec;return{meta:r,label:s,optional:n,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,s)=>s.findIndex(t=>t.name===e.name)===t)}}}V.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])V.prototype[`${e}At`]=function(t,s,r={}){const{parent:n,parentPath:i,schema:a}=A(this,t,s,r.context);return a[e](n&&n[i],Object.assign({},r,{parent:n,path:t}))};for(const e of["equals","is"])V.prototype[e]=V.prototype.oneOf;for(const e of["not","nope"])V.prototype[e]=V.prototype.notOneOf;const N=()=>!0;function z(e){return new P(e)}class P extends V{constructor(e){super("function"==typeof e?{type:"mixed",check:e}:Object.assign({type:"mixed",check:N},e))}}function q(){return new I}z.prototype=P.prototype;class I extends V{constructor(){super({type:"boolean",check:e=>(e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e)}),this.withMutation(()=>{this.transform((e,t,s)=>{if(s.spec.coerce&&!s.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=F.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>S(e)||!0===e})}isFalse(e=F.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>S(e)||!1===e})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}q.prototype=I.prototype;const M=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function R(e){var t,s;const r=M.exec(e);return r?{year:U(r[1]),month:U(r[2],1)-1,day:U(r[3],1),hour:U(r[4]),minute:U(r[5]),second:U(r[6]),millisecond:r[7]?U(r[7].substring(0,3)):0,precision:null!=(t=null==(s=r[7])?void 0:s.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:U(r[10]),minuteOffset:U(r[11])}:null}function U(e,t=0){return Number(e)||t}let Z=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Y=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,K=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),J=e=>S(e)||e===e.trim(),B={}.toString();function G(){return new H}class H extends V{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce||s.isType(e))return e;if(Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===B?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||v.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=g.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=g.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=g.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let s,r,n=!1;return t&&("object"==typeof t?({excludeEmptyString:n=!1,message:s,name:r}=t):s=t),this.test({name:r||"matches",message:s||g.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&n||-1!==t.search(e)})}email(e=g.email){return this.matches(Z,{name:"email",message:e,excludeEmptyString:!0})}url(e=g.url){return this.matches(Y,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=g.uuid){return this.matches(L,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,s,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:s}=e):r=e),this.matches(K,{name:"datetime",message:r||g.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||g.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const s=R(e);return!!s&&!!s.z}}).test({name:"datetime_precision",message:r||g.datetime_precision,params:{precision:s},skipAbsent:!0,test:e=>{if(!e||null==s)return!0;const t=R(e);return!!t&&t.precision===s}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=g.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:J})}lowercase(e=g.lowercase){return this.transform(e=>S(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>S(e)||e===e.toLowerCase()})}uppercase(e=g.uppercase){return this.transform(e=>S(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>S(e)||e===e.toUpperCase()})}}G.prototype=H.prototype;let Q=new Date("");class W extends V{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation(()=>{this.transform((e,t,s)=>!s.spec.coerce||s.isType(e)||null===e?e:(e=function(e){const t=R(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let s=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(s=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(s=0-s)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+s,t.second,t.millisecond)}(e),isNaN(e)?W.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(E.isRef(e))s=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=r}return s}min(e,t=b.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(s)}})}max(e,t=b.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(s)}})}}function X(e,t){let s=1/0;return e.some((e,r)=>{var n;if(null!=(n=t.path)&&n.includes(e))return s=r,!0}),s}function ee(e){return(t,s)=>X(e,t)-X(e,s)}W.INVALID_DATE=Q,W.prototype;const te=(e,t,s)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return s.isType(r)?r:e};function se(e){if("fields"in e){const t={};for(const[s,r]of Object.entries(e.fields))t[s]=se(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=se(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(se)}):"optional"in e?e.optional():e}let re=e=>"[object Object]"===Object.prototype.toString.call(e);function ne(e,t){let s=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===s.indexOf(e))}const ie=ee([]);function ae(e){return new oe(e)}class oe extends V{constructor(e){super({type:"object",check:e=>re(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ie,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let n=this.fields,i=null!=(s=t.stripUnknown)?s:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(r).filter(e=>!this._nodes.includes(e))),o={},l=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),u=!1;for(const e of a){let s=n[e],a=e in r;if(s){let n,i=r[e];l.path=(t.path?`${t.path}.`:"")+e,s=s.resolve({value:i,context:t.context,parent:o});let a=s instanceof V?s.spec:void 0,c=null==a?void 0:a.strict;if(null!=a&&a.strip){u=u||e in r;continue}n=t.__validating&&c?r[e]:s.cast(r[e],l),void 0!==n&&(o[e]=n)}else a&&!i&&(o[e]=r[e]);a===e in o&&o[e]===r[e]||(u=!0)}return u?o:r}_validate(e,t={},s,r){let{from:n=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...n],t.__validating=!0,t.originalValue=i,super._validate(e,t,s,(e,n)=>{if(!a||!re(n))return void r(e,n);i=i||n;let o=[];for(let e of this._nodes){let s=this.fields[e];s&&!E.isRef(s)&&o.push(s.asNestedTest({options:t,key:e,parent:n,parentPath:t.path,originalParent:i}))}this.runTests({tests:o,value:n,originalValue:i,options:t},s,t=>{r(t.sort(this._sortErrors).concat(e),n)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=s[e];s[e]=void 0===r?t:r}return t.withMutation(t=>t.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var r;const n=this.fields[s];let i=e;null!=(r=i)&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[s]})),t[s]=n&&"getDefault"in n?n.getDefault(i):void 0}),t}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=function(t,r=[]){let n=[],i=new Set,a=new Set(r.map(([e,t])=>`${e}-${t}`));function o(t,s){let r=e.split(t)[0];i.add(r),a.has(`${s}-${r}`)||n.push([s,r])}for(const e of Object.keys(t)){let s=t[e];i.add(e),E.isRef(s)&&s.isSibling?o(s.path,e):T(s)&&"deps"in s&&s.deps.forEach(t=>o(t,e))}return s.array(Array.from(i),n).reverse()}(t,r),n._sortErrors=ee(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(e,t=[]){return this.clone().withMutation(s=>{let r=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),r)})}partial(){const e={};for(const[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return se(this)}pick(e){const t={};for(const s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([t,s])=>e.includes(t)&&e.includes(s)))}omit(e){const t=[];for(const s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(t,s,r){let n=e.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return((t,s)=>{const r=[...e.normalizePath(s)];if(1===r.length)return r[0]in t;let n=r.pop(),i=e.getter(e.join(r),!0)(t);return!(!i||!(n in i))})(i,t)&&(a=Object.assign({},i),r||delete a[t],a[s]=n(i)),a})}json(){return this.transform(te)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||_.exact,test(e){if(null==e)return!0;const t=ne(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=_.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const s=ne(this.schema,t);return!e||0===s.length||this.createError({params:{unknown:s.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=_.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const s={};for(const r of Object.keys(t))s[e(r)]=t[r];return s})}camelCase(){return this.transformKeys(t.camelCase)}snakeCase(){return this.transformKeys(t.snakeCase)}constantCase(){return this.transformKeys(e=>t.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(const[n,i]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[n]})),s.fields[n]=i.describe(t)}return s}}function le(e){return new ue(e)}ae.prototype=oe.prototype;class ue extends V{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let r=!1;const n=s.map((e,s)=>{const n=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${s}]`}));return n!==e&&(r=!0),n});return r?n:s}_validate(e,t={},s,r){var n;let i=this.innerType,a=null!=(n=t.recursive)?n:this.spec.recursive;null!=t.originalValue&&t.originalValue,super._validate(e,t,s,(n,o)=>{var l;if(!a||!i||!this._typeCheck(o))return void r(n,o);let u=new Array(o.length);for(let s=0;s<o.length;s++){var c;u[s]=i.asNestedTest({options:t,index:s,parent:o,parentPath:t.path,originalParent:null!=(c=t.originalValue)?c:e})}this.runTests({value:o,tests:u,originalValue:null!=(l=t.originalValue)?l:e,options:t},s,e=>r(e.concat(n),o))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(te)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!T(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+u(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=w.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return t=t||w.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return t=t||w.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,s,r)=>!e(t,s,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var r;let n=e;null!=(r=n)&&r.value&&(n=Object.assign({},n,{parent:n.value,value:n.value[0]})),s.innerType=t.innerType.describe(n)}return s}}function ce(e){return new pe(e)}function he(e){try{return e()}catch(e){if(y.isError(e))return Promise.reject(e);throw e}}le.prototype=ue.prototype;class pe{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(e,t={})=>{let s=this.builder(e,t);if(!T(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(t)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){const t=new pe(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:s,parent:r,options:n}=e,i=r[null!=s?s:t];return this._resolve(i,Object.assign({},n,{value:i,parent:r})).asNestedTest(e)}validate(e,t){return he(()=>this._resolve(e,t).validate(e,t))}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,s){return he(()=>this._resolve(t,s).validateAt(e,t,s))}validateSyncAt(e,t,s){return this._resolve(t,s).validateSyncAt(e,t,s)}isValid(e,t){try{return this._resolve(e,t).isValid(e,t)}catch(e){if(y.isError(e))return Promise.resolve(!1);throw e}}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}}export{ue as ArraySchema,I as BooleanSchema,W as DateSchema,pe as LazySchema,P as MixedSchema,oe as ObjectSchema,V as Schema,H as StringSchema,y as ValidationError,le as array,q as bool,q as boolean,A as getIn,T as isSchema,ce as lazy,z as mixed,ae as object,u as printValue,G as string};
1
+ import{p as e}from"../../_virtual/index4.js";import{t}from"../../_virtual/index5.js";import s from"../../_virtual/index6.js";const r=Object.prototype.toString,n=Error.prototype.toString,i=RegExp.prototype.toString,a="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",o=/^Symbol\((.*)\)(.*)$/;function l(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const s=typeof e;if("number"===s)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===s)return t?`"${e}"`:e;if("function"===s)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===s)return a.call(e).replace(o,"Symbol($1)");const l=r.call(e).slice(8,-1);return"Date"===l?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===l||e instanceof Error?"["+n.call(e)+"]":"RegExp"===l?i.call(e):null}function u(e,t){let s=l(e,t);return null!==s?s:JSON.stringify(e,function(e,s){let r=l(this[e],t);return null!==r?r:s},2)}function c(e){return null==e?[]:[].concat(e)}let h,p,d,f=/\$\{\s*(\w+)\s*\}/g;h=Symbol.toStringTag;class m{constructor(e,t,s,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[h]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=r,this.errors=[],this.inner=[],c(e).forEach(e=>{if(y.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}p=Symbol.hasInstance,d=Symbol.toStringTag;class y extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),"string"==typeof e?e.replace(f,(e,s)=>u(t[s])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,s,r,n){const i=new m(e,t,s,r);if(n)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[d]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,y)}static[p](e){return m[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let v={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:s,originalValue:r})=>{const n=null!=r&&r!==s?` (cast from the value \`${u(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${u(s,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${u(s,!0)}\``+n}},g={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},b={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},F={isValue:"${path} field must be ${value}"},_={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},w={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},x={notType:e=>{const{path:t,value:s,spec:r}=e,n=r.types.length;if(Array.isArray(s)){if(s.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${s.length} for value: \`${u(s,!0)}\``;if(s.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${s.length} for value: \`${u(s,!0)}\``}return y.formatError(v.notType,e)}};Object.assign(Object.create(null),{mixed:v,string:g,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:b,object:_,array:w,boolean:F,tuple:x});const T=e=>e&&e.__isYupSchema__;class ${static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:r,otherwise:n}=t,i="function"==typeof s?s:(...e)=>e.every(e=>e===s);return new $(e,(e,t)=>{var s;let a=i(...e)?r:n;return null!=(s=null==a?void 0:a(t))?s:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn(s,e,t);if(void 0===r||r===e)return e;if(!T(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}const O="$",k=".";class E{constructor(t,s={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof t)throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),""===t)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===O,this.isValue=this.key[0]===k,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?O:this.isValue?k:"";this.path=this.key.slice(r.length),this.getter=this.path&&e.getter(this.path,!0),this.map=s.map}getValue(e,t,s){let r=this.isContext?s:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}E.prototype.__isYupRef=!0;const S=e=>null==e;function j(e){function t({value:t,path:s="",options:r,originalValue:n,schema:i},a,o){const{name:l,test:u,params:c,message:h,skipAbsent:p}=e;let{parent:d,context:f,abortEarly:m=i.spec.abortEarly,disableStackTrace:v=i.spec.disableStackTrace}=r;function g(e){return E.isRef(e)?e.getValue(t,d,f):e}function b(e={}){const r=Object.assign({value:t,originalValue:n,label:i.spec.label,path:e.path||s,spec:i.spec,disableStackTrace:e.disableStackTrace||v},c,e.params);for(const e of Object.keys(r))r[e]=g(r[e]);const a=new y(y.formatError(e.message||h,r),t,r.path,e.type||l,r.disableStackTrace);return a.params=r,a}const F=m?a:o;let _={path:s,parent:d,type:l,from:r.from,createError:b,resolve:g,options:r,originalValue:n,schema:i};const w=e=>{y.isError(e)?F(e):e?o(null):F(b())},x=e=>{y.isError(e)?F(e):a(e)};if(p&&S(t))return w(!0);let T;try{var $;if(T=u.call(_,t,_),"function"==typeof(null==($=T)?void 0:$.then)){if(r.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(T).then(w,x)}}catch(e){return void x(e)}w(T)}return t.OPTIONS=e,t}function A(t,s,r,n=r){let i,a,o;return s?(e.forEach(s,(e,l,u)=>{let c=l?e.slice(1,e.length-1):e,h="tuple"===(t=t.resolve({context:n,parent:i,value:r})).type,p=u?parseInt(c,10):0;if(t.innerType||h){if(h&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&p>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${e}, in the path: ${s}. because there is no value at that index. `);i=r,r=r&&r[p],t=h?t.spec.types[p]:t.innerType}if(!u){if(!t.fields||!t.fields[c])throw new Error(`The schema does not contain the path: ${s}. (failed at: ${o} which is a type: "${t.type}")`);i=r,r=r&&r[c],t=t.fields[c]}a=c,o=l?"["+e+"]":"."+e}),{schema:t,parent:i,parentPath:a}):{parent:i,parentPath:s,schema:t}}class D extends Set{describe(){const e=[];for(const t of this.values())e.push(E.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new D(this.values())}merge(e,t){const s=this.clone();return e.forEach(e=>s.add(e)),t.forEach(e=>s.delete(e)),s}}function C(e,t=new Map){if(T(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let s;if(e instanceof Date)s=new Date(e.getTime()),t.set(e,s);else if(e instanceof RegExp)s=new RegExp(e),t.set(e,s);else if(Array.isArray(e)){s=new Array(e.length),t.set(e,s);for(let r=0;r<e.length;r++)s[r]=C(e[r],t)}else if(e instanceof Map){s=new Map,t.set(e,s);for(const[r,n]of e.entries())s.set(r,C(n,t))}else if(e instanceof Set){s=new Set,t.set(e,s);for(const r of e)s.add(C(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);s={},t.set(e,s);for(const[r,n]of Object.entries(e))s[r]=C(n,t)}return s}class V{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new D,this._blacklist=new D,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(v.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=C(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const r=Object.assign({},t.spec,s.spec);return s.spec=r,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((t,s)=>s.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,r,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(s=e.abortEarly)?s:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(n=e.disableStackTrace)?n:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({value:e},t)),r="ignore-optionality"===t.assert,n=s._cast(e,t);if(!1!==t.assert&&!s.isType(n)){if(r&&S(n))return n;let i=u(e),a=u(n);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return n}_cast(e,t){let s=void 0===e?e:this.transforms.reduce((t,s)=>s.call(this,t,e,this),e);return void 0===s&&(s=this.getDefault(t)),s}_validate(e,t={},s,r){let{path:n,originalValue:i=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:n,value:o,originalValue:i,options:t,tests:l},s,e=>{if(e.length)return r(e,o);this.runTests({path:n,value:o,originalValue:i,options:t,tests:this.tests},s,r)})}runTests(e,t,s){let r=!1,{tests:n,value:i,originalValue:a,path:o,options:l}=e,u=e=>{r||(r=!0,t(e,i))},c=e=>{r||(r=!0,s(e,i))},h=n.length,p=[];if(!h)return c([]);let d={value:i,originalValue:a,path:o,options:l,schema:this};for(let e=0;e<n.length;e++){(0,n[e])(d,u,function(e){e&&(Array.isArray(e)?p.push(...e):p.push(e)),--h<=0&&c(p)})}}asNestedTest({key:e,index:t,parent:s,parentPath:r,originalParent:n,options:i}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof a;let l=s[a];const u=Object.assign({},i,{strict:!0,parent:s,value:l,originalValue:n[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${r||""}[${o?a:`"${a}"`}]`:(r?`${r}.`:"")+e});return(e,t,s)=>this.resolve(u)._validate(l,u,t,s)}validate(e,t){var s;let r=this.resolve(Object.assign({},t,{value:e})),n=null!=(s=null==t?void 0:t.disableStackTrace)?s:r.spec.disableStackTrace;return new Promise((s,i)=>r._validate(e,t,(e,t)=>{y.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new y(e,t,void 0,void 0,n)):s(t)}))}validateSync(e,t){var s;let r,n=this.resolve(Object.assign({},t,{value:e})),i=null!=(s=null==t?void 0:t.disableStackTrace)?s:n.spec.disableStackTrace;return n._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw y.isError(e)&&(e.value=t),e},(t,s)=>{if(t.length)throw new y(t,e,void 0,void 0,i);r=s}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(y.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(y.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):C(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const s=this.clone({nullable:e});return s.internalTests.nullable=j({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),s}optionality(e,t){const s=this.clone({optional:e});return s.internalTests.optionality=j({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),s}optional(){return this.optionality(!0)}defined(e=v.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=v.notNull){return this.nullability(!1,e)}required(e=v.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=v.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let s=this.clone(),r=j(t),n=t.exclusive||t.name&&!0===s.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(n)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0}),s.tests.push(r),s}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let s=this.clone(),r=c(e).map(e=>new E(e));return r.forEach(e=>{e.isSibling&&s.deps.push(e.key)}),s.conditions.push("function"==typeof t?new $(r,t):$.fromOptions(r,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=j({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=v.oneOf){let s=this.clone();return e.forEach(e=>{s._whitelist.add(e),s._blacklist.delete(e)}),s.internalTests.whiteList=j({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,s=t.resolveAll(this.resolve);return!!s.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:s}})}}),s}notOneOf(e,t=v.notOneOf){let s=this.clone();return e.forEach(e=>{s._blacklist.add(e),s._whitelist.delete(e)}),s.internalTests.blacklist=j({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,s=t.resolveAll(this.resolve);return!s.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:s}})}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:s,meta:r,optional:n,nullable:i}=t.spec;return{meta:r,label:s,optional:n,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(e=>({name:e.OPTIONS.name,params:e.OPTIONS.params})).filter((e,t,s)=>s.findIndex(t=>t.name===e.name)===t)}}}V.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])V.prototype[`${e}At`]=function(t,s,r={}){const{parent:n,parentPath:i,schema:a}=A(this,t,s,r.context);return a[e](n&&n[i],Object.assign({},r,{parent:n,path:t}))};for(const e of["equals","is"])V.prototype[e]=V.prototype.oneOf;for(const e of["not","nope"])V.prototype[e]=V.prototype.notOneOf;const N=()=>!0;function z(e){return new P(e)}class P extends V{constructor(e){super("function"==typeof e?{type:"mixed",check:e}:Object.assign({type:"mixed",check:N},e))}}function q(){return new I}z.prototype=P.prototype;class I extends V{constructor(){super({type:"boolean",check:e=>(e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e)}),this.withMutation(()=>{this.transform((e,t,s)=>{if(s.spec.coerce&&!s.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=F.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>S(e)||!0===e})}isFalse(e=F.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>S(e)||!1===e})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}q.prototype=I.prototype;const M=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function R(e){var t,s;const r=M.exec(e);return r?{year:U(r[1]),month:U(r[2],1)-1,day:U(r[3],1),hour:U(r[4]),minute:U(r[5]),second:U(r[6]),millisecond:r[7]?U(r[7].substring(0,3)):0,precision:null!=(t=null==(s=r[7])?void 0:s.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:U(r[10]),minuteOffset:U(r[11])}:null}function U(e,t=0){return Number(e)||t}let Z=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Y=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,K=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),J=e=>S(e)||e===e.trim(),B={}.toString();function G(){return new H}class H extends V{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t,s)=>{if(!s.spec.coerce||s.isType(e))return e;if(Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===B?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||v.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=g.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=g.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=g.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let s,r,n=!1;return t&&("object"==typeof t?({excludeEmptyString:n=!1,message:s,name:r}=t):s=t),this.test({name:r||"matches",message:s||g.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&n||-1!==t.search(e)})}email(e=g.email){return this.matches(Z,{name:"email",message:e,excludeEmptyString:!0})}url(e=g.url){return this.matches(Y,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=g.uuid){return this.matches(L,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,s,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:s}=e):r=e),this.matches(K,{name:"datetime",message:r||g.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||g.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const s=R(e);return!!s&&!!s.z}}).test({name:"datetime_precision",message:r||g.datetime_precision,params:{precision:s},skipAbsent:!0,test:e=>{if(!e||null==s)return!0;const t=R(e);return!!t&&t.precision===s}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=g.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:J})}lowercase(e=g.lowercase){return this.transform(e=>S(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>S(e)||e===e.toLowerCase()})}uppercase(e=g.uppercase){return this.transform(e=>S(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>S(e)||e===e.toUpperCase()})}}G.prototype=H.prototype;let Q=new Date("");class W extends V{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation(()=>{this.transform((e,t,s)=>!s.spec.coerce||s.isType(e)||null===e?e:(e=function(e){const t=R(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let s=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(s=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(s=0-s)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+s,t.second,t.millisecond)}(e),isNaN(e)?W.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(E.isRef(e))s=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=r}return s}min(e,t=b.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(s)}})}max(e,t=b.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(s)}})}}function X(e,t){let s=1/0;return e.some((e,r)=>{var n;if(null!=(n=t.path)&&n.includes(e))return s=r,!0}),s}function ee(e){return(t,s)=>X(e,t)-X(e,s)}W.INVALID_DATE=Q,W.prototype;const te=(e,t,s)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return s.isType(r)?r:e};function se(e){if("fields"in e){const t={};for(const[s,r]of Object.entries(e.fields))t[s]=se(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=se(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(se)}):"optional"in e?e.optional():e}let re=e=>"[object Object]"===Object.prototype.toString.call(e);function ne(e,t){let s=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===s.indexOf(e))}const ie=ee([]);function ae(e){return new oe(e)}class oe extends V{constructor(e){super({type:"object",check:e=>re(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ie,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let n=this.fields,i=null!=(s=t.stripUnknown)?s:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(r).filter(e=>!this._nodes.includes(e))),o={},l=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),u=!1;for(const e of a){let s=n[e],a=e in r;if(s){let n,i=r[e];l.path=(t.path?`${t.path}.`:"")+e,s=s.resolve({value:i,context:t.context,parent:o});let a=s instanceof V?s.spec:void 0,c=null==a?void 0:a.strict;if(null!=a&&a.strip){u=u||e in r;continue}n=t.__validating&&c?r[e]:s.cast(r[e],l),void 0!==n&&(o[e]=n)}else a&&!i&&(o[e]=r[e]);a===e in o&&o[e]===r[e]||(u=!0)}return u?o:r}_validate(e,t={},s,r){let{from:n=[],originalValue:i=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:i},...n],t.__validating=!0,t.originalValue=i,super._validate(e,t,s,(e,n)=>{if(!a||!re(n))return void r(e,n);i=i||n;let o=[];for(let e of this._nodes){let s=this.fields[e];s&&!E.isRef(s)&&o.push(s.asNestedTest({options:t,key:e,parent:n,parentPath:t.path,originalParent:i}))}this.runTests({tests:o,value:n,originalValue:i,options:t},s,t=>{r(t.sort(this._sortErrors).concat(e),n)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=s[e];s[e]=void 0===r?t:r}return t.withMutation(t=>t.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var r;const n=this.fields[s];let i=e;null!=(r=i)&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[s]})),t[s]=n&&"getDefault"in n?n.getDefault(i):void 0}),t}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=function(t,r=[]){let n=[],i=new Set,a=new Set(r.map(([e,t])=>`${e}-${t}`));function o(t,s){let r=e.split(t)[0];i.add(r),a.has(`${s}-${r}`)||n.push([s,r])}for(const e of Object.keys(t)){let s=t[e];i.add(e),E.isRef(s)&&s.isSibling?o(s.path,e):T(s)&&"deps"in s&&s.deps.forEach(t=>o(t,e))}return s.array(Array.from(i),n).reverse()}(t,r),n._sortErrors=ee(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(e,t=[]){return this.clone().withMutation(s=>{let r=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),r)})}partial(){const e={};for(const[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return se(this)}pick(e){const t={};for(const s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([t,s])=>e.includes(t)&&e.includes(s)))}omit(e){const t=[];for(const s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(t,s,r){let n=e.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return((t,s)=>{const r=[...e.normalizePath(s)];if(1===r.length)return r[0]in t;let n=r.pop(),i=e.getter(e.join(r),!0)(t);return!(!i||!(n in i))})(i,t)&&(a=Object.assign({},i),r||delete a[t],a[s]=n(i)),a})}json(){return this.transform(te)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||_.exact,test(e){if(null==e)return!0;const t=ne(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=_.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const s=ne(this.schema,t);return!e||0===s.length||this.createError({params:{unknown:s.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=_.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const s={};for(const r of Object.keys(t))s[e(r)]=t[r];return s})}camelCase(){return this.transformKeys(t.camelCase)}snakeCase(){return this.transformKeys(t.snakeCase)}constantCase(){return this.transformKeys(e=>t.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(const[n,i]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[n]})),s.fields[n]=i.describe(t)}return s}}function le(e){return new ue(e)}ae.prototype=oe.prototype;class ue extends V{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let r=!1;const n=s.map((e,s)=>{const n=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${s}]`}));return n!==e&&(r=!0),n});return r?n:s}_validate(e,t={},s,r){var n;let i=this.innerType,a=null!=(n=t.recursive)?n:this.spec.recursive;null!=t.originalValue&&t.originalValue,super._validate(e,t,s,(n,o)=>{var l;if(!a||!i||!this._typeCheck(o))return void r(n,o);let u=new Array(o.length);for(let s=0;s<o.length;s++){var c;u[s]=i.asNestedTest({options:t,index:s,parent:o,parentPath:t.path,originalParent:null!=(c=t.originalValue)?c:e})}this.runTests({value:o,tests:u,originalValue:null!=(l=t.originalValue)?l:e,options:t},s,e=>r(e.concat(n),o))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(te)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!T(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+u(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=w.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return t=t||w.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return t=t||w.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,s,r)=>!e(t,s,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var r;let n=e;null!=(r=n)&&r.value&&(n=Object.assign({},n,{parent:n.value,value:n.value[0]})),s.innerType=t.innerType.describe(n)}return s}}function ce(e){return new pe(e)}function he(e){try{return e()}catch(e){if(y.isError(e))return Promise.reject(e);throw e}}le.prototype=ue.prototype;class pe{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(e,t={})=>{let s=this.builder(e,t);if(!T(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(t)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){const t=new pe(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:s,parent:r,options:n}=e,i=r[null!=s?s:t];return this._resolve(i,Object.assign({},n,{value:i,parent:r})).asNestedTest(e)}validate(e,t){return he(()=>this._resolve(e,t).validate(e,t))}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,s){return he(()=>this._resolve(t,s).validateAt(e,t,s))}validateSyncAt(e,t,s){return this._resolve(t,s).validateSyncAt(e,t,s)}isValid(e,t){try{return this._resolve(e,t).isValid(e,t)}catch(e){if(y.isError(e))return Promise.resolve(!1);throw e}}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}}export{ue as ArraySchema,I as BooleanSchema,W as DateSchema,pe as LazySchema,P as MixedSchema,oe as ObjectSchema,V as Schema,H as StringSchema,y as ValidationError,le as array,q as bool,q as boolean,A as getIn,T as isSchema,ce as lazy,z as mixed,ae as object,u as printValue,G as string};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"../../node_modules/tslib/tslib.es6.js";const s=(e,s)=>e.replace(/^#\//,"").split("/").reduce((e,s)=>null==e?void 0:e[s],s),t=e=>{var s,t,n,i;if(e.components&&e.components.securitySchemes){const o=null===(s=Object.keys(e.components.securitySchemes))||void 0===s?void 0:s.at(0);o&&(e.components.securitySchemes[o].type=null===(i=null===(n=null===(t=null==e?void 0:e.components)||void 0===t?void 0:t.securitySchemes)||void 0===n?void 0:n[o])||void 0===i?void 0:i.type)}else e.components=Object.assign({securitySchemes:{Public:{type:"http",scheme:"public"}}},e.components||{});return e.tags||(e.tags=[]),Object.assign(Object.assign({},e),{paths:o(e)})},n=e=>{var s,t,n,o;const i=Object.assign(Object.assign({},e),{paths:c(e.paths)});if(i.components&&i.components.securitySchemes){const e=null===(s=Object.keys(i.components.securitySchemes))||void 0===s?void 0:s.at(0);e&&(i.components.securitySchemes[e].type.toLowerCase()=="APIKEY".toLowerCase()&&(i.components.securitySchemes[e].in=i.components.securitySchemes[e].in),i.components.securitySchemes[e].type=null===(o=null===(n=null===(t=null==i?void 0:i.components)||void 0===t?void 0:t.securitySchemes)||void 0===n?void 0:n[e])||void 0===o?void 0:o.type)}return i},o=e=>{const t=e.paths;return Object.entries(t).map(([t,n])=>({path:t,methods:Object.entries(n).map(([t,n])=>{var o,i,c,r,l,d;const a=Object.assign(Object.assign({},n),{type:t,tags:n.tags||[],summary:n.summary||"",responses:Object.entries(n.responses).map(([t,n])=>{var o,i,c,r,l;const d=Object.keys(n.content||{})[0];let a=null!==(o=null==n?void 0:n.headers)&&void 0!==o?o:{};Object.keys(a).map(e=>{var s,t,n,o;let i=a[e];(null==i?void 0:i.schema)&&(null===(s=null==i?void 0:i.schema)||void 0===s?void 0:s.type)&&"array"!=(null===(t=null==i?void 0:i.schema)||void 0===t?void 0:t.type)&&(null===(o=null===(n=a[e])||void 0===n?void 0:n.schema)||void 0===o||delete o.items)});let u=null===(c=null===(i=n.content)||void 0===i?void 0:i[d])||void 0===c?void 0:c.schema;if(null==u?void 0:u.$ref)u=s(null==u?void 0:u.$ref,e);else if("array"==(null==u?void 0:u.type)&&(null===(r=null==u?void 0:u.items)||void 0===r?void 0:r.$ref)){const t=s(u.items.$ref,e);u=Object.assign(Object.assign({},u),{items:t})}return{code:t,headers:a,content:{contentType:d,schema:Object.assign(Object.assign({},u),{properties:JSON.stringify((null==u?void 0:u.properties)||(null===(l=null==u?void 0:u.items)||void 0===l?void 0:l.properties))})}}})});if(a.responses.find(e=>"200"==e.code)||a.responses.push({code:"200",content:{contentType:"application/json",schema:{}},headers:{}}),(null==n?void 0:n.parameters)||(a.parameters=[]),"get"!=t.toLowerCase()){const t=Object.keys((null===(o=null==n?void 0:n.requestBody)||void 0===o?void 0:o.content)||{})[0];let u=null===(r=null===(c=null===(i=null==n?void 0:n.requestBody)||void 0===i?void 0:i.content)||void 0===c?void 0:c[t])||void 0===r?void 0:r.schema;(null==u?void 0:u.$ref)?u=s(u.$ref,e):"array"===(null==u?void 0:u.type)&&(null===(l=u.items)||void 0===l?void 0:l.$ref)&&(u=Object.assign(Object.assign({},u),{items:s(u.items.$ref,e)}));const p=u?{content:{contentType:t,schema:Object.assign(Object.assign({},u),{properties:JSON.stringify((null==u?void 0:u.properties)||(null===(d=null==u?void 0:u.items)||void 0===d?void 0:d.properties))})}}:{content:{contentType:"application/json",schema:{properties:"{}",type:"object"}}};a.requestBody=p}return a})}))},i=(e,s)=>{var t,n;if(!(null==e?void 0:e.schema)||!(null===(t=null==e?void 0:e.schema)||void 0===t?void 0:t.properties))return{};return JSON.parse(null===(n=null==e?void 0:e.schema)||void 0===n?void 0:n.properties)},c=s=>s.reduce((s,{path:t,methods:n})=>(s[t]=n.reduce((s,t)=>{var{type:n,tags:o,responses:c,summary:r,requestBody:l}=t,d=e(t,["type","tags","responses","summary","requestBody"]);let a=structuredClone(d||{});a&&a.parameters&&a.parameters.map(e=>{var s,t,n;return e&&(null===(s=null==e?void 0:e.schema)||void 0===s?void 0:s.items)&&"array"==(null===(n=null===(t=null==e?void 0:e.schema)||void 0===t?void 0:t.items)||void 0===n?void 0:n.type)&&(e.schema.items.items={}),e});const u=d.responses||{};s[n]=Object.assign(Object.assign({},a),{tags:o,summary:r,responses:c.reduce((e,{code:s,content:t,headers:n})=>{var o;const c=!u[s],r=Object.keys(n||{}).length>0,l=Object.keys(i(t||{})||{}).length>0;if(c&&!r&&!l)return e;const d={};if(n)for(const[e,s]of Object.entries(n))d[e]={description:s.description||"",required:s.required||!1,schema:s.schema||{}};return e[s]={description:"Success",content:t.contentType?{[t.contentType]:{schema:Object.assign(Object.assign({},t.schema),{properties:i(t)})}}:(null===(o=u[s])||void 0===o?void 0:o.content)||{},headers:d},e},{})});const p="get"!==n?JSON.parse(l.content.schema.properties):{};return"get"!==n&&(s[n].requestBody={content:{[l.content.contentType]:{schema:Object.assign(Object.assign({},l.content.schema),{properties:p})}}}),s},{}),s),{});export{t as transformOpenApiObject,n as transformOpenApiObjectToOrigin,c as transformPathsArrayToOrigin,o as transformPathsToArray};
1
+ import{__rest as e}from"../../node_modules/tslib/tslib.es6.js";const s=(e,s)=>e.replace(/^#\//,"").split("/").reduce((e,s)=>null==e?void 0:e[s],s),t=e=>{var s,t,n,i;if(e.components&&e.components.securitySchemes){const o=null===(s=Object.keys(e.components.securitySchemes))||void 0===s?void 0:s.at(0);o&&(e.components.securitySchemes[o].type=null===(i=null===(n=null===(t=null==e?void 0:e.components)||void 0===t?void 0:t.securitySchemes)||void 0===n?void 0:n[o])||void 0===i?void 0:i.type)}else e.components=Object.assign({securitySchemes:{Public:{type:"http",scheme:"public"}}},e.components||{});return e.tags||(e.tags=[]),Object.assign(Object.assign({},e),{paths:o(e)})},n=e=>{var s,t,n,o;const i=Object.assign(Object.assign({},e),{paths:c(e.paths)});if(i.components&&i.components.securitySchemes){const e=null===(s=Object.keys(i.components.securitySchemes))||void 0===s?void 0:s.at(0);e&&(i.components.securitySchemes[e].type.toLowerCase()=="APIKEY".toLowerCase()&&(i.components.securitySchemes[e].in=i.components.securitySchemes[e].in),i.components.securitySchemes[e].type=null===(o=null===(n=null===(t=null==i?void 0:i.components)||void 0===t?void 0:t.securitySchemes)||void 0===n?void 0:n[e])||void 0===o?void 0:o.type)}return i},o=t=>{const n=t.paths;return Object.entries(n).map(([n,o])=>({path:n,methods:Object.entries(o).map(([n,o])=>{var i,c,r,l,a,d;const u=Object.assign(Object.assign({},o),{type:n,tags:o.tags||[],summary:o.summary||"",responses:Object.entries(o.responses).map(([n,o])=>{var i,c,r,l,a;const d=Object.keys(o.content||{})[0];let u=null!==(i=null==o?void 0:o.headers)&&void 0!==i?i:{};Object.keys(u).map(e=>{var s,t,n,o;let i=u[e];(null==i?void 0:i.schema)&&(null===(s=null==i?void 0:i.schema)||void 0===s?void 0:s.type)&&"array"!=(null===(t=null==i?void 0:i.schema)||void 0===t?void 0:t.type)&&(null===(o=null===(n=u[e])||void 0===n?void 0:n.schema)||void 0===o||delete o.items)});let p=null===(r=null===(c=o.content)||void 0===c?void 0:c[d])||void 0===r?void 0:r.schema;if(null==p?void 0:p.$ref)p=s(null==p?void 0:p.$ref,t);else if("array"==(null==p?void 0:p.type)&&(null===(l=null==p?void 0:p.items)||void 0===l?void 0:l.$ref)){const e=s(p.items.$ref,t);p=Object.assign(Object.assign({},p),{items:e})}if("array"!==(null==p?void 0:p.type)){p=e(p,["items"])}return{code:n,headers:u,content:{contentType:d,schema:Object.assign(Object.assign({},p),{properties:JSON.stringify((null==p?void 0:p.properties)||(null===(a=null==p?void 0:p.items)||void 0===a?void 0:a.properties))})}}})});if(u.responses.find(e=>"200"==e.code)||u.responses.push({code:"200",content:{contentType:"application/json",schema:{}},headers:{}}),(null==o?void 0:o.parameters)?u.parameters=u.parameters.map(e=>{var s;const{schema:t}=e;return t&&(null==t?void 0:t.items)&&"array"!=(null===(s=null==t?void 0:t.type)||void 0===s?void 0:s.toLowerCase())&&delete t.items,Object.assign(Object.assign({},e),{schema:t})}):u.parameters=[],"get"!=n.toLowerCase()){const e=Object.keys((null===(i=null==o?void 0:o.requestBody)||void 0===i?void 0:i.content)||{})[0];let n=null===(l=null===(r=null===(c=null==o?void 0:o.requestBody)||void 0===c?void 0:c.content)||void 0===r?void 0:r[e])||void 0===l?void 0:l.schema;(null==n?void 0:n.$ref)?n=s(n.$ref,t):"array"===(null==n?void 0:n.type)&&(null===(a=n.items)||void 0===a?void 0:a.$ref)&&(n=Object.assign(Object.assign({},n),{items:s(n.items.$ref,t)}));const p=n?{content:{contentType:e,schema:Object.assign(Object.assign({},n),{properties:JSON.stringify((null==n?void 0:n.properties)||(null===(d=null==n?void 0:n.items)||void 0===d?void 0:d.properties))})}}:{content:{contentType:"application/json",schema:{properties:"{}",type:"object"}}};u.requestBody=p}return u})}))},i=(e,s)=>{var t,n;if(!(null==e?void 0:e.schema)||!(null===(t=null==e?void 0:e.schema)||void 0===t?void 0:t.properties))return{};return JSON.parse(null===(n=null==e?void 0:e.schema)||void 0===n?void 0:n.properties)},c=s=>s.reduce((s,{path:t,methods:n})=>(s[t]=n.reduce((s,t)=>{var{type:n,tags:o,responses:c,summary:r,requestBody:l}=t,a=e(t,["type","tags","responses","summary","requestBody"]);let d=structuredClone(a||{});d&&d.parameters&&d.parameters.map(e=>{var s,t,n;return e&&(null===(s=null==e?void 0:e.schema)||void 0===s?void 0:s.items)&&"array"==(null===(n=null===(t=null==e?void 0:e.schema)||void 0===t?void 0:t.items)||void 0===n?void 0:n.type)&&(e.schema.items.items={}),e});const u=a.responses||{};s[n]=Object.assign(Object.assign({},d),{tags:o,summary:r,responses:c.reduce((e,{code:s,content:t,headers:n})=>{var o;const c=!u[s],r=Object.keys(n||{}).length>0,l=Object.keys(i(t||{})||{}).length>0;if(c&&!r&&!l)return e;const a={};if(n)for(const[e,s]of Object.entries(n))a[e]={description:s.description||"",required:s.required||!1,schema:s.schema||{}};return e[s]={description:"Success",content:t.contentType?{[t.contentType]:{schema:Object.assign(Object.assign({},t.schema),{properties:i(t)})}}:(null===(o=u[s])||void 0===o?void 0:o.content)||{},headers:a},e},{})});const p="get"!==n?JSON.parse(l.content.schema.properties):{};return"get"!==n&&(s[n].requestBody={content:{[l.content.contentType]:{schema:Object.assign(Object.assign({},l.content.schema),{properties:p})}}}),s},{}),s),{});export{t as transformOpenApiObject,n as transformOpenApiObjectToOrigin,c as transformPathsArrayToOrigin,o as transformPathsToArray};
2
2
  //# sourceMappingURL=layout.helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.helper.js","sources":["../../../src/helpers/layout.helper.ts"],"sourcesContent":["import { TransformedPathsArray } from '@entities/layout.type'\nimport { OpenAPIFile, SecurityScheme } from '@entities/openApi'\nimport { TransformedOpenApi } from '@entities/transformedOpenApi'\n\nconst resolveRef = (ref: string, openApiJson: OpenAPIFile): Object => {\n const parts = ref.replace(/^#\\//, '').split('/')\n return parts.reduce((obj, key) => obj?.[key], openApiJson)\n}\n\nexport const transformOpenApiObject = (openApiJson: OpenAPIFile): TransformedOpenApi => {\n if (openApiJson.components && openApiJson.components.securitySchemes) {\n const authKey = Object.keys(openApiJson.components.securitySchemes)?.at(0)\n if (authKey) {\n openApiJson.components.securitySchemes[authKey].type = openApiJson?.components\n ?.securitySchemes?.[authKey]?.type as SecurityScheme['type']\n }\n } else {\n openApiJson.components = {\n securitySchemes: {\n Public: {\n type: 'http',\n scheme: 'public',\n },\n },\n ...(openApiJson.components || {}),\n }\n }\n\n if (!openApiJson.tags) {\n openApiJson.tags = []\n }\n\n return {\n ...openApiJson,\n paths: transformPathsToArray(openApiJson),\n } as TransformedOpenApi\n}\n\nexport const transformOpenApiObjectToOrigin = (values: TransformedOpenApi): OpenAPIFile => {\n const object = {\n ...values,\n paths: transformPathsArrayToOrigin(values.paths),\n }\n if (object.components && object.components.securitySchemes) {\n const authKey = Object.keys(object.components.securitySchemes)?.at(0)\n if (authKey) {\n if (object.components.securitySchemes[authKey].type.toLowerCase() == 'APIKEY'.toLowerCase()) {\n object.components.securitySchemes[authKey].in = object.components.securitySchemes[authKey]\n .in as SecurityScheme['in']\n }\n object.components.securitySchemes[authKey].type = object?.components?.securitySchemes?.[\n authKey\n ]?.type as SecurityScheme['type']\n }\n }\n return object\n}\n\nexport const transformPathsToArray = (openApiJson: OpenAPIFile): TransformedPathsArray | any => {\n const paths: OpenAPIFile['paths'] = openApiJson.paths\n const transformedPaths = Object.entries(paths).map(([path, methods]) => ({\n path,\n methods: Object.entries(methods).map(([method, methodProps]) => {\n const obj: any = {\n ...methodProps,\n type: method,\n tags: methodProps.tags || [],\n summary: methodProps.summary || '',\n responses: Object.entries(methodProps.responses).map(([code, codeProps]) => {\n const contentType = Object.keys(codeProps.content || {})[0]\n let headers = codeProps?.headers ?? {}\n\n // ? Fix headers with items property\n Object.keys(headers).map((header: string) => {\n let headerObj = headers[header]\n if (\n headerObj?.schema &&\n headerObj?.schema?.type &&\n headerObj?.schema?.type != 'array'\n ) {\n delete headers[header]?.schema?.items\n }\n })\n\n let schema = codeProps.content?.[contentType]?.schema\n if (schema?.$ref) {\n schema = resolveRef(schema?.$ref, openApiJson)\n } else if (schema?.type == 'array' && schema?.items?.$ref) {\n const resolvedItemSchema = resolveRef(schema.items.$ref, openApiJson)\n schema = {\n ...schema,\n items: resolvedItemSchema,\n }\n }\n\n return {\n code,\n headers,\n content: {\n contentType,\n schema: {\n ...schema,\n properties: JSON.stringify(schema?.properties || schema?.items?.properties),\n },\n },\n }\n }),\n }\n\n if (!obj.responses.find((item) => item.code == '200')) {\n obj.responses.push({\n code: '200',\n content: {\n contentType: 'application/json',\n schema: {},\n },\n headers: {},\n })\n }\n // Add parameters if it does not exist in the original JSON\n if (!methodProps?.parameters) {\n obj.parameters = []\n }\n\n // load response headers parameters\n\n if (method.toLowerCase() != 'get') {\n const contentType = Object.keys(methodProps?.requestBody?.content || {})[0]\n let reqSchema = methodProps?.requestBody?.content?.[contentType]?.schema\n\n if (reqSchema?.$ref) {\n reqSchema = resolveRef(reqSchema.$ref, openApiJson)\n } else if (reqSchema?.type === 'array' && reqSchema.items?.$ref) {\n reqSchema = {\n ...reqSchema,\n items: resolveRef(reqSchema.items.$ref, openApiJson),\n }\n }\n\n const requestBodyData = reqSchema\n ? {\n content: {\n contentType,\n schema: {\n ...reqSchema,\n properties: JSON.stringify(reqSchema?.properties || reqSchema?.items?.properties),\n },\n },\n }\n : {\n content: {\n contentType: 'application/json',\n schema: {\n properties: '{}',\n type: 'object',\n },\n },\n }\n\n obj['requestBody'] = requestBodyData\n }\n return obj\n }),\n }))\n\n return transformedPaths\n}\n\nconst validateBodyForResponse = (content, method) => {\n if (!(content?.schema as any) || !(content?.schema as any)?.properties) {\n return {}\n }\n let _content = JSON.parse((content?.schema as any)?.properties as string)\n\n return _content\n}\n\nexport const transformPathsArrayToOrigin = (paths: TransformedPathsArray): OpenAPIFile['paths'] => {\n return paths.reduce((acc, { path, methods }) => {\n acc[path] = methods.reduce(\n (methodAcc, { type, tags, responses, summary, requestBody, ...rest }) => {\n // Initialize the method object\n // ? Validate (rest) [parameters]\n let copiedRest = structuredClone(rest || {})\n if (copiedRest && copiedRest.parameters) {\n copiedRest.parameters.map((param) => {\n if (param && param?.schema?.items && param?.schema?.items?.type == 'array') {\n param.schema.items.items = {}\n }\n return param\n })\n }\n\n // Get the original responses from the rest object\n const originalResponses = rest.responses || {}\n\n methodAcc[type] = {\n ...copiedRest,\n tags,\n summary,\n responses: responses.reduce((respAcc, { code, content, headers }) => {\n // Skip if:\n // 1. This is a new code (not in original) AND\n // 2. Both headers and content are empty\n const isNewCode = !originalResponses[code]\n const hasHeaders = Object.keys(headers || {}).length > 0\n const hasContent =\n Object.keys(validateBodyForResponse(content || {}, type) || {}).length > 0\n\n if (isNewCode && !hasHeaders && !hasContent) {\n return respAcc\n }\n\n const formattedHeaders: Record<string, any> = {}\n if (headers) {\n for (const [key, value] of Object.entries(headers)) {\n formattedHeaders[key] = {\n description: value.description || '',\n required: value.required || false,\n schema: value.schema || {},\n }\n }\n }\n respAcc[code] = {\n description: 'Success', // Assuming this is static from the original data\n content: content.contentType\n ? {\n [content.contentType]: {\n schema: {\n ...(content.schema as object),\n properties: validateBodyForResponse(content, type),\n },\n },\n }\n : originalResponses[code]?.content || {},\n headers: formattedHeaders,\n }\n return respAcc\n }, {} as Record<string, any>),\n }\n\n const parsedRequestBodyProps =\n type !== 'get' ? JSON.parse(requestBody.content.schema.properties) : {}\n // Add requestBody for non-GET methods\n if (type !== 'get') {\n methodAcc[type].requestBody = {\n content: {\n [requestBody.content.contentType]: {\n schema: {\n ...requestBody.content.schema,\n properties: parsedRequestBodyProps,\n },\n },\n },\n }\n }\n\n return methodAcc\n },\n {} as Record<string, any>\n )\n\n return acc\n }, {} as OpenAPIFile['paths'])\n}\n"],"names":["resolveRef","ref","openApiJson","replace","split","reduce","obj","key","transformOpenApiObject","components","securitySchemes","authKey","_a","Object","keys","at","type","_d","_c","_b","assign","Public","scheme","tags","paths","transformPathsToArray","transformOpenApiObjectToOrigin","values","object","transformPathsArrayToOrigin","toLowerCase","in","entries","map","path","methods","method","methodProps","summary","responses","code","codeProps","contentType","content","headers","header","headerObj","schema","items","$ref","resolvedItemSchema","properties","JSON","stringify","_e","find","item","push","parameters","requestBody","reqSchema","requestBodyData","_f","validateBodyForResponse","parse","acc","methodAcc","rest","__rest","copiedRest","structuredClone","param","originalResponses","respAcc","isNewCode","hasHeaders","length","hasContent","formattedHeaders","value","description","required","parsedRequestBodyProps"],"mappings":"+DAIA,MAAMA,EAAa,CAACC,EAAaC,IACjBD,EAAIE,QAAQ,OAAQ,IAAIC,MAAM,KAC/BC,OAAO,CAACC,EAAKC,IAAQD,eAAAA,EAAMC,GAAML,GAGnCM,EAA0BN,gBACrC,GAAIA,EAAYO,YAAcP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MAAM8B,GAAaF,EAAkBhC,GAC/BmC,EAAa9D,OAAOC,KAAK8B,GAAW,IAAIgC,OAAS,EACjDC,EACJhE,OAAOC,KAAKiD,EAAwBpB,GAAW,CAAQ,IAAK,CAAE,GAAEiC,OAAS,EAE3E,GAAIF,IAAcC,IAAeE,EAC/B,OAAOJ,EAGT,MAAMK,EAAwC,CAAA,EAC9C,GAAIlC,EACF,IAAK,MAAOrC,EAAKwE,KAAUlE,OAAOmB,QAAQY,GACxCkC,EAAiBvE,GAAO,CACtByE,YAAaD,EAAMC,aAAe,GAClCC,SAAUF,EAAME,WAAY,EAC5BlC,OAAQgC,EAAMhC,QAAU,CAAE,GAkBhC,OAdA0B,EAAQjC,GAAQ,CACdwC,YAAa,UACbrC,QAASA,EAAQD,YACb,CACE,CAACC,EAAQD,aAAc,CACrBK,OACMlC,OAAAO,OAAAP,OAAAO,OAAA,CAAA,EAAAuB,EAAQI,QACZ,CAAAI,WAAYY,EAAwBpB,QAInB,QAAvB/B,EAAA4D,EAAkBhC,UAAK,IAAA5B,OAAA,EAAAA,EAAE+B,UAAW,CAAE,EAC1CC,QAASkC,GAEJL,GACN,CAAA,KAGL,MAAMS,EACK,QAATlE,EAAiBoC,KAAKY,MAAML,EAAYhB,QAAQI,OAAOI,YAAc,CAAA,EAevE,MAba,QAATnC,IACFkD,EAAUlD,GAAM2C,YAAc,CAC5BhB,QAAS,CACP,CAACgB,EAAYhB,QAAQD,aAAc,CACjCK,OAAMlC,OAAAO,OAAAP,OAAAO,OAAA,CAAA,EACDuC,EAAYhB,QAAQI,QACvB,CAAAI,WAAY+B,QAOfhB,GAET,CAAyB,GAGpBD,GACN,CAA0B"}
1
+ {"version":3,"file":"layout.helper.js","sources":["../../../src/helpers/layout.helper.ts"],"sourcesContent":["import { TransformedPathsArray } from '@entities/layout.type'\nimport { OpenAPIFile, SecurityScheme } from '@entities/openApi'\nimport { TransformedOpenApi } from '@entities/transformedOpenApi'\n\nconst resolveRef = (ref: string, openApiJson: OpenAPIFile): Object => {\n const parts = ref.replace(/^#\\//, '').split('/')\n return parts.reduce((obj, key) => obj?.[key], openApiJson)\n}\n\nexport const transformOpenApiObject = (openApiJson: OpenAPIFile): TransformedOpenApi => {\n if (openApiJson.components && openApiJson.components.securitySchemes) {\n const authKey = Object.keys(openApiJson.components.securitySchemes)?.at(0)\n if (authKey) {\n openApiJson.components.securitySchemes[authKey].type = openApiJson?.components\n ?.securitySchemes?.[authKey]?.type as SecurityScheme['type']\n }\n } else {\n openApiJson.components = {\n securitySchemes: {\n Public: {\n type: 'http',\n scheme: 'public',\n },\n },\n ...(openApiJson.components || {}),\n }\n }\n\n if (!openApiJson.tags) {\n openApiJson.tags = []\n }\n\n return {\n ...openApiJson,\n paths: transformPathsToArray(openApiJson),\n } as TransformedOpenApi\n}\n\nexport const transformOpenApiObjectToOrigin = (values: TransformedOpenApi): OpenAPIFile => {\n const object = {\n ...values,\n paths: transformPathsArrayToOrigin(values.paths),\n }\n if (object.components && object.components.securitySchemes) {\n const authKey = Object.keys(object.components.securitySchemes)?.at(0)\n if (authKey) {\n if (object.components.securitySchemes[authKey].type.toLowerCase() == 'APIKEY'.toLowerCase()) {\n object.components.securitySchemes[authKey].in = object.components.securitySchemes[authKey]\n .in as SecurityScheme['in']\n }\n object.components.securitySchemes[authKey].type = object?.components?.securitySchemes?.[\n authKey\n ]?.type as SecurityScheme['type']\n }\n }\n return object\n}\n\nexport const transformPathsToArray = (openApiJson: OpenAPIFile): TransformedPathsArray | any => {\n const paths: OpenAPIFile['paths'] = openApiJson.paths\n const transformedPaths = Object.entries(paths).map(([path, methods]) => ({\n path,\n methods: Object.entries(methods).map(([method, methodProps]) => {\n const obj: any = {\n ...methodProps,\n type: method,\n tags: methodProps.tags || [],\n summary: methodProps.summary || '',\n responses: Object.entries(methodProps.responses).map(([code, codeProps]) => {\n const contentType = Object.keys(codeProps.content || {})[0]\n let headers = codeProps?.headers ?? {}\n\n // ? Fix headers with items property\n Object.keys(headers).map((header: string) => {\n let headerObj = headers[header]\n if (\n headerObj?.schema &&\n headerObj?.schema?.type &&\n headerObj?.schema?.type != 'array'\n ) {\n delete headers[header]?.schema?.items\n }\n })\n\n let schema = codeProps.content?.[contentType]?.schema\n if (schema?.$ref) {\n schema = resolveRef(schema?.$ref, openApiJson)\n } else if (schema?.type == 'array' && schema?.items?.$ref) {\n const resolvedItemSchema = resolveRef(schema.items.$ref, openApiJson)\n schema = {\n ...schema,\n items: resolvedItemSchema,\n }\n }\n // if the response content is not an array remove the (items) property\n if (schema?.type !== 'array') {\n const { items, ...schemaRest } = schema\n\n schema = schemaRest\n }\n\n return {\n code,\n headers,\n content: {\n contentType,\n schema: {\n ...schema,\n properties: JSON.stringify(schema?.properties || schema?.items?.properties),\n },\n },\n }\n }),\n }\n\n if (!obj.responses.find((item) => item.code == '200')) {\n obj.responses.push({\n code: '200',\n content: {\n contentType: 'application/json',\n schema: {},\n },\n headers: {},\n })\n }\n // Add parameters if it does not exist in the original JSON\n if (!methodProps?.parameters) {\n obj.parameters = []\n } else {\n obj.parameters = obj.parameters.map((param) => {\n const { schema } = param\n if (schema && schema?.items && schema?.type?.toLowerCase() != 'array') {\n delete schema.items\n }\n\n return { ...param, schema }\n })\n }\n\n // load response headers parameters\n\n if (method.toLowerCase() != 'get') {\n const contentType = Object.keys(methodProps?.requestBody?.content || {})[0]\n let reqSchema = methodProps?.requestBody?.content?.[contentType]?.schema\n\n if (reqSchema?.$ref) {\n reqSchema = resolveRef(reqSchema.$ref, openApiJson)\n } else if (reqSchema?.type === 'array' && reqSchema.items?.$ref) {\n reqSchema = {\n ...reqSchema,\n items: resolveRef(reqSchema.items.$ref, openApiJson),\n }\n }\n\n const requestBodyData = reqSchema\n ? {\n content: {\n contentType,\n schema: {\n ...reqSchema,\n properties: JSON.stringify(reqSchema?.properties || reqSchema?.items?.properties),\n },\n },\n }\n : {\n content: {\n contentType: 'application/json',\n schema: {\n properties: '{}',\n type: 'object',\n },\n },\n }\n\n obj['requestBody'] = requestBodyData\n }\n return obj\n }),\n }))\n\n return transformedPaths\n}\n\nconst validateBodyForResponse = (content, method) => {\n if (!(content?.schema as any) || !(content?.schema as any)?.properties) {\n return {}\n }\n let _content = JSON.parse((content?.schema as any)?.properties as string)\n\n return _content\n}\n\nexport const transformPathsArrayToOrigin = (paths: TransformedPathsArray): OpenAPIFile['paths'] => {\n return paths.reduce((acc, { path, methods }) => {\n acc[path] = methods.reduce(\n (methodAcc, { type, tags, responses, summary, requestBody, ...rest }) => {\n // Initialize the method object\n // ? Validate (rest) [parameters]\n let copiedRest = structuredClone(rest || {})\n if (copiedRest && copiedRest.parameters) {\n copiedRest.parameters.map((param) => {\n if (param && param?.schema?.items && param?.schema?.items?.type == 'array') {\n param.schema.items.items = {}\n }\n return param\n })\n }\n\n // Get the original responses from the rest object\n const originalResponses = rest.responses || {}\n\n methodAcc[type] = {\n ...copiedRest,\n tags,\n summary,\n responses: responses.reduce((respAcc, { code, content, headers }) => {\n // Skip if:\n // 1. This is a new code (not in original) AND\n // 2. Both headers and content are empty\n const isNewCode = !originalResponses[code]\n const hasHeaders = Object.keys(headers || {}).length > 0\n const hasContent =\n Object.keys(validateBodyForResponse(content || {}, type) || {}).length > 0\n\n if (isNewCode && !hasHeaders && !hasContent) {\n return respAcc\n }\n\n const formattedHeaders: Record<string, any> = {}\n if (headers) {\n for (const [key, value] of Object.entries(headers)) {\n formattedHeaders[key] = {\n description: value.description || '',\n required: value.required || false,\n schema: value.schema || {},\n }\n }\n }\n respAcc[code] = {\n description: 'Success', // Assuming this is static from the original data\n content: content.contentType\n ? {\n [content.contentType]: {\n schema: {\n ...(content.schema as object),\n properties: validateBodyForResponse(content, type),\n },\n },\n }\n : originalResponses[code]?.content || {},\n headers: formattedHeaders,\n }\n return respAcc\n }, {} as Record<string, any>),\n }\n\n const parsedRequestBodyProps =\n type !== 'get' ? JSON.parse(requestBody.content.schema.properties) : {}\n // Add requestBody for non-GET methods\n if (type !== 'get') {\n methodAcc[type].requestBody = {\n content: {\n [requestBody.content.contentType]: {\n schema: {\n ...requestBody.content.schema,\n properties: parsedRequestBodyProps,\n },\n },\n },\n }\n }\n\n return methodAcc\n },\n {} as Record<string, any>\n )\n\n return acc\n }, {} as OpenAPIFile['paths'])\n}\n"],"names":["resolveRef","ref","openApiJson","replace","split","reduce","obj","key","transformOpenApiObject","components","securitySchemes","authKey","_a","Object","keys","at","type","_d","_c","_b","assign","Public","scheme","tags","paths","transformPathsToArray","transformOpenApiObjectToOrigin","values","object","transformPathsArrayToOrigin","toLowerCase","in","entries","map","path","methods","method","methodProps","summary","responses","code","codeProps","contentType","content","headers","header","headerObj","schema","items","$ref","resolvedItemSchema","__rest","properties","JSON","stringify","_e","find","item","push","parameters","param","requestBody","reqSchema","requestBodyData","_f","validateBodyForResponse","parse","acc","methodAcc","rest","copiedRest","structuredClone","originalResponses","respAcc","isNewCode","hasHeaders","length","hasContent","formattedHeaders","value","description","required","parsedRequestBodyProps"],"mappings":"+DAIA,MAAMA,EAAa,CAACC,EAAaC,IACjBD,EAAIE,QAAQ,OAAQ,IAAIC,MAAM,KAC/BC,OAAO,CAACC,EAAKC,IAAQD,eAAAA,EAAMC,GAAML,GAGnCM,EAA0BN,gBACrC,GAAIA,EAAYO,YAAcP,EAAYO,WAAWC,gBAAiB,CACpE,MAAMC,EAA6D,QAAnDC,EAAAC,OAAOC,KAAKZ,EAAYO,WAAWC,wBAAgB,IAAAE,OAAA,EAAAA,EAAEG,GAAG,GACpEJ,IACFT,EAAYO,WAAWC,gBAAgBC,GAASK,KAChB,QADuBC,EACpC,QADoCC,EAAuB,QAAvBC,EAAAjB,aAAW,EAAXA,EAAaO,kBAAU,IAAAU,OAAA,EAAAA,EAC1ET,uBAAe,IAAAQ,OAAA,EAAAA,EAAGP,UAAU,IAAAM,OAAA,EAAAA,EAAAD,KAEnC,MACCd,EAAYO,WACVI,OAAAO,OAAA,CAAAV,gBAAiB,CACfW,OAAQ,CACNL,KAAM,OACNM,OAAQ,YAGRpB,EAA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ACjDC,EACJhE,OAAOC,KAAKmD,EAAwBtB,GAAW,CAAQ,IAAK,CAAE,GAAEiC,OAAS,EAE3E,GAAIF,IAAcC,IAAeE,EAC/B,OAAOJ,EAGT,MAAMK,EAAwC,CAAA,EAC9C,GAAIlC,EACF,IAAK,MAAOrC,EAAKwE,KAAUlE,OAAOmB,QAAQY,GACxCkC,EAAiBvE,GAAO,CACtByE,YAAaD,EAAMC,aAAe,GAClCC,SAAUF,EAAME,WAAY,EAC5BlC,OAAQgC,EAAMhC,QAAU,CAAE,GAkBhC,OAdA0B,EAAQjC,GAAQ,CACdwC,YAAa,UACbrC,QAASA,EAAQD,YACb,CACE,CAACC,EAAQD,aAAc,CACrBK,OACMlC,OAAAO,OAAAP,OAAAO,OAAA,CAAA,EAAAuB,EAAQI,QACZ,CAAAK,WAAYa,EAAwBtB,QAInB,QAAvB/B,EAAA4D,EAAkBhC,UAAK,IAAA5B,OAAA,EAAAA,EAAE+B,UAAW,CAAE,EAC1CC,QAASkC,GAEJL,GACN,CAAA,KAGL,MAAMS,EACK,QAATlE,EAAiBqC,KAAKa,MAAML,EAAYlB,QAAQI,OAAOK,YAAc,CAAA,EAevE,MAba,QAATpC,IACFoD,EAAUpD,GAAM6C,YAAc,CAC5BlB,QAAS,CACP,CAACkB,EAAYlB,QAAQD,aAAc,CACjCK,OAAMlC,OAAAO,OAAAP,OAAAO,OAAA,CAAA,EACDyC,EAAYlB,QAAQI,QACvB,CAAAK,WAAY8B,QAOfd,GAET,CAAyB,GAGpBD,GACN,CAA0B"}
package/dist/styles.css CHANGED
@@ -606,6 +606,147 @@
606
606
  z-index: 2;
607
607
  top: -0.45rem;
608
608
  transform-origin: center !important;
609
+ }#common-dialog.dialog-content-wrapper {
610
+ overflow: visible !important;
611
+ max-height: 100%;
612
+ width: 22.1875rem;
613
+ }
614
+ #common-dialog.dialog-content-wrapper .dialog-content-root {
615
+ overflow: visible !important;
616
+ border-radius: 0.625rem;
617
+ max-height: 100%;
618
+ }
619
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content {
620
+ padding: 0 1.875rem !important;
621
+ overflow: visible !important;
622
+ max-height: 100%;
623
+ }
624
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog {
625
+ position: relative;
626
+ }
627
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .close-icon {
628
+ position: absolute;
629
+ z-index: 1;
630
+ top: 1.5rem;
631
+ right: 0;
632
+ transform: translate(0.625rem, -0.625rem);
633
+ cursor: pointer;
634
+ }
635
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header {
636
+ display: flex;
637
+ padding-top: 0.5rem;
638
+ position: relative;
639
+ }
640
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon {
641
+ margin-top: 1rem;
642
+ margin-bottom: 1.5rem;
643
+ margin-inline: auto;
644
+ }
645
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info path {
646
+ stroke: #12131a;
647
+ }
648
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line {
649
+ stroke: #12131a;
650
+ }
651
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line + path {
652
+ fill: #12131a;
653
+ }
654
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning path {
655
+ stroke: #faad14;
656
+ }
657
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning line {
658
+ stroke: #faad14;
659
+ }
660
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error path {
661
+ stroke: #da3f3f;
662
+ }
663
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line {
664
+ stroke: #da3f3f;
665
+ }
666
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line + path {
667
+ fill: #da3f3f;
668
+ }
669
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title {
670
+ font-size: 1.5rem;
671
+ font-weight: 500;
672
+ line-height: 1.875rem;
673
+ text-align: center;
674
+ margin-bottom: 0.625rem;
675
+ }
676
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.error-title {
677
+ color: #da3f3f;
678
+ }
679
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.warning-title {
680
+ color: #faad14;
681
+ }
682
+ #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-footer {
683
+ display: flex;
684
+ gap: 1.25rem;
685
+ margin-top: 1.875rem;
686
+ }
687
+
688
+ .common-dialog {
689
+ position: relative;
690
+ }
691
+ .common-dialog .close-icon {
692
+ position: absolute !important;
693
+ z-index: 1 !important;
694
+ top: 0.75rem !important;
695
+ right: 0.4rem !important;
696
+ transform: translate(0.625rem, -0.625rem) !important;
697
+ cursor: pointer !important;
698
+ }
699
+ .common-dialog .confirmation-dialog-header {
700
+ display: flex;
701
+ padding-top: 0.5rem;
702
+ position: relative;
703
+ }
704
+ .common-dialog .confirmation-dialog-header .icon {
705
+ margin-top: 1rem;
706
+ margin-bottom: 1.5rem;
707
+ margin-inline: auto;
708
+ }
709
+ .common-dialog .confirmation-dialog-header .icon.info path {
710
+ stroke: #12131a;
711
+ }
712
+ .common-dialog .confirmation-dialog-header .icon.info line {
713
+ stroke: #12131a;
714
+ }
715
+ .common-dialog .confirmation-dialog-header .icon.info line + path {
716
+ fill: #12131a;
717
+ }
718
+ .common-dialog .confirmation-dialog-header .icon.warning path {
719
+ stroke: #faad14;
720
+ }
721
+ .common-dialog .confirmation-dialog-header .icon.warning line {
722
+ stroke: #faad14;
723
+ }
724
+ .common-dialog .confirmation-dialog-header .icon.error path {
725
+ stroke: #da3f3f;
726
+ }
727
+ .common-dialog .confirmation-dialog-header .icon.error line {
728
+ stroke: #da3f3f;
729
+ }
730
+ .common-dialog .confirmation-dialog-header .icon.error line + path {
731
+ fill: #da3f3f;
732
+ }
733
+ .common-dialog .confirmation-title {
734
+ font-size: 1.5rem;
735
+ font-weight: 500;
736
+ line-height: 1.875rem;
737
+ text-align: center;
738
+ margin-bottom: 0.625rem;
739
+ }
740
+ .common-dialog .confirmation-title.error-title {
741
+ color: #da3f3f;
742
+ }
743
+ .common-dialog .confirmation-title.warning-title {
744
+ color: #faad14;
745
+ }
746
+ .common-dialog .confirmation-dialog-footer {
747
+ display: flex;
748
+ gap: 1.25rem;
749
+ margin-top: 1.875rem;
609
750
  }.livePreviewContainer .titleContainer {
610
751
  margin-top: 1.875rem;
611
752
  display: flex;
@@ -776,111 +917,6 @@
776
917
  width: 0.625rem;
777
918
  aspect-ratio: 1/1;
778
919
  border-radius: 100%;
779
- }:root {
780
- --white: #fff;
781
- --Gray-5: #f1f2f6;
782
- --Gray-10: #ebecf2;
783
- --Gray-20: #d8dae5;
784
- --Gray-30: #babdcc;
785
- --Gray-40: #9a9eb2;
786
- --Gray-50: #828699;
787
- --Gray-60: #696c80;
788
- --Gray-100: #12131a;
789
- --black: #000;
790
- --primary-static: #4d75d8;
791
- --primary-hover: #7c9bea;
792
- --primary-active: #2c4fa4;
793
- --primary-disabled: #9a9eb2;
794
- --secondary-static: #40e0d0;
795
- --secondary-hover: #9efcf2;
796
- --secondary-active: #2fa599;
797
- --error-static: #da3f3f;
798
- --error-hover: #e75d5d;
799
- --error-active: #bb3232;
800
- --success-static: #3aaa35;
801
- --success-hover: #5cda56;
802
- --success-active: #2a8a25;
803
- --info-static: #c6c6c6;
804
- --info-hover: #e4e4e4;
805
- --info-active: #979797;
806
- --warning-static: #faad14;
807
- --warning-hover: #f9be4a;
808
- --warning-active: #db9711;
809
- --action-static: #142452;
810
- --action-hover: #21387d;
811
- --action-active: #000000;
812
- --color-info-primary: #3a6cd1;
813
- --primary-font-color: #142452;
814
- --placeholder-font-color: #babdcc;
815
- --warning-font-color: #ce2828;
816
- --alert-error: #da3f3f;
817
- --alert-light-error: #f4c5c5;
818
- --alert-success: #3aaa35;
819
- --alert-light-success: #c4e5c2;
820
- --alert-info: #8eaaf1;
821
- --alert-light-info: #c4d3f1;
822
- --alert-warning: #faad14;
823
- --alert-light-warning: #fde6b8;
824
- --border-focus: #3a6cd1;
825
- --tooltip-background-color: #202f5b;
826
- --text-color-primary: #142452;
827
- --text-color-secondary: #ffff;
828
- --text-color-neutral: #828699;
829
- --text-color-tertiary: #808080;
830
- --text-color-note: #242424;
831
- --text-color-quaternary: #142452;
832
- --text-color-disabled: #ffff;
833
- --background-color-white-primary: #fff;
834
- --background-color-light-primary: #8eaaf1;
835
- --background-color-white-secondary: #fff;
836
- --background-color-primary-dark: #142452;
837
- --background-color-gray-5: #f1f2f6;
838
- --background-color-gray-30: #ebecf2;
839
- --background-color-tertiary-light: #2c4fa4;
840
- --background-color-gray-10: #f1f2f6;
841
- --background-color-gray-40: #ebecf2;
842
- --background-color-light-blue: #dfe7f8;
843
- --border-color-primary: #babdcc;
844
- --border-color-secondary: #d8dae5;
845
- --border-color-neutral: #ebecf2;
846
- --border-color-tertiary: #ebecf2;
847
- --border-color-gray: #ebecf2;
848
- --border-color-hover: #142452;
849
- --border-color-active: #3a6cd1;
850
- --icon-color-main: #142452;
851
- --icon-color-secondary: #000;
852
- --icon-color-quaternary: #babdcc;
853
- --icon-color-disabled: #9a9eb2;
854
- --link-btn-primary-color: #3a6cd1;
855
- --button-color-static: #4d75d8;
856
- --button-color-hover: #7c9bea;
857
- --button-color-active: #2c4fa4;
858
- --alert-natural: #c4d3f1;
859
- }
860
-
861
- .drawerItemContainer {
862
- display: flex;
863
- flex-direction: column;
864
- }
865
- .drawerItemContainer .title {
866
- color: #000;
867
- font-weight: 600;
868
- font-size: 24px;
869
- line-height: 35px;
870
- margin-bottom: 3px;
871
- margin-top: 1.5rem;
872
- }
873
- .drawerItemContainer .text {
874
- color: #000;
875
- font-weight: 400;
876
- font-size: 24px;
877
- line-height: 25px;
878
- }
879
- .drawerItemContainer .color-green {
880
- color: var(--color-success);
881
- }
882
- .drawerItemContainer .color-red {
883
- color: var(--color-error);
884
920
  }.json-editor-container {
885
921
  overflow: hidden;
886
922
  border-bottom-right-radius: 0.3125rem;
@@ -937,202 +973,166 @@
937
973
  font-style: normal;
938
974
  font-weight: 600;
939
975
  line-height: 1.25rem;
940
- width: 8.75rem;
941
- padding: 0.625rem 2.25rem;
942
- background-color: rgba(240, 248, 255, 0);
943
- border-radius: 0.3125rem;
944
- border: 1px solid #babdcc;
945
- cursor: pointer;
946
- }
947
- .json-editor-container .json-editor .actions-container .beautify:disabled {
948
- color: #a2a5b6;
949
- border-color: #a2a5b6;
950
- }
951
- .json-editor-container .json-editor textarea {
952
- width: 100%;
953
- padding: 1.25rem;
954
- font-size: 0.875rem;
955
- font-style: normal;
956
- font-weight: 400;
957
- line-height: 1.25rem;
958
- color: white;
959
- height: 25rem;
960
- background-color: #142452;
961
- border: none;
962
- resize: none;
963
- }
964
- .json-editor-container .json-editor textarea:focus, .json-editor-container .json-editor textarea:focus-within, .json-editor-container .json-editor textarea:focus-visible .json-editor-container .json-editor textarea:active {
965
- outline: none;
966
- border: none;
967
- }
968
- .json-editor-container .json-editor textarea::-webkit-scrollbar {
969
- width: 0.5rem;
970
- }
971
- .json-editor-container .json-editor textarea::-webkit-scrollbar-track {
972
- background-color: #828699;
973
- border: none;
974
- border-color: transparent;
975
- border-top-left-radius: 0;
976
- }
977
- .json-editor-container .json-editor textarea::-webkit-scrollbar-thumb {
978
- background-color: #d8dae5;
979
- border: none;
980
- border-color: transparent;
981
- border-radius: 0;
982
- }
983
- .json-editor-container .json-editor.invalid {
984
- outline: 1px solid #ce2828 !important;
985
- }
986
- .json-editor-container .error-message {
987
- color: #ce2828;
988
- font-size: 0.75rem;
989
- line-height: 1.25rem;
990
- margin-top: 0.625rem;
991
- }
992
- .json-editor-container.disabled .json-editor textarea {
993
- background-color: white;
994
- color: #12131a;
995
- }#common-dialog.dialog-content-wrapper {
996
- overflow: visible !important;
997
- max-height: 100%;
998
- width: 22.1875rem;
999
- }
1000
- #common-dialog.dialog-content-wrapper .dialog-content-root {
1001
- overflow: visible !important;
1002
- border-radius: 0.625rem;
1003
- max-height: 100%;
1004
- }
1005
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content {
1006
- padding: 0 1.875rem !important;
1007
- overflow: visible !important;
1008
- max-height: 100%;
1009
- }
1010
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog {
1011
- position: relative;
1012
- }
1013
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .close-icon {
1014
- position: absolute;
1015
- z-index: 1;
1016
- top: 1.5rem;
1017
- right: 0;
1018
- transform: translate(0.625rem, -0.625rem);
1019
- cursor: pointer;
1020
- }
1021
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header {
1022
- display: flex;
1023
- padding-top: 0.5rem;
1024
- position: relative;
1025
- }
1026
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon {
1027
- margin-top: 1rem;
1028
- margin-bottom: 1.5rem;
1029
- margin-inline: auto;
1030
- }
1031
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info path {
1032
- stroke: #12131a;
1033
- }
1034
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line {
1035
- stroke: #12131a;
1036
- }
1037
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.info line + path {
1038
- fill: #12131a;
1039
- }
1040
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning path {
1041
- stroke: #faad14;
1042
- }
1043
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.warning line {
1044
- stroke: #faad14;
1045
- }
1046
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error path {
1047
- stroke: #da3f3f;
1048
- }
1049
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line {
1050
- stroke: #da3f3f;
1051
- }
1052
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-header .icon.error line + path {
1053
- fill: #da3f3f;
1054
- }
1055
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title {
1056
- font-size: 1.5rem;
1057
- font-weight: 500;
1058
- line-height: 1.875rem;
1059
- text-align: center;
1060
- margin-bottom: 0.625rem;
1061
- }
1062
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.error-title {
1063
- color: #da3f3f;
1064
- }
1065
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-title.warning-title {
1066
- color: #faad14;
1067
- }
1068
- #common-dialog.dialog-content-wrapper .dialog-content-root .dialog-content .common-dialog .confirmation-dialog-footer {
1069
- display: flex;
1070
- gap: 1.25rem;
1071
- margin-top: 1.875rem;
1072
- }
1073
-
1074
- .common-dialog {
1075
- position: relative;
1076
- }
1077
- .common-dialog .close-icon {
1078
- position: absolute !important;
1079
- z-index: 1 !important;
1080
- top: 0.75rem !important;
1081
- right: 0.4rem !important;
1082
- transform: translate(0.625rem, -0.625rem) !important;
1083
- cursor: pointer !important;
976
+ width: 8.75rem;
977
+ padding: 0.625rem 2.25rem;
978
+ background-color: rgba(240, 248, 255, 0);
979
+ border-radius: 0.3125rem;
980
+ border: 1px solid #babdcc;
981
+ cursor: pointer;
1084
982
  }
1085
- .common-dialog .confirmation-dialog-header {
1086
- display: flex;
1087
- padding-top: 0.5rem;
1088
- position: relative;
983
+ .json-editor-container .json-editor .actions-container .beautify:disabled {
984
+ color: #a2a5b6;
985
+ border-color: #a2a5b6;
1089
986
  }
1090
- .common-dialog .confirmation-dialog-header .icon {
1091
- margin-top: 1rem;
1092
- margin-bottom: 1.5rem;
1093
- margin-inline: auto;
987
+ .json-editor-container .json-editor textarea {
988
+ width: 100%;
989
+ padding: 1.25rem;
990
+ font-size: 0.875rem;
991
+ font-style: normal;
992
+ font-weight: 400;
993
+ line-height: 1.25rem;
994
+ color: white;
995
+ height: 25rem;
996
+ background-color: #142452;
997
+ border: none;
998
+ resize: none;
1094
999
  }
1095
- .common-dialog .confirmation-dialog-header .icon.info path {
1096
- stroke: #12131a;
1000
+ .json-editor-container .json-editor textarea:focus, .json-editor-container .json-editor textarea:focus-within, .json-editor-container .json-editor textarea:focus-visible .json-editor-container .json-editor textarea:active {
1001
+ outline: none;
1002
+ border: none;
1097
1003
  }
1098
- .common-dialog .confirmation-dialog-header .icon.info line {
1099
- stroke: #12131a;
1004
+ .json-editor-container .json-editor textarea::-webkit-scrollbar {
1005
+ width: 0.5rem;
1100
1006
  }
1101
- .common-dialog .confirmation-dialog-header .icon.info line + path {
1102
- fill: #12131a;
1007
+ .json-editor-container .json-editor textarea::-webkit-scrollbar-track {
1008
+ background-color: #828699;
1009
+ border: none;
1010
+ border-color: transparent;
1011
+ border-top-left-radius: 0;
1103
1012
  }
1104
- .common-dialog .confirmation-dialog-header .icon.warning path {
1105
- stroke: #faad14;
1013
+ .json-editor-container .json-editor textarea::-webkit-scrollbar-thumb {
1014
+ background-color: #d8dae5;
1015
+ border: none;
1016
+ border-color: transparent;
1017
+ border-radius: 0;
1106
1018
  }
1107
- .common-dialog .confirmation-dialog-header .icon.warning line {
1108
- stroke: #faad14;
1019
+ .json-editor-container .json-editor.invalid {
1020
+ outline: 1px solid #ce2828 !important;
1109
1021
  }
1110
- .common-dialog .confirmation-dialog-header .icon.error path {
1111
- stroke: #da3f3f;
1022
+ .json-editor-container .error-message {
1023
+ color: #ce2828;
1024
+ font-size: 0.75rem;
1025
+ line-height: 1.25rem;
1026
+ margin-top: 0.625rem;
1112
1027
  }
1113
- .common-dialog .confirmation-dialog-header .icon.error line {
1114
- stroke: #da3f3f;
1028
+ .json-editor-container.disabled .json-editor textarea {
1029
+ background-color: white;
1030
+ color: #12131a;
1031
+ }:root {
1032
+ --white: #fff;
1033
+ --Gray-5: #f1f2f6;
1034
+ --Gray-10: #ebecf2;
1035
+ --Gray-20: #d8dae5;
1036
+ --Gray-30: #babdcc;
1037
+ --Gray-40: #9a9eb2;
1038
+ --Gray-50: #828699;
1039
+ --Gray-60: #696c80;
1040
+ --Gray-100: #12131a;
1041
+ --black: #000;
1042
+ --primary-static: #4d75d8;
1043
+ --primary-hover: #7c9bea;
1044
+ --primary-active: #2c4fa4;
1045
+ --primary-disabled: #9a9eb2;
1046
+ --secondary-static: #40e0d0;
1047
+ --secondary-hover: #9efcf2;
1048
+ --secondary-active: #2fa599;
1049
+ --error-static: #da3f3f;
1050
+ --error-hover: #e75d5d;
1051
+ --error-active: #bb3232;
1052
+ --success-static: #3aaa35;
1053
+ --success-hover: #5cda56;
1054
+ --success-active: #2a8a25;
1055
+ --info-static: #c6c6c6;
1056
+ --info-hover: #e4e4e4;
1057
+ --info-active: #979797;
1058
+ --warning-static: #faad14;
1059
+ --warning-hover: #f9be4a;
1060
+ --warning-active: #db9711;
1061
+ --action-static: #142452;
1062
+ --action-hover: #21387d;
1063
+ --action-active: #000000;
1064
+ --color-info-primary: #3a6cd1;
1065
+ --primary-font-color: #142452;
1066
+ --placeholder-font-color: #babdcc;
1067
+ --warning-font-color: #ce2828;
1068
+ --alert-error: #da3f3f;
1069
+ --alert-light-error: #f4c5c5;
1070
+ --alert-success: #3aaa35;
1071
+ --alert-light-success: #c4e5c2;
1072
+ --alert-info: #8eaaf1;
1073
+ --alert-light-info: #c4d3f1;
1074
+ --alert-warning: #faad14;
1075
+ --alert-light-warning: #fde6b8;
1076
+ --border-focus: #3a6cd1;
1077
+ --tooltip-background-color: #202f5b;
1078
+ --text-color-primary: #142452;
1079
+ --text-color-secondary: #ffff;
1080
+ --text-color-neutral: #828699;
1081
+ --text-color-tertiary: #808080;
1082
+ --text-color-note: #242424;
1083
+ --text-color-quaternary: #142452;
1084
+ --text-color-disabled: #ffff;
1085
+ --background-color-white-primary: #fff;
1086
+ --background-color-light-primary: #8eaaf1;
1087
+ --background-color-white-secondary: #fff;
1088
+ --background-color-primary-dark: #142452;
1089
+ --background-color-gray-5: #f1f2f6;
1090
+ --background-color-gray-30: #ebecf2;
1091
+ --background-color-tertiary-light: #2c4fa4;
1092
+ --background-color-gray-10: #f1f2f6;
1093
+ --background-color-gray-40: #ebecf2;
1094
+ --background-color-light-blue: #dfe7f8;
1095
+ --border-color-primary: #babdcc;
1096
+ --border-color-secondary: #d8dae5;
1097
+ --border-color-neutral: #ebecf2;
1098
+ --border-color-tertiary: #ebecf2;
1099
+ --border-color-gray: #ebecf2;
1100
+ --border-color-hover: #142452;
1101
+ --border-color-active: #3a6cd1;
1102
+ --icon-color-main: #142452;
1103
+ --icon-color-secondary: #000;
1104
+ --icon-color-quaternary: #babdcc;
1105
+ --icon-color-disabled: #9a9eb2;
1106
+ --link-btn-primary-color: #3a6cd1;
1107
+ --button-color-static: #4d75d8;
1108
+ --button-color-hover: #7c9bea;
1109
+ --button-color-active: #2c4fa4;
1110
+ --alert-natural: #c4d3f1;
1115
1111
  }
1116
- .common-dialog .confirmation-dialog-header .icon.error line + path {
1117
- fill: #da3f3f;
1112
+
1113
+ .drawerItemContainer {
1114
+ display: flex;
1115
+ flex-direction: column;
1118
1116
  }
1119
- .common-dialog .confirmation-title {
1120
- font-size: 1.5rem;
1121
- font-weight: 500;
1122
- line-height: 1.875rem;
1123
- text-align: center;
1124
- margin-bottom: 0.625rem;
1117
+ .drawerItemContainer .title {
1118
+ color: #000;
1119
+ font-weight: 600;
1120
+ font-size: 24px;
1121
+ line-height: 35px;
1122
+ margin-bottom: 3px;
1123
+ margin-top: 1.5rem;
1125
1124
  }
1126
- .common-dialog .confirmation-title.error-title {
1127
- color: #da3f3f;
1125
+ .drawerItemContainer .text {
1126
+ color: #000;
1127
+ font-weight: 400;
1128
+ font-size: 24px;
1129
+ line-height: 25px;
1128
1130
  }
1129
- .common-dialog .confirmation-title.warning-title {
1130
- color: #faad14;
1131
+ .drawerItemContainer .color-green {
1132
+ color: var(--color-success);
1131
1133
  }
1132
- .common-dialog .confirmation-dialog-footer {
1133
- display: flex;
1134
- gap: 1.25rem;
1135
- margin-top: 1.875rem;
1134
+ .drawerItemContainer .color-red {
1135
+ color: var(--color-error);
1136
1136
  }:root {
1137
1137
  --white: #fff;
1138
1138
  --Gray-5: #f1f2f6;
@@ -1814,6 +1814,42 @@ div.endBtnIcon {
1814
1814
  }
1815
1815
  :global .guide-tooltip.guide-tooltip.guide-tooltip.guide-tooltip .tippy-arrow.tippy-arrow.tippy-arrow.tippy-arrow::before {
1816
1816
  color: #000;
1817
+ }.codebox {
1818
+ border-radius: 0.25rem;
1819
+ overflow: hidden;
1820
+ }
1821
+ .codebox_header {
1822
+ display: flex;
1823
+ align-items: center;
1824
+ gap: 0.25rem;
1825
+ padding-left: 0.5rem;
1826
+ height: 1.75rem;
1827
+ border: 1px solid #bbbec5;
1828
+ border-top-right-radius: 0.25rem;
1829
+ border-top-left-radius: 0.25rem;
1830
+ }
1831
+ .codebox_header_themeToggle {
1832
+ width: 0.75rem;
1833
+ min-width: 0.75rem;
1834
+ aspect-ratio: 1/1;
1835
+ border: 1px solid transparent;
1836
+ border-radius: 100%;
1837
+ cursor: pointer;
1838
+ }
1839
+ .codebox_header_themeToggle_dark {
1840
+ background-color: #455162;
1841
+ border-color: #6b7280;
1842
+ }
1843
+ .codebox_header_themeToggle_light {
1844
+ background-color: #edf1fb;
1845
+ border-color: #6b7280;
1846
+ }
1847
+ .codebox_header_copyIcon {
1848
+ cursor: pointer;
1849
+ }
1850
+ .codebox :global(.custom-code-line),
1851
+ .codebox :global(.custom-code-line span) {
1852
+ font-family: "Cascadia Code", sans-serif;
1817
1853
  }.apiDocsAside {
1818
1854
  width: 22.5rem;
1819
1855
  padding: 3rem 1.5rem;
@@ -1900,42 +1936,6 @@ div.endBtnIcon {
1900
1936
  }
1901
1937
  .apiDocsAside :global(.multiSelectGroup .selectDisplay .displayValueContainer .iconsContainer) {
1902
1938
  padding-right: 0.75rem !important;
1903
- }.codebox {
1904
- border-radius: 0.25rem;
1905
- overflow: hidden;
1906
- }
1907
- .codebox_header {
1908
- display: flex;
1909
- align-items: center;
1910
- gap: 0.25rem;
1911
- padding-left: 0.5rem;
1912
- height: 1.75rem;
1913
- border: 1px solid #bbbec5;
1914
- border-top-right-radius: 0.25rem;
1915
- border-top-left-radius: 0.25rem;
1916
- }
1917
- .codebox_header_themeToggle {
1918
- width: 0.75rem;
1919
- min-width: 0.75rem;
1920
- aspect-ratio: 1/1;
1921
- border: 1px solid transparent;
1922
- border-radius: 100%;
1923
- cursor: pointer;
1924
- }
1925
- .codebox_header_themeToggle_dark {
1926
- background-color: #455162;
1927
- border-color: #6b7280;
1928
- }
1929
- .codebox_header_themeToggle_light {
1930
- background-color: #edf1fb;
1931
- border-color: #6b7280;
1932
- }
1933
- .codebox_header_copyIcon {
1934
- cursor: pointer;
1935
- }
1936
- .codebox :global(.custom-code-line),
1937
- .codebox :global(.custom-code-line span) {
1938
- font-family: "Cascadia Code", sans-serif;
1939
1939
  }.api-details-page {
1940
1940
  padding: 2rem;
1941
1941
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -92,6 +92,12 @@ export const transformPathsToArray = (openApiJson: OpenAPIFile): TransformedPath
92
92
  items: resolvedItemSchema,
93
93
  }
94
94
  }
95
+ // if the response content is not an array remove the (items) property
96
+ if (schema?.type !== 'array') {
97
+ const { items, ...schemaRest } = schema
98
+
99
+ schema = schemaRest
100
+ }
95
101
 
96
102
  return {
97
103
  code,
@@ -120,6 +126,15 @@ export const transformPathsToArray = (openApiJson: OpenAPIFile): TransformedPath
120
126
  // Add parameters if it does not exist in the original JSON
121
127
  if (!methodProps?.parameters) {
122
128
  obj.parameters = []
129
+ } else {
130
+ obj.parameters = obj.parameters.map((param) => {
131
+ const { schema } = param
132
+ if (schema && schema?.items && schema?.type?.toLowerCase() != 'array') {
133
+ delete schema.items
134
+ }
135
+
136
+ return { ...param, schema }
137
+ })
123
138
  }
124
139
 
125
140
  // load response headers parameters
package/variables.txt CHANGED
@@ -1 +1 @@
1
- export APP_VERSION=1.1.0
1
+ export APP_VERSION=1.1.2