@swagger-api/apidom-error 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.apidomError=n():t.apidomError=n()}(self,(()=>(()=>{"use strict";var t={d:(n,r)=>{for(var e in r)t.o(r,e)&&!t.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:r[e]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{ApiDOMAggregateError:()=>zt,ApiDOMError:()=>_t,ApiDOMStructuredError:()=>Rt,NotImplementedError:()=>Lt,UnsupportedOperationError:()=>Ht});const r=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)};function e(t,n,e){return function(){if(0===arguments.length)return e();var o=arguments[arguments.length-1];if(!r(o)){for(var u=0;u<t.length;){if("function"==typeof o[t[u]])return o[t[u]].apply(o,Array.prototype.slice.call(arguments,0,-1));u+=1}if(function(t){return null!=t&&"function"==typeof t["@@transducer/step"]}(o))return n.apply(null,Array.prototype.slice.call(arguments,0,-1))(o)}return e.apply(this,arguments)}}const o=function(){return this.xf["@@transducer/init"]()},u=function(t){return this.xf["@@transducer/result"](t)};function c(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function a(t){return function n(r){return 0===arguments.length||c(r)?n:t.apply(this,arguments)}}function i(t){return function n(r,e){switch(arguments.length){case 0:return n;case 1:return c(r)?n:a((function(n){return t(r,n)}));default:return c(r)&&c(e)?n:c(r)?a((function(n){return t(n,e)})):c(e)?a((function(n){return t(r,n)})):t(r,e)}}}function s(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function f(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return!0;e+=1}return!1}function l(t,n){return Object.prototype.hasOwnProperty.call(n,t)}const p="function"==typeof Object.is?Object.is:function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n};var y=Object.prototype.toString;const h=function(){return"[object Arguments]"===y.call(arguments)?function(t){return"[object Arguments]"===y.call(t)}:function(t){return l("callee",t)}}();var g=!{toString:null}.propertyIsEnumerable("toString"),d=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],b=function(){return arguments.propertyIsEnumerable("length")}(),v=function(t,n){for(var r=0;r<t.length;){if(t[r]===n)return!0;r+=1}return!1};const m="function"!=typeof Object.keys||b?a((function(t){if(Object(t)!==t)return[];var n,r,e=[],o=b&&h(t);for(n in t)!l(n,t)||o&&"length"===n||(e[e.length]=n);if(g)for(r=d.length-1;r>=0;)l(n=d[r],t)&&!v(e,n)&&(e[e.length]=n),r-=1;return e})):a((function(t){return Object(t)!==t?[]:Object.keys(t)}));const j=a((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function O(t,n,r,e){var o=s(t);function u(t,n){return S(t,n,r.slice(),e.slice())}return!f((function(t,n){return!f(u,n,t)}),s(n),o)}function S(t,n,r,e){if(p(t,n))return!0;var o,u,c=j(t);if(c!==j(n))return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(c){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(o=t.constructor,null==(u=String(o).match(/^function (\w*)/))?"":u[1]))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!p(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!p(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var a=r.length-1;a>=0;){if(r[a]===t)return e[a]===n;a-=1}switch(c){case"Map":return t.size===n.size&&O(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size===n.size&&O(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=m(t);if(i.length!==m(n).length)return!1;var s=r.concat([t]),f=e.concat([n]);for(a=i.length-1;a>=0;){var y=i[a];if(!l(y,n)||!S(n[y],t[y],s,f))return!1;a-=1}return!0}const A=i((function(t,n){return S(t,n,[],[])}));function w(t,n){return function(t,n,r){var e,o;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;r<t.length;){if(0===(o=t[r])&&1/o===e)return r;r+=1}return-1}if(n!=n){for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;r<t.length;){if(A(t[r],n))return r;r+=1}return-1}(n,t,0)>=0}function E(t,n){for(var r=0,e=n.length,o=Array(e);r<e;)o[r]=t(n[r]),r+=1;return o}function x(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var k=function(t){return(t<10?"0":"")+t};const U="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+k(t.getUTCMonth()+1)+"-"+k(t.getUTCDate())+"T"+k(t.getUTCHours())+":"+k(t.getUTCMinutes())+":"+k(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function F(t,n,r){for(var e=0,o=r.length;e<o;)n=t(n,r[e]),e+=1;return n}var T=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=o,t.prototype["@@transducer/result"]=u,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},t}();function q(t){return function(n){return new T(t,n)}}const C=i(e(["fantasy-land/filter","filter"],q,(function(t,n){return r=n,"[object Object]"===Object.prototype.toString.call(r)?F((function(r,e){return t(n[e])&&(r[e]=n[e]),r}),{},m(n)):function(t,n){for(var r=0,e=n.length,o=[];r<e;)t(n[r])&&(o[o.length]=n[r]),r+=1;return o}(t,n);var r})));const I=i((function(t,n){return C((r=t,function(){return!r.apply(this,arguments)}),n);var r}));function N(t,n){var r=function(r){var e=n.concat([t]);return w(r,e)?"<Circular>":N(r,e)},e=function(t,n){return E((function(n){return x(n)+": "+r(t[n])}),n.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+E(r,t).join(", ")+"))";case"[object Array]":return"["+E(r,t).concat(e(t,I((function(t){return/^\d+$/.test(t)}),m(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):x(U(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":x(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var o=t.toString();if("[object Object]"!==o)return o}return"{"+e(t,m(t)).join(", ")+"}"}}const P=a((function(t){return N(t,[])}));const M=i((function(t,n){if(t===n)return n;function r(t,n){if(t>n!=n>t)return n>t?n:t}var e=r(t,n);if(void 0!==e)return e;var o=r(typeof t,typeof n);if(void 0!==o)return o===typeof t?t:n;var u=P(t),c=r(u,P(n));return void 0!==c&&c===u?t:n}));var D=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=o,t.prototype["@@transducer/result"]=u,t.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},t}();const B=function(t){return function(n){return new D(t,n)}};function $(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,o){return n.apply(this,arguments)};case 5:return function(t,r,e,o,u){return n.apply(this,arguments)};case 6:return function(t,r,e,o,u,c){return n.apply(this,arguments)};case 7:return function(t,r,e,o,u,c,a){return n.apply(this,arguments)};case 8:return function(t,r,e,o,u,c,a,i){return n.apply(this,arguments)};case 9:return function(t,r,e,o,u,c,a,i,s){return n.apply(this,arguments)};case 10:return function(t,r,e,o,u,c,a,i,s,f){return n.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function z(t,n,r){return function(){for(var e=[],o=0,u=t,a=0;a<n.length||o<arguments.length;){var i;a<n.length&&(!c(n[a])||o>=arguments.length)?i=n[a]:(i=arguments[o],o+=1),e[a]=i,c(i)||(u-=1),a+=1}return u<=0?r.apply(this,e):$(u,z(t,e,r))}}const G=i((function(t,n){return 1===t?a(n):$(t,z(t,[],n))}));const _=i(e(["fantasy-land/map","map"],B,(function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return G(n.length,(function(){return t.call(this,n.apply(this,arguments))}));case"[object Object]":return F((function(r,e){return r[e]=t(n[e]),r}),{},m(n));default:return E(t,n)}}))),R=Number.isInteger||function(t){return t<<0===t};function H(t){return"[object String]"===Object.prototype.toString.call(t)}const L=i((function(t,n){var r=t<0?n.length+t:t;return H(n)?n.charAt(r):n[r]}));const W=i((function(t,n){if(null!=n)return R(t)?L(t,n):n[t]}));const X=i((function(t,n){return _(W(t),n)}));function Y(t){return function n(r,e,o){switch(arguments.length){case 0:return n;case 1:return c(r)?n:i((function(n,e){return t(r,n,e)}));case 2:return c(r)&&c(e)?n:c(r)?i((function(n,r){return t(n,e,r)})):c(e)?i((function(n,e){return t(r,n,e)})):a((function(n){return t(r,e,n)}));default:return c(r)&&c(e)&&c(o)?n:c(r)&&c(e)?i((function(n,r){return t(n,r,o)})):c(r)&&c(o)?i((function(n,r){return t(n,e,r)})):c(e)&&c(o)?i((function(n,e){return t(r,n,e)})):c(r)?a((function(n){return t(n,e,o)})):c(e)?a((function(n){return t(r,n,o)})):c(o)?a((function(n){return t(r,e,n)})):t(r,e,o)}}}const Z=a((function(t){return!!r(t)||!!t&&("object"==typeof t&&(!H(t)&&(0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))}));var J="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function K(t,n,r){return function(e,o,u){if(Z(u))return t(e,o,u);if(null==u)return o;if("function"==typeof u["fantasy-land/reduce"])return n(e,o,u,"fantasy-land/reduce");if(null!=u[J])return r(e,o,u[J]());if("function"==typeof u.next)return r(e,o,u);if("function"==typeof u.reduce)return n(e,o,u,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Q(t,n,r){for(var e=0,o=r.length;e<o;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}const V=i((function(t,n){return $(t.length,(function(){return t.apply(n,arguments)}))}));function tt(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function nt(t,n,r,e){return t["@@transducer/result"](r[e](V(t["@@transducer/step"],t),n))}const rt=K(Q,nt,tt);var et=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},t}();const ot=Y((function(t,n,r){return rt("function"==typeof t?new et(t):t,n,r)}));const ut=a((function(t){return G(ot(M,0,X("length",t)),(function(){for(var n=0,r=t.length;n<r;){if(t[n].apply(this,arguments))return!0;n+=1}return!1}))}));function ct(t,n,r){for(var e=r.next();!e.done;)n=t(n,e.value),e=r.next();return n}function at(t,n,r,e){return r[e](t,n)}const it=K(F,at,ct);const st=i((function(t,n){return"function"==typeof n["fantasy-land/ap"]?n["fantasy-land/ap"](t):"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:it((function(t,r){return function(t,n){var r;n=n||[];var e=(t=t||[]).length,o=n.length,u=[];for(r=0;r<e;)u[u.length]=t[r],r+=1;for(r=0;r<o;)u[u.length]=n[r],r+=1;return u}(t,_(r,n))}),[],t)}));const ft=i((function(t,n){return t&&n}));const lt=i((function(t,n){var r=G(t,n);return G(t,(function(){return F(st,_(r,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));const pt=a((function(t){return lt(t.length,t)}));var yt=i((function(t,n){return function(t){var n=Object.prototype.toString.call(t);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n}(t)?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:pt(ft)(t,n)}));const ht=yt;const gt=pt(a((function(t){return!t})));function dt(t,n){return function(){return n.call(this,t.apply(this,arguments))}}function bt(t,n){return function(){var e=arguments.length;if(0===e)return n();var o=arguments[e-1];return r(o)||"function"!=typeof o[t]?n.apply(this,arguments):o[t].apply(o,Array.prototype.slice.call(arguments,0,e-1))}}const vt=a(bt("tail",Y(bt("slice",(function(t,n,r){return Array.prototype.slice.call(r,t,n)})))(1,1/0)));function mt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return $(arguments[0].length,ot(dt,arguments[0],vt(arguments)))}const jt=a((function(t){return null==t}));const Ot=i((function(t,n){return!jt(n)&&t in n}));var St=function(t,n){switch(arguments.length){case 0:return St;case 1:return function n(r){return 0===arguments.length?n:p(t,r)};default:return p(t,n)}};const At=St;"function"==typeof Object.assign&&Object.assign;const wt=i((function(t,n){return t.map((function(t){for(var r,e=n,o=0;o<t.length;){if(null==e)return;r=t[o],e=R(r)?L(r,e):e[r],o+=1}return e}))}));const Et=i((function(t,n){return wt([t],n)[0]}));const xt=i((function(t,n){for(var r={},e={},o=0,u=t.length;o<u;)e[t[o]]=1,o+=1;for(var c in n)e.hasOwnProperty(c)||(r[c]=n[c]);return r}));const kt=Y((function(t,n,r){return t(Et(n,r))}));var Ut="\t\n\v\f\r                 \u2028\u2029\ufeff";String.prototype.trim;const Ft=A(null);var Tt=gt(Ft);function qt(t){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(t)}const Ct=G(1,ht(Tt,(function(t){return"object"===qt(t)})));const It=G(1,mt(j,At("GeneratorFunction")));const Nt=G(1,mt(j,At("AsyncFunction")));const Pt=ut([mt(j,At("Function")),It,Nt]);var Mt=mt(j,At("Object")),Dt=kt(ht(Pt,mt(P,A(P(Object)))),["constructor"]);const Bt=G(1,(function(t){if(!Ct(t)||!Mt(t))return!1;var n=Object.getPrototypeOf(t);return!!Ft(n)||Dt(n)}));class $t extends AggregateError{constructor(t,n,r){if(super(t,n,r),this.name=this.constructor.name,"string"==typeof n&&(this.message=n),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(n).stack,Bt(r)&&Ot("cause",r)&&!Ot("cause",this)){const{cause:t}=r;this.cause=t,t instanceof Error&&Ot("stack",t)&&(this.stack=`${this.stack}\nCAUSE: ${t?.stack}`)}}}const zt=$t;class Gt extends Error{static[Symbol.hasInstance](t){return Function.prototype[Symbol.hasInstance].call(Gt,t)||Function.prototype[Symbol.hasInstance].call(zt,t)}constructor(t,n){if(super(t,n),this.name=this.constructor.name,"string"==typeof t&&(this.message=t),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack,Bt(n)&&Ot("cause",n)&&!Ot("cause",this)){const{cause:t}=n;this.cause=t,t instanceof Error&&Ot("stack",t)&&(this.stack=`${this.stack}\nCAUSE: ${t?.stack}`)}}}const _t=Gt;const Rt=class extends _t{constructor(t,n){super(t,n),void 0!==n&&Object.assign(this,xt(["cause"],n))}};const Ht=class extends _t{};const Lt=class extends Ht{};return n})()));
@@ -0,0 +1,32 @@
1
+ import { isPlainObject } from 'ramda-adjunct';
2
+ import { hasIn } from 'ramda';
3
+ class ApiDOMAggregateError extends AggregateError {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ constructor(errors, message, options) {
6
+ super(errors, message, options);
7
+ this.name = this.constructor.name;
8
+ if (typeof message === 'string') {
9
+ this.message = message;
10
+ }
11
+ if (typeof Error.captureStackTrace === 'function') {
12
+ Error.captureStackTrace(this, this.constructor);
13
+ } else {
14
+ this.stack = new Error(message).stack;
15
+ }
16
+
17
+ /**
18
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
19
+ * Node.js is >= 16.9.0 supports error causes natively.
20
+ */
21
+ if (isPlainObject(options) && hasIn('cause', options) && !hasIn('cause', this)) {
22
+ const {
23
+ cause
24
+ } = options;
25
+ this.cause = cause;
26
+ if (cause instanceof Error && hasIn('stack', cause)) {
27
+ this.stack = `${this.stack}\nCAUSE: ${cause === null || cause === void 0 ? void 0 : cause.stack}`;
28
+ }
29
+ }
30
+ }
31
+ }
32
+ export default ApiDOMAggregateError;
@@ -0,0 +1,36 @@
1
+ import { hasIn } from 'ramda';
2
+ import { isPlainObject } from 'ramda-adjunct';
3
+ import ApiDOMAggregateError from "./ApiDOMAggregateError.js";
4
+ class ApiDOMError extends Error {
5
+ static [Symbol.hasInstance](instance) {
6
+ // we want to ApiDOMAggregateError to act as if ApiDOMError was its superclass
7
+ return Function.prototype[Symbol.hasInstance].call(ApiDOMError, instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance);
8
+ }
9
+ constructor(message, options) {
10
+ super(message, options);
11
+ this.name = this.constructor.name;
12
+ if (typeof message === 'string') {
13
+ this.message = message;
14
+ }
15
+ if (typeof Error.captureStackTrace === 'function') {
16
+ Error.captureStackTrace(this, this.constructor);
17
+ } else {
18
+ this.stack = new Error(message).stack;
19
+ }
20
+
21
+ /**
22
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
23
+ * Node.js is >= 16.9.0 supports error causes natively.
24
+ */
25
+ if (isPlainObject(options) && hasIn('cause', options) && !hasIn('cause', this)) {
26
+ const {
27
+ cause
28
+ } = options;
29
+ this.cause = cause;
30
+ if (cause instanceof Error && hasIn('stack', cause)) {
31
+ this.stack = `${this.stack}\nCAUSE: ${cause === null || cause === void 0 ? void 0 : cause.stack}`;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ export default ApiDOMError;
@@ -0,0 +1,11 @@
1
+ import { omit } from 'ramda';
2
+ import ApiDOMError from "./ApiDOMError.js";
3
+ class ApiDOMStructuredError extends ApiDOMError {
4
+ constructor(message, structuredOptions) {
5
+ super(message, structuredOptions);
6
+ if (typeof structuredOptions !== 'undefined') {
7
+ Object.assign(this, omit(['cause'], structuredOptions));
8
+ }
9
+ }
10
+ }
11
+ export default ApiDOMStructuredError;
@@ -0,0 +1,3 @@
1
+ import UnsupportedOperationError from "./UnsupportedOperationError.js";
2
+ class NotImplementedError extends UnsupportedOperationError {}
3
+ export default NotImplementedError;
@@ -0,0 +1,3 @@
1
+ import ApiDOMError from "./ApiDOMError.js";
2
+ class UnsupportedOperationError extends ApiDOMError {}
3
+ export default UnsupportedOperationError;
package/es/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // base error classes
2
+ export { default as ApiDOMError } from "./ApiDOMError.js";
3
+ export { default as ApiDOMAggregateError } from "./ApiDOMAggregateError.js";
4
+ export { default as ApiDOMStructuredError } from "./ApiDOMStructuredError.js";
5
+ // generic custom error classes
6
+ export { default as UnsupportedOperationError } from "./UnsupportedOperationError.js";
7
+ export { default as NotImplementedError } from "./NotImplementedError.js";
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@swagger-api/apidom-error",
3
+ "version": "0.76.0",
4
+ "description": "Backward compatible custom ApiDOM errors with causes.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org"
8
+ },
9
+ "type": "module",
10
+ "sideEffects": false,
11
+ "unpkg": "./dist/apidom-error.browser.min.js",
12
+ "main": "./cjs/index.cjs",
13
+ "exports": {
14
+ "types": "./types/dist.d.ts",
15
+ "import": "./es/index.js",
16
+ "require": "./cjs/index.cjs"
17
+ },
18
+ "types": "./types/dist.d.ts",
19
+ "scripts": {
20
+ "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
21
+ "build:es": "cross-env BABEL_ENV=es babel src --out-dir es --extensions '.ts' --root-mode 'upward'",
22
+ "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir cjs --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
23
+ "build:umd:browser": "cross-env BABEL_ENV=browser BROWSERSLIST_ENV=production webpack --config config/webpack/browser.config.js --progress",
24
+ "lint": "eslint ./",
25
+ "lint:fix": "eslint ./ --fix",
26
+ "clean": "rimraf ./es ./cjs ./dist ./types",
27
+ "typescript:check-types": "tsc --noEmit",
28
+ "typescript:declaration": "copyfiles -u 1 'src/**/*.d.ts' ./types && tsc -p declaration.tsconfig.json && rollup -c config/rollup/types.dist.js",
29
+ "test": "cross-env NODE_ENV=test BABEL_ENV=cjs mocha",
30
+ "prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
31
+ "postpack": "rimraf NOTICE LICENSES"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/swagger-api/apidom.git"
36
+ },
37
+ "author": "Vladimír Gorej",
38
+ "license": "Apache-2.0",
39
+ "dependencies": {
40
+ "@babel/runtime-corejs3": "^7.20.7",
41
+ "@types/ramda": "~0.29.3",
42
+ "ramda": "~0.29.0",
43
+ "ramda-adjunct": "^4.0.0"
44
+ },
45
+ "files": [
46
+ "cjs/",
47
+ "dist/",
48
+ "es/",
49
+ "types/dist.d.ts",
50
+ "LICENSES",
51
+ "NOTICE",
52
+ "README.md",
53
+ "CHANGELOG.md"
54
+ ],
55
+ "gitHead": "ce497d1083df34162b9cf2047d6cbd8843af3314"
56
+ }
@@ -0,0 +1,25 @@
1
+ interface ApiDOMErrorOptions extends ErrorOptions {
2
+ readonly cause?: unknown;
3
+ readonly [key: string]: unknown;
4
+ }
5
+
6
+ declare class ApiDOMError extends Error {
7
+ static [Symbol.hasInstance](instance: unknown): boolean;
8
+ constructor(message?: string, options?: ApiDOMErrorOptions);
9
+ }
10
+
11
+ declare class ApiDOMAggregateError extends AggregateError {
12
+ constructor(errors: Iterable<any>, message?: string, options?: ApiDOMErrorOptions);
13
+ }
14
+
15
+ declare class ApiDOMStructuredError extends ApiDOMError {
16
+ constructor(message?: string, structuredOptions?: ApiDOMErrorOptions);
17
+ }
18
+
19
+ declare class UnsupportedOperationError extends ApiDOMError {
20
+ }
21
+
22
+ declare class NotImplementedError extends UnsupportedOperationError {
23
+ }
24
+
25
+ export { ApiDOMAggregateError, ApiDOMError, ApiDOMErrorOptions, ApiDOMStructuredError, NotImplementedError, UnsupportedOperationError };