rmapi-js 4.0.1 → 5.0.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -4
- package/dist/index.spec.d.ts +1 -0
- package/dist/index.spec.js +800 -0
- package/dist/rmapi-js.esm.min.js +1 -0
- package/dist/test-utils.d.ts +22 -0
- package/dist/test-utils.js +71 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -3
- package/dist/utils.spec.d.ts +1 -0
- package/dist/utils.spec.js +21 -0
- package/dist/validate.spec.d.ts +1 -0
- package/dist/validate.spec.js +15 -0
- package/package.json +17 -129
- package/CHANGELOG.md +0 -93
- package/bundle/rmapi-js.cjs.min.js +0 -12
- package/bundle/rmapi-js.esm.min.js +0 -12
- package/bundle/rmapi-js.iife.min.js +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var sJ=Object.create;var{defineProperty:a0,getPrototypeOf:tJ,getOwnPropertyNames:eJ}=Object;var J8=Object.prototype.hasOwnProperty;var s0=(J,Z,Q)=>{Q=J!=null?sJ(tJ(J)):{};const X=Z||!J||!J.__esModule?a0(Q,"default",{value:J,enumerable:!0}):Q;for(let U of eJ(J))if(!J8.call(X,U))a0(X,U,{get:()=>J[U],enumerable:!0});return X};var w=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var X1=w((kZ,Q1)=>{var k=function(J){throw{name:"SyntaxError",message:J,at:z0,text:j0}},D=function(J){if(J&&J!==G)k("Expected '"+J+"' instead of '"+G+"'");return G=j0.charAt(z0),z0+=1,G},J1=function(){var J,Z="";if(G==="-")Z="-",D("-");while(G>="0"&&G<="9")Z+=G,D();if(G==="."){Z+=".";while(D()&&G>="0"&&G<="9")Z+=G}if(G==="e"||G==="E"){if(Z+=G,D(),G==="-"||G==="+")Z+=G,D();while(G>="0"&&G<="9")Z+=G,D()}if(J=Number(Z),!isFinite(J))k("Bad number");return J},Z1=function(){var J,Z,Q="",X;if(G==='"')while(D())if(G==='"')return D(),Q;else if(G==="\\")if(D(),G==="u"){X=0;for(Z=0;Z<4;Z+=1){if(J=parseInt(D(),16),!isFinite(J))break;X=X*16+J}Q+=String.fromCharCode(X)}else if(typeof e0[G]==="string")Q+=e0[G];else break;else Q+=G;k("Bad string")},S=function(){while(G&&G<=" ")D()},U8=function(){switch(G){case"t":return D("t"),D("r"),D("u"),D("e"),!0;case"f":return D("f"),D("a"),D("l"),D("s"),D("e"),!1;case"n":return D("n"),D("u"),D("l"),D("l"),null;default:k("Unexpected '"+G+"'")}},Y8=function(){var J=[];if(G==="["){if(D("["),S(),G==="]")return D("]"),J;while(G){if(J.push(K0()),S(),G==="]")return D("]"),J;D(","),S()}}k("Bad array")},q8=function(){var J,Z={};if(G==="{"){if(D("{"),S(),G==="}")return D("}"),Z;while(G){if(J=Z1(),S(),D(":"),Object.prototype.hasOwnProperty.call(Z,J))k('Duplicate key "'+J+'"');if(Z[J]=K0(),S(),G==="}")return D("}"),Z;D(","),S()}}k("Bad object")},K0=function(){switch(S(),G){case"{":return q8();case"[":return Y8();case'"':return Z1();case"-":return J1();default:return G>="0"&&G<="9"?J1():U8()}},z0,G,e0={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},j0;Q1.exports=function(J,Z){var Q;if(j0=J,z0=0,G=" ",Q=K0(),S(),G)k("Syntax error");return typeof Z==="function"?function X(U,Y){var q,z,K=U[Y];if(K&&typeof K==="object"){for(q in K0)if(Object.prototype.hasOwnProperty.call(K,q))if(z=X(K,q),typeof z==="undefined")delete K[q];else K[q]=z}return Z.call(U,Y,K)}({"":Q},""):Q}});var Y1=w((vZ,U1)=>{var E0=function(J){return T0.lastIndex=0,T0.test(J)?'"'+J.replace(T0,function(Z){var Q=z8[Z];return typeof Q==="string"?Q:"\\u"+("0000"+Z.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+J+'"'},G0=function(J,Z){var Q,X,U,Y,q=I,z,K=Z[J];if(K&&typeof K==="object"&&typeof K.toJSON==="function")K=K.toJSON(J);if(typeof b==="function")K=b.call(Z,J,K);switch(typeof K){case"string":return E0(K);case"number":return isFinite(K)?String(K):"null";case"boolean":case"null":return String(K);case"object":if(!K)return"null";if(I+=W0,z=[],Object.prototype.toString.apply(K)==="[object Array]"){Y=K.length;for(Q=0;Q<Y;Q+=1)z[Q]=G0(Q,K)||"null";return U=z.length===0?"[]":I?"[\n"+I+z.join(",\n"+I)+"\n"+q+"]":"["+z.join(",")+"]",I=q,U}if(b&&typeof b==="object"){Y=b.length;for(Q=0;Q<Y;Q+=1)if(X=b[Q],typeof X==="string"){if(U=G0(X,K),U)z.push(E0(X)+(I?": ":":")+U)}}else for(X in K)if(Object.prototype.hasOwnProperty.call(K,X)){if(U=G0(X,K),U)z.push(E0(X)+(I?": ":":")+U)}return U=z.length===0?"{}":I?"{\n"+I+z.join(",\n"+I)+"\n"+q+"}":"{"+z.join(",")+"}",I=q,U;default:}},T0=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,I,W0,z8={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b;U1.exports=function(J,Z,Q){var X;if(I="",W0="",typeof Q==="number")for(X=0;X<Q;X+=1)W0+=" ";else if(typeof Q==="string")W0=Q;if(b=Z,Z&&typeof Z!=="function"&&(typeof Z!=="object"||typeof Z.length!=="number"))throw new Error("JSON.stringify");return G0("",{"":J})}});var q1=w((K8)=>{K8.parse=X1();K8.stringify=Y1()});var K1=w((yZ,z1)=>{var V8={}.toString;z1.exports=Array.isArray||function(J){return V8.call(J)=="[object Array]"}});var S0=w((bZ,G1)=>{var W1=Object.prototype.toString;G1.exports=function J(Z){var Q=W1.call(Z),X=Q==="[object Arguments]";if(!X)X=Q!=="[object Array]"&&Z!==null&&typeof Z==="object"&&typeof Z.length==="number"&&Z.length>=0&&W1.call(Z.callee)==="[object Function]";return X}});var O1=w((fZ,C1)=>{var A1;if(!Object.keys)e=Object.prototype.hasOwnProperty,x0=Object.prototype.toString,V1=S0(),k0=Object.prototype.propertyIsEnumerable,M1=!k0.call({toString:null},"toString"),w1=k0.call(function(){},"prototype"),J0=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],V0=function(J){var Z=J.constructor;return Z&&Z.prototype===J},D1={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},B1=function(){if(typeof window==="undefined")return!1;for(var J in window)try{if(!D1["$"+J]&&e.call(window,J)&&window[J]!==null&&typeof window[J]==="object")try{V0(window[J])}catch(Z){return!0}}catch(Z){return!0}return!1}(),F1=function(J){if(typeof window==="undefined"||!B1)return V0(J);try{return V0(J)}catch(Z){return!1}},A1=function J(Z){var Q=Z!==null&&typeof Z==="object",X=x0.call(Z)==="[object Function]",U=V1(Z),Y=Q&&x0.call(Z)==="[object String]",q=[];if(!Q&&!X&&!U)throw new TypeError("Object.keys called on a non-object");var z=w1&&X;if(Y&&Z.length>0&&!e.call(Z,0))for(var K=0;K<Z.length;++K)q.push(String(K));if(U&&Z.length>0)for(var V=0;V<Z.length;++V)q.push(String(V));else for(var B in Z)if(!(z&&B==="prototype")&&e.call(Z,B))q.push(String(B));if(M1){var F=F1(Z);for(var W=0;W<J0.length;++W)if(!(F&&J0[W]==="constructor")&&e.call(Z,J0[W]))q.push(J0[W])}return q};var e,x0,V1,k0,M1,w1,J0,V0,D1,B1,F1;C1.exports=A1});var L1=w((uZ,N1)=>{var M8=Array.prototype.slice,w8=S0(),_1=Object.keys,M0=_1?function J(Z){return _1(Z)}:O1(),R1=Object.keys;M0.shim=function J(){if(Object.keys){var Z=function(){var Q=Object.keys(arguments);return Q&&Q.length===arguments.length}(1,2);if(!Z)Object.keys=function Q(X){if(w8(X))return R1(M8.call(X));return R1(X)}}else Object.keys=M0;return Object.keys||M0};N1.exports=M0});var P1=w((lZ,H1)=>{var D8="Function.prototype.bind called on incompatible ",B8=Object.prototype.toString,F8=Math.max,A8="[object Function]",$1=function J(Z,Q){var X=[];for(var U=0;U<Z.length;U+=1)X[U]=Z[U];for(var Y=0;Y<Q.length;Y+=1)X[Y+Z.length]=Q[Y];return X},C8=function J(Z,Q){var X=[];for(var U=Q||0,Y=0;U<Z.length;U+=1,Y+=1)X[Y]=Z[U];return X},O8=function(J,Z){var Q="";for(var X=0;X<J.length;X+=1)if(Q+=J[X],X+1<J.length)Q+=Z;return Q};H1.exports=function J(Z){var Q=this;if(typeof Q!=="function"||B8.apply(Q)!==A8)throw new TypeError(D8+Q);var X=C8(arguments,1),U,Y=function(){if(this instanceof U){var B=Q.apply(this,$1(X,arguments));if(Object(B)===B)return B;return this}return Q.apply(Z,$1(X,arguments))},q=F8(0,Q.length-X.length),z=[];for(var K=0;K<q;K++)z[K]="$"+K;if(U=Function("binder","return function ("+O8(z,",")+"){ return binder.apply(this,arguments); }")(Y),Q.prototype){var V=function B(){};V.prototype=Q.prototype,U.prototype=new V,V.prototype=null}return U}});var w0=w((dZ,I1)=>{var _8=P1();I1.exports=Function.prototype.bind||_8});var T1=w((pZ,j1)=>{j1.exports=Error});var S1=w((mZ,E1)=>{E1.exports=EvalError});var k1=w((hZ,x1)=>{x1.exports=RangeError});var g1=w((cZ,v1)=>{v1.exports=ReferenceError});var v0=w((iZ,y1)=>{y1.exports=SyntaxError});var Z0=w((oZ,b1)=>{b1.exports=TypeError});var u1=w((rZ,f1)=>{f1.exports=URIError});var d1=w((nZ,l1)=>{l1.exports=function J(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var Z={},Q=Symbol("test"),X=Object(Q);if(typeof Q==="string")return!1;if(Object.prototype.toString.call(Q)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(X)!=="[object Symbol]")return!1;var U=42;Z[Q]=U;for(Q in Z)return!1;if(typeof Object.keys==="function"&&Object.keys(Z).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(Z).length!==0)return!1;var Y=Object.getOwnPropertySymbols(Z);if(Y.length!==1||Y[0]!==Q)return!1;if(!Object.prototype.propertyIsEnumerable.call(Z,Q))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var q=Object.getOwnPropertyDescriptor(Z,Q);if(q.value!==U||q.enumerable!==!0)return!1}return!0}});var h1=w((aZ,m1)=>{var p1=typeof Symbol!=="undefined"&&Symbol,R8=d1();m1.exports=function J(){if(typeof p1!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof p1("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return R8()}});var i1=w((sZ,c1)=>{var g0={__proto__:null,foo:{}},N8=Object;c1.exports=function J(){return{__proto__:g0}.foo===g0.foo&&!(g0 instanceof N8)}});var r1=w((tZ,o1)=>{var L8=Function.prototype.call,$8=Object.prototype.hasOwnProperty,H8=w0();o1.exports=H8.call(L8,$8)});var a=w((eZ,e1)=>{var M,P8=T1(),I8=S1(),j8=k1(),T8=g1(),n=v0(),r=Z0(),E8=u1(),t1=Function,y0=function(J){try{return t1('"use strict"; return ('+J+").constructor;")()}catch(Z){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(J){f=null}var b0=function(){throw new r},S8=f?function(){try{return arguments.callee,b0}catch(J){try{return f(arguments,"callee").get}catch(Z){return b0}}}():b0,i=h1()(),x8=i1()(),O=Object.getPrototypeOf||(x8?function(J){return J.__proto__}:null),o={},k8=typeof Uint8Array==="undefined"||!O?M:O(Uint8Array),u={__proto__:null,"%AggregateError%":typeof AggregateError==="undefined"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?M:ArrayBuffer,"%ArrayIteratorPrototype%":i&&O?O([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":o,"%AsyncGenerator%":o,"%AsyncGeneratorFunction%":o,"%AsyncIteratorPrototype%":o,"%Atomics%":typeof Atomics==="undefined"?M:Atomics,"%BigInt%":typeof BigInt==="undefined"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P8,"%eval%":eval,"%EvalError%":I8,"%Float32Array%":typeof Float32Array==="undefined"?M:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?M:FinalizationRegistry,"%Function%":t1,"%GeneratorFunction%":o,"%Int8Array%":typeof Int8Array==="undefined"?M:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?M:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":i&&O?O(O([][Symbol.iterator]())):M,"%JSON%":typeof JSON==="object"?JSON:M,"%Map%":typeof Map==="undefined"?M:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!i||!O?M:O((new Map())[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?M:Promise,"%Proxy%":typeof Proxy==="undefined"?M:Proxy,"%RangeError%":j8,"%ReferenceError%":T8,"%Reflect%":typeof Reflect==="undefined"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?M:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!i||!O?M:O((new Set())[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":i&&O?O(""[Symbol.iterator]()):M,"%Symbol%":i?Symbol:M,"%SyntaxError%":n,"%ThrowTypeError%":S8,"%TypedArray%":k8,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array==="undefined"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?M:Uint32Array,"%URIError%":E8,"%WeakMap%":typeof WeakMap==="undefined"?M:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?M:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?M:WeakSet};if(O)try{null.error}catch(J){n1=O(O(J)),u["%Error.prototype%"]=n1}var n1,v8=function J(Z){var Q;if(Z==="%AsyncFunction%")Q=y0("async function () {}");else if(Z==="%GeneratorFunction%")Q=y0("function* () {}");else if(Z==="%AsyncGeneratorFunction%")Q=y0("async function* () {}");else if(Z==="%AsyncGenerator%"){var X=J("%AsyncGeneratorFunction%");if(X)Q=X.prototype}else if(Z==="%AsyncIteratorPrototype%"){var U=J("%AsyncGenerator%");if(U&&O)Q=O(U.prototype)}return u[Z]=Q,Q},a1={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Q0=w0(),D0=r1(),g8=Q0.call(Function.call,Array.prototype.concat),y8=Q0.call(Function.apply,Array.prototype.splice),s1=Q0.call(Function.call,String.prototype.replace),B0=Q0.call(Function.call,String.prototype.slice),b8=Q0.call(Function.call,RegExp.prototype.exec),f8=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,u8=/\\(\\)?/g,l8=function J(Z){var Q=B0(Z,0,1),X=B0(Z,-1);if(Q==="%"&&X!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");else if(X==="%"&&Q!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var U=[];return s1(Z,f8,function(Y,q,z,K){U[U.length]=z?s1(K,u8,"$1"):q||Y}),U},d8=function J(Z,Q){var X=Z,U;if(D0(a1,X))U=a1[X],X="%"+U[0]+"%";if(D0(u,X)){var Y=u[X];if(Y===o)Y=v8(X);if(typeof Y==="undefined"&&!Q)throw new r("intrinsic "+Z+" exists, but is not available. Please file an issue!");return{alias:U,name:X,value:Y}}throw new n("intrinsic "+Z+" does not exist!")};e1.exports=function J(Z,Q){if(typeof Z!=="string"||Z.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Q!=="boolean")throw new r('"allowMissing" argument must be a boolean');if(b8(/^%?[^%]*%?$/,Z)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=l8(Z),U=X.length>0?X[0]:"",Y=d8("%"+U+"%",Q),q=Y.name,z=Y.value,K=!1,V=Y.alias;if(V)U=V[0],y8(X,g8([0,1],V));for(var B=1,F=!0;B<X.length;B+=1){var W=X[B],P=B0(W,0,1),C=B0(W,-1);if((P==='"'||P==="'"||P==="`"||(C==='"'||C==="'"||C==="`"))&&P!==C)throw new n("property names with quotes must have matching quotes");if(W==="constructor"||!F)K=!0;if(U+="."+W,q="%"+U+"%",D0(u,q))z=u[q];else if(z!=null){if(!(W in z)){if(!Q)throw new r("base intrinsic for "+Z+" exists, but the property is not available.");return}if(f&&B+1>=X.length){var R=f(z,W);if(F=!!R,F&&"get"in R&&!("originalValue"in R.get))z=R.get;else z=z[W]}else F=D0(z,W),z=z[W];if(F&&!K)u[q]=z}}return z}});var A0=w((JQ,JJ)=>{var p8=a(),F0=p8("%Object.defineProperty%",!0)||!1;if(F0)try{F0({},"a",{value:1})}catch(J){F0=!1}JJ.exports=F0});var f0=w((ZQ,ZJ)=>{var m8=a(),C0=m8("%Object.getOwnPropertyDescriptor%",!0);if(C0)try{C0([],"length")}catch(J){C0=null}ZJ.exports=C0});var YJ=w((QQ,UJ)=>{var QJ=A0(),h8=v0(),s=Z0(),XJ=f0();UJ.exports=function J(Z,Q,X){if(!Z||typeof Z!=="object"&&typeof Z!=="function")throw new s("`obj` must be an object or a function`");if(typeof Q!=="string"&&typeof Q!=="symbol")throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new s("`loose`, if provided, must be a boolean");var U=arguments.length>3?arguments[3]:null,Y=arguments.length>4?arguments[4]:null,q=arguments.length>5?arguments[5]:null,z=arguments.length>6?arguments[6]:!1,K=!!XJ&&XJ(Z,Q);if(QJ)QJ(Z,Q,{configurable:q===null&&K?K.configurable:!q,enumerable:U===null&&K?K.enumerable:!U,value:X,writable:Y===null&&K?K.writable:!Y});else if(z||!U&&!Y&&!q)Z[Q]=X;else throw new h8("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var KJ=w((XQ,zJ)=>{var u0=A0(),qJ=function J(){return!!u0};qJ.hasArrayLengthDefineBug=function J(){if(!u0)return null;try{return u0([],"length",{value:1}).length!==1}catch(Z){return!0}};zJ.exports=qJ});var wJ=w((UQ,MJ)=>{var c8=a(),WJ=YJ(),i8=KJ()(),GJ=f0(),VJ=Z0(),o8=c8("%Math.floor%");MJ.exports=function J(Z,Q){if(typeof Z!=="function")throw new VJ("`fn` is not a function");if(typeof Q!=="number"||Q<0||Q>4294967295||o8(Q)!==Q)throw new VJ("`length` must be a positive 32-bit integer");var X=arguments.length>2&&!!arguments[2],U=!0,Y=!0;if("length"in Z&&GJ){var q=GJ(Z,"length");if(q&&!q.configurable)U=!1;if(q&&!q.writable)Y=!1}if(U||Y||!X)if(i8)WJ(Z,"length",Q,!0,!0);else WJ(Z,"length",Q);return Z}});var d0=w((YQ,O0)=>{var l0=w0(),_0=a(),r8=wJ(),n8=Z0(),FJ=_0("%Function.prototype.apply%"),AJ=_0("%Function.prototype.call%"),CJ=_0("%Reflect.apply%",!0)||l0.call(AJ,FJ),DJ=A0(),a8=_0("%Math.max%");O0.exports=function J(Z){if(typeof Z!=="function")throw new n8("a function is required");var Q=CJ(l0,AJ,arguments);return r8(Q,1+a8(0,Z.length-(arguments.length-1)),!0)};var BJ=function J(){return CJ(l0,FJ,arguments)};if(DJ)DJ(O0.exports,"apply",{value:BJ});else O0.exports.apply=BJ});var NJ=w((qQ,RJ)=>{var OJ=a(),_J=d0(),s8=_J(OJ("String.prototype.indexOf"));RJ.exports=function J(Z,Q){var X=OJ(Z,!!Q);if(typeof X==="function"&&s8(Z,".prototype.")>-1)return _J(X);return X}});var IJ=w((zQ,PJ)=>{var R0=(typeof JSON!=="undefined"?JSON:q1()).stringify,t8=K1(),e8=L1(),JZ=d0(),HJ=NJ(),LJ=HJ("Array.prototype.join"),p0=HJ("Array.prototype.push"),$J=function J(Z,Q){var X="";for(var U=0;U<Z;U+=1)X+=Q;return X},ZZ=function(J,Z,Q){return Q};PJ.exports=function J(Z){var Q=arguments.length>1?arguments[1]:void 0,X=Q&&Q.space||"";if(typeof X==="number")X=$J(X," ");var U=!!Q&&typeof Q.cycles==="boolean"&&Q.cycles,Y=Q&&Q.replacer?JZ(Q.replacer):ZZ,q=typeof Q==="function"?Q:Q&&Q.cmp,z=q&&function(V){var B=q.length>2&&function F(W){return V[W]};return function(F,W){return q({key:F,value:V[F]},{key:W,value:V[W]},B?{__proto__:null,get:B}:void 0)}},K=[];return function V(B,F,W,P){var C=X?"\n"+$J(P,X):"",R=X?": ":":";if(W&&W.toJSON&&typeof W.toJSON==="function")W=W.toJSON();if(W=Y(B,F,W),W===void 0)return;if(typeof W!=="object"||W===null)return R0(W);if(t8(W)){var T=[];for(var j=0;j<W.length;j++){var x=V(W,j,W[j],P+1)||R0(null);p0(T,C+X+x)}return"["+LJ(T,",")+C+"]"}if(K.indexOf(W)!==-1){if(U)return R0("__cycle__");throw new TypeError("Converting circular structure to JSON")}else p0(K,W);var $=e8(W).sort(z&&z(W)),T=[];for(var j=0;j<$.length;j++){var F=$[j],q0=V(W,F,W[F],P+1);if(!q0)continue;var aJ=R0(F)+R+q0;p0(T,C+X+aJ)}return K.splice(K.indexOf(W),1),"{"+LJ(T,",")+C+"}"}({"":Z},"",Z,0)}});var o0=w((A)=>{var YZ=function(J){const{definitions:Z,nullable:Q,metadata:X}=J,U=SJ(J,["definitions","nullable","metadata"]);return Object.keys(U).length===0},xJ=function(J){return"ref"in J},qZ=function(J){return"type"in J},kJ=function(J){return"enum"in J},vJ=function(J){return"elements"in J},i0=function(J){return"properties"in J||"optionalProperties"in J},gJ=function(J){return"values"in J},yJ=function(J){return"discriminator"in J},l=function(J,Z){if(Z===void 0)Z=J;if(J.definitions!==void 0){if(Z!==J)return!1;for(let Q of Object.values(J.definitions))if(!l(Q,Z))return!1}if(xJ(J)){if(!(J.ref in(Z.definitions||{})))return!1}if(kJ(J)){if(J.enum.length===0)return!1;if(J.enum.length!==new Set(J.enum).size)return!1}if(vJ(J))return l(J.elements,Z);if(i0(J)){for(let Q of Object.values(J.properties||{}))if(!l(Q,Z))return!1;for(let Q of Object.values(J.optionalProperties||{}))if(!l(Q,Z))return!1;for(let Q of Object.keys(J.properties||{}))if(Q in(J.optionalProperties||{}))return!1}if(gJ(J))return l(J.values,Z);if(yJ(J))for(let Q of Object.values(J.mapping)){if(!l(Q,Z)||!i0(Q))return!1;if(Q.nullable)return!1;if(J.discriminator in(Q.properties||{}))return!1;if(J.discriminator in(Q.optionalProperties||{}))return!1}return!0},d=function(J){if(typeof J!=="object"||Array.isArray(J)||J===null)return!1;const Z=J,{definitions:Q=void 0,nullable:X=void 0,metadata:U=void 0,ref:Y=void 0,type:q=void 0,enum:z=void 0,elements:K=void 0,properties:V=void 0,optionalProperties:B=void 0,additionalProperties:F=void 0,values:W=void 0,discriminator:P=void 0,mapping:C=void 0}=Z,R=SJ(Z,["definitions","nullable","metadata","ref","type","enum","elements","properties","optionalProperties","additionalProperties","values","discriminator","mapping"]),j=[Y!==void 0,q!==void 0,z!==void 0,K!==void 0,V!==void 0,B!==void 0,F!==void 0,W!==void 0,P!==void 0,C!==void 0];let x=!1;for(let $ of zZ)x=x||$.every((T,q0)=>T===j[q0]);if(!x)return!1;if(Q!==void 0){if(typeof Q!=="object"||Array.isArray(Q)||Q===null)return!1;for(let $ of Object.values(Q))if(!d($))return!1}if(X!==void 0){if(typeof X!=="boolean")return!1}if(U!==void 0){if(typeof U!=="object"||Array.isArray(U)||U===null)return!1}if(Y!==void 0){if(typeof Y!=="string")return!1}if(q!==void 0){if(typeof q!=="string"||!KZ.includes(q))return!1}if(z!==void 0){if(!Array.isArray(z))return!1;if(!z.every(($)=>typeof $==="string"))return!1}if(K!==void 0){if(!d(K))return!1}if(V!==void 0){if(typeof V!=="object"||Array.isArray(V)||V===null)return!1;for(let $ of Object.values(V))if(!d($))return!1}if(B!==void 0){if(typeof B!=="object"||Array.isArray(B)||B===null)return!1;for(let $ of Object.values(B))if(!d($))return!1}if(F!==void 0){if(typeof F!=="boolean")return!1}if(W!==void 0){if(!d(W))return!1}if(P!==void 0){if(typeof P!=="string")return!1}if(C!==void 0){if(typeof C!=="object"||Array.isArray(C)||C===null)return!1;for(let $ of Object.values(C))if(!d($))return!1}if(Object.keys(R).length!==0)return!1;return!0},SJ=A&&A.__rest||function(J,Z){var Q={};for(var X in J)if(Object.prototype.hasOwnProperty.call(J,X)&&Z.indexOf(X)<0)Q[X]=J[X];if(J!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var U=0,X=Object.getOwnPropertySymbols(J);U<X.length;U++)if(Z.indexOf(X[U])<0&&Object.prototype.propertyIsEnumerable.call(J,X[U]))Q[X[U]]=J[X[U]]}return Q};Object.defineProperty(A,"__esModule",{value:!0});A.isSchema=A.isValidSchema=A.isDiscriminatorForm=A.isValuesForm=A.isPropertiesForm=A.isElementsForm=A.isEnumForm=A.isTypeForm=A.isRefForm=A.isEmptyForm=void 0;A.isEmptyForm=YZ;A.isRefForm=xJ;A.isTypeForm=qZ;A.isEnumForm=kJ;A.isElementsForm=vJ;A.isPropertiesForm=i0;A.isValuesForm=gJ;A.isDiscriminatorForm=yJ;A.isValidSchema=l;var zZ=[[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!0,!1,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!0,!1,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!0,!1,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!1,!1,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!0,!1,!1,!1,!1],[!1,!1,!1,!1,!0,!1,!0,!1,!1,!1],[!1,!1,!1,!1,!1,!0,!0,!1,!1,!1],[!1,!1,!1,!1,!0,!0,!0,!1,!1,!1],[!1,!1,!1,!1,!1,!1,!1,!0,!1,!1],[!1,!1,!1,!1,!1,!1,!1,!1,!0,!0]],KZ=["boolean","float32","float64","int8","uint8","int16","uint16","int32","uint32","string","timestamp"];A.isSchema=d});var fJ=w((bJ)=>{var GZ=function(J){const Z=J.match(WZ);if(Z===null)return!1;const Q=parseInt(Z[1],10),X=parseInt(Z[2],10),U=parseInt(Z[3],10),Y=parseInt(Z[4],10),q=parseInt(Z[5],10),z=parseInt(Z[6],10);if(X>12)return!1;if(U>VZ(Q,X))return!1;if(Y>23)return!1;if(q>59)return!1;if(z>60)return!1;return!0},VZ=function(J,Z){if(Z===2)return MZ(J)?29:28;return wZ[Z]},MZ=function(J){return J%4===0&&(J%100!==0||J%400===0)};Object.defineProperty(bJ,"__esModule",{value:!0});var WZ=/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(\.\d+)?([zZ]|((\+|-)(\d{2}):(\d{2})))$/;bJ.default=GZ;var wZ=[0,31,0,31,30,31,30,31,31,30,31,30,31]});var uJ=w((v)=>{var AZ=function(J,Z,Q){const X={errors:[],instanceTokens:[],schemaTokens:[[]],root:J,config:Q||{maxDepth:0,maxErrors:0}};try{c(X,J,Z)}catch(U){if(U instanceof n0);else throw U}return X.errors},c=function(J,Z,Q,X){if(Z.nullable&&Q===null)return;if(p.isRefForm(Z)){if(J.schemaTokens.length===J.config.maxDepth)throw new r0;J.schemaTokens.push(["definitions",Z.ref]),c(J,J.root.definitions[Z.ref],Q),J.schemaTokens.pop()}else if(p.isTypeForm(Z)){switch(N(J,"type"),Z.type){case"boolean":if(typeof Q!=="boolean")L(J);break;case"float32":case"float64":if(typeof Q!=="number")L(J);break;case"int8":t(J,Q,-128,127);break;case"uint8":t(J,Q,0,255);break;case"int16":t(J,Q,-32768,32767);break;case"uint16":t(J,Q,0,65535);break;case"int32":t(J,Q,-2147483648,2147483647);break;case"uint32":t(J,Q,0,4294967295);break;case"string":if(typeof Q!=="string")L(J);break;case"timestamp":if(typeof Q!=="string")L(J);else if(!FZ.default(Q))L(J);break}H(J)}else if(p.isEnumForm(Z)){if(N(J,"enum"),typeof Q!=="string"||!Z.enum.includes(Q))L(J);H(J)}else if(p.isElementsForm(Z)){if(N(J,"elements"),Array.isArray(Q))for(let[U,Y]of Q.entries())m(J,U.toString()),c(J,Z.elements,Y),h(J);else L(J);H(J)}else if(p.isPropertiesForm(Z))if(typeof Q==="object"&&Q!==null&&!Array.isArray(Q)){if(Z.properties!==void 0){N(J,"properties");for(let[U,Y]of Object.entries(Z.properties)){if(N(J,U),Q.hasOwnProperty(U))m(J,U),c(J,Y,Q[U]),h(J);else L(J);H(J)}H(J)}if(Z.optionalProperties!==void 0){N(J,"optionalProperties");for(let[U,Y]of Object.entries(Z.optionalProperties)){if(N(J,U),Q.hasOwnProperty(U))m(J,U),c(J,Y,Q[U]),h(J);H(J)}H(J)}if(Z.additionalProperties!==!0)for(let U of Object.keys(Q)){const Y=Z.properties&&U in Z.properties,q=Z.optionalProperties&&U in Z.optionalProperties;if(!Y&&!q&&U!==X)m(J,U),L(J),h(J)}}else{if(Z.properties!==void 0)N(J,"properties");else N(J,"optionalProperties");L(J),H(J)}else if(p.isValuesForm(Z)){if(N(J,"values"),typeof Q==="object"&&Q!==null&&!Array.isArray(Q))for(let[U,Y]of Object.entries(Q))m(J,U),c(J,Z.values,Y),h(J);else L(J);H(J)}else if(p.isDiscriminatorForm(Z))if(typeof Q==="object"&&Q!==null&&!Array.isArray(Q))if(Q.hasOwnProperty(Z.discriminator)){const U=Q[Z.discriminator];if(typeof U==="string")if(U in Z.mapping)N(J,"mapping"),N(J,U),c(J,Z.mapping[U],Q,Z.discriminator),H(J),H(J);else N(J,"mapping"),m(J,Z.discriminator),L(J),h(J),H(J);else N(J,"discriminator"),m(J,Z.discriminator),L(J),h(J),H(J)}else N(J,"discriminator"),L(J),H(J);else N(J,"discriminator"),L(J),H(J)},t=function(J,Z,Q,X){if(typeof Z!=="number"||!Number.isInteger(Z)||Z<Q||Z>X)L(J)},m=function(J,Z){J.instanceTokens.push(Z)},h=function(J){J.instanceTokens.pop()},N=function(J,Z){J.schemaTokens[J.schemaTokens.length-1].push(Z)},H=function(J){J.schemaTokens[J.schemaTokens.length-1].pop()},L=function(J){if(J.errors.push({instancePath:[...J.instanceTokens],schemaPath:[...J.schemaTokens[J.schemaTokens.length-1]]}),J.errors.length===J.config.maxErrors)throw new n0},BZ=v&&v.__importDefault||function(J){return J&&J.__esModule?J:{default:J}};Object.defineProperty(v,"__esModule",{value:!0});v.validate=v.MaxDepthExceededError=void 0;var FZ=BZ(fJ()),p=o0();class r0 extends Error{}v.MaxDepthExceededError=r0;class n0 extends Error{}v.validate=AZ});var dJ=w((g)=>{var CZ=g&&g.__createBinding||(Object.create?function(J,Z,Q,X){if(X===void 0)X=Q;Object.defineProperty(J,X,{enumerable:!0,get:function(){return Z[Q]}})}:function(J,Z,Q,X){if(X===void 0)X=Q;J[X]=Z[Q]}),lJ=g&&g.__exportStar||function(J,Z){for(var Q in J)if(Q!=="default"&&!Z.hasOwnProperty(Q))CZ(Z,J,Q)};Object.defineProperty(g,"__esModule",{value:!0});lJ(o0(),g);lJ(uJ(),g)});var Z8=function(J){return E[J>>18&63]+E[J>>12&63]+E[J>>6&63]+E[J&63]},Q8=function(J,Z,Q){var X,U=[];for(var Y=Z;Y<Q;Y+=3)X=(J[Y]<<16&16711680)+(J[Y+1]<<8&65280)+(J[Y+2]&255),U.push(Z8(X));return U.join("")},X8=function(J){var Z,Q=J.length,X=Q%3,U=[],Y=16383;for(var q=0,z=Q-X;q<z;q+=Y)U.push(Q8(J,q,q+Y>z?z:q+Y));if(X===1)Z=J[Q-1],U.push(E[Z>>2]+E[Z<<4&63]+"==");else if(X===2)Z=(J[Q-2]<<8)+J[Q-1],U.push(E[Z>>10]+E[Z>>4&63]+E[Z<<2&63]+"=");return U.join("")};var I0=X8;var E=[],P0=[];var H0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(y=0,t0=H0.length;y<t0;++y)E[y]=H0[y],P0[H0.charCodeAt(y)]=y;var y,t0;P0["-".charCodeAt(0)]=62;P0["_".charCodeAt(0)]=63;var iJ=s0(IJ(),1);var N0,QZ=new Uint8Array(16);function m0(){if(!N0){if(N0=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!N0)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return N0(QZ)}function jJ(J,Z=0){return _[J[Z+0]]+_[J[Z+1]]+_[J[Z+2]]+_[J[Z+3]]+"-"+_[J[Z+4]]+_[J[Z+5]]+"-"+_[J[Z+6]]+_[J[Z+7]]+"-"+_[J[Z+8]]+_[J[Z+9]]+"-"+_[J[Z+10]]+_[J[Z+11]]+_[J[Z+12]]+_[J[Z+13]]+_[J[Z+14]]+_[J[Z+15]]}var _=[];for(let J=0;J<256;++J)_.push((J+256).toString(16).slice(1));var XZ=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h0={randomUUID:XZ};var UZ=function(J,Z,Q){if(h0.randomUUID&&!Z&&!J)return h0.randomUUID();J=J||{};const X=J.random||(J.rng||m0)();if(X[6]=X[6]&15|64,X[8]=X[8]&63|128,Z){Q=Q||0;for(let U=0;U<16;++U)Z[Q+U]=X[U];return Z}return jJ(X)},X0=UZ;function c0(J){return[...J].map((Z)=>Z.toString(16).padStart(2,"0")).join("")}function TJ(J){return new Uint8Array((J.match(/../g)??[]).map((Z)=>parseInt(Z,16)))}function EJ(J){let Z=0;for(let U of J)Z+=U.length;const Q=new Uint8Array(Z);let X=0;for(let U of J)Q.set(U,X),X+=U.length;return Q}var pJ=s0(dJ(),1);function U0(J,Z,Q=!0){if((Q?pJ.validate(J,Z):[]).length)throw new Error(`couldn't validate schema: ${JSON.stringify(Z)} didn't match schema ${JSON.stringify(J)}`)}async function EQ(J,{deviceDesc:Z="browser-chrome",uuid:Q=X0(),authHost:X=oJ,fetch:U=globalThis.fetch}={}){if(J.length!==8)throw new Error(`code should be length 8, but was ${J.length}`);const Y=await U(`${X}/token/json/2/device/new`,{method:"POST",headers:{Authorization:"Bearer"},body:JSON.stringify({code:J,deviceDesc:Z,deviceID:Q})});if(!Y.ok)throw new Y0(Y.status,Y.statusText,"couldn't register api");else return await Y.text()}function TZ({hash:J,type:Z,documentId:Q,subfiles:X,size:U}){return`${J}:${Z}:${Q}:${X}:${U}\n`}function EZ(J){const[Z,Q,X,U,Y]=J.split(":");if(Z===void 0||Q===void 0||X===void 0||U===void 0||Y===void 0)throw new Error(`entries line didn't contain five fields: '${J}'`);if(Q==="80000000")return{hash:Z,type:Q,documentId:X,subfiles:parseInt(U),size:BigInt(Y)};else if(Q==="0")if(U!=="0")throw new Error(`file type entry had nonzero number of subfiles: ${U}`);else return{hash:Z,type:Q,documentId:X,subfiles:0,size:BigInt(Y)};else throw new Error(`entries line contained invalid type: ${Q}`)}async function SQ(J,{fetch:Z=globalThis.fetch,subtle:Q=globalThis.crypto?.subtle,authHost:X=oJ,syncHost:U=OZ,cacheLimitBytes:Y=1048576,initCache:q=[]}={}){if(!Q)throw new Error("subtle was missing, try specifying it manually");const z=await Z(`${X}/token/json/2/user/new`,{method:"POST",headers:{Authorization:`Bearer ${J}`}});if(!z.ok)throw new Error(`couldn't fetch auth token: ${z.statusText}`);const K=await z.text();return new nJ(K,Z,Q,U,Y,q)}var mJ="3",oJ="https://webapp-prod.cloud.remarkable.engineering",OZ="https://internal.cloud.remarkable.com",hJ="x-goog-generation",_Z="x-goog-if-generation-match",RZ="x-goog-content-length-range",jQ=["Ballpoint","Ballpointv2","Brush","Calligraphy","ClearPage","EraseSection","Eraser","Fineliner","Finelinerv2","Highlighter","Highlighterv2","Marker","Markerv2","Paintbrush","Paintbrushv2","Pencilv2","SharpPencil","SharpPencilv2","SolidPen","ZoomTool"],TQ=["Maison Neue","EB Garamond","Noto Sans","Noto Serif","Noto Mono","Noto Sans UI"],NZ={xs:0.7,sm:0.8,md:1,lg:1.2,xl:1.5,xx:2},LZ={sm:50,md:125,rr:180,lg:200},$Z={df:-1,md:100,lg:150,xl:200},HZ={properties:{docID:{type:"string"},hash:{type:"string"}}},PZ={properties:{relative_path:{type:"string"},url:{type:"string"},expires:{type:"timestamp"},method:{enum:["POST","GET","PUT","DELETE"]}},optionalProperties:{maxuploadsize_bytes:{type:"float64"}}},L0={visibleName:{type:"string"}},$0={lastModified:{type:"string"},version:{type:"int32"},pinned:{type:"boolean"},synced:{type:"boolean"},modified:{type:"boolean"},deleted:{type:"boolean"},metadatamodified:{type:"boolean"},parent:{type:"string"}},IZ={discriminator:"type",mapping:{CollectionType:{properties:L0,optionalProperties:$0,additionalProperties:!0},DocumentType:{properties:L0,optionalProperties:{...$0,lastOpened:{type:"string"},lastOpenedPage:{type:"int32"},createdTime:{type:"string"}},additionalProperties:!0}}},cJ={id:{type:"string"},hash:{type:"string"}},jZ={discriminator:"type",mapping:{CollectionType:{properties:{...L0,...cJ},optionalProperties:$0,additionalProperties:!0},DocumentType:{properties:{...L0,...cJ,fileType:{enum:["notebook","epub","pdf",""]}},optionalProperties:{...$0,lastOpened:{type:"string"},lastOpenedPage:{type:"int32"},createdTime:{type:"string"}},additionalProperties:!0}}};class Y0 extends Error{status;statusText;constructor(J,Z,Q){super(Q);this.status=J,this.statusText=Z}}class rJ extends Error{constructor(){super("Generation preconditions failed. This means the current state is out of date with the cloud and needs to be re-synced.")}}class nJ{#W;#z;#K;#Q;#X;#J=new Map;#Z=null;constructor(J,Z,Q,X,U,Y){this.#W=J,this.#z=Z,this.#K=Q,this.#Q=X,this.#X=U;for(let[q,z]of Y)this.#J.set(q,Promise.resolve(z))}async#U(J,{body:Z,method:Q="POST",headers:X={}}){const U=await this.#z(J,{method:Q,headers:{Authorization:`Bearer ${this.#W}`,...X},body:Z});if(!U.ok){const Y=await U.text();throw new Y0(U.status,U.statusText,`failed reMarkable request: ${Y}`)}else return U}async#Y({url:J,method:Z,maxuploadsize_bytes:Q},X,U={}){const Y=Q?{...U,[RZ]:`0,${Q}`}:U,q=await this.#z(J,{method:Z,body:X,headers:Y});if(!q.ok){const z=await q.text();throw new Y0(q.status,q.statusText,z)}else return q}async#q(J,Z,Q){const X=Z===void 0?"downloads":"uploads",U=Q&&Z!==null&&Z!==void 0?`{ "http_method": "PUT", "relative_path": "${J}", "root_schema": "${Q}", "generation": ${Z} }`:JSON.stringify({http_method:"GET",relative_path:J}),q=await(await this.#U(`${this.#Q}/sync/v2/signed-urls/${X}`,{body:U})).text(),z=JSON.parse(q);return U0(PZ,z),z}async getRootHash({cache:J=!0}={}){if(J)while(this.#Z)try{const[U,Y]=await this.#Z;return[U,Y]}catch{}const Z=(async()=>{try{const U=await this.#q("root"),Y=await this.#Y(U),q=Y.headers.get(hJ);if(!q)throw new Error("no generation header in root hash");else return[await Y.text(),BigInt(q)]}catch(U){throw this.#Z=null,U}})();this.#Z=Z;const[Q,X]=await Z;return[Q,X]}async putRootHash(J,Z){const Q=await this.#q("root",Z,J);let X;try{X=await this.#Y(Q,J,{[_Z]:`${Z}`})}catch(q){if(q instanceof Y0&&q.status===412)throw this.#Z=null,new rJ;else throw q}const U=X.headers.get(hJ);if(!U)throw new Error("no generation header in root hash");const Y=BigInt(U);return this.#Z=Promise.resolve([J,Y]),Y}async#G(J){let Z=this.#J.get(J);while(Z)try{const X=await Z;if(X)return X;else Z=void 0}catch{Z=this.#J.get(J)}const Q=(async()=>{const X=await this.#q(J);return await(await this.#Y(X)).arrayBuffer()})();return this.#J.set(J,Q.then((X)=>X.byteLength<this.#X?X:null,(X)=>{throw this.#J.delete(J),X})),await Q}async getBuffer(J){const Z=await this.#G(J);return Z.byteLength<this.#X?Z.slice(0):Z}async getText(J){const Z=await this.#G(J);return(new TextDecoder()).decode(Z)}async getJson(J){const Z=await this.getText(J);return JSON.parse(Z)}async getMetadata(J,{verify:Z=!0}={}){const Q=await this.getJson(J);return U0(IZ,Q,Z),Q}async getEntries(J){if(J===void 0){const[U]=await this.getRootHash({cache:!0});J=U}const Z=await this.getText(J),[Q,...X]=Z.slice(0,-1).split("\n");if(Q!==mJ)throw new Error(`got unexpected schema version: ${Q}`);return X.map(EZ)}async#V(J,Z){const Q=this.#J.get(J);if(Q)try{await Q;return}catch{}const X=(async()=>{try{const U=await this.#q(J,null);return await this.#Y(U,Z),Z.byteLength<this.#X?Z:null}catch(U){throw this.#J.delete(J),U}})();this.#J.set(J,X),await X}async putEntries(J,Z){const Q=new TextEncoder;Z.sort((V,B)=>V.documentId.localeCompare(B.documentId));const X=EJ(Z.map((V)=>TJ(V.hash))),U=await this.#K.digest("SHA-256",X),Y=c0(new Uint8Array(U)),q=Z.map(TZ).join(""),z=`${mJ}\n${q}`,K=Q.encode(z).buffer;return await this.#V(Y,K),{hash:Y,type:"80000000",documentId:J,subfiles:Z.length,size:0n}}async putBuffer(J,Z){const Q=await this.#K.digest("SHA-256",Z),X=c0(new Uint8Array(Q));return await this.#V(X,Z),{hash:X,type:"0",documentId:J,subfiles:0,size:BigInt(Z.byteLength)}}async putText(J,Z){const X=(new TextEncoder()).encode(Z).buffer;return await this.putBuffer(J,X)}async putJson(J,Z){return await this.putText(J,iJ.default(Z))}async putMetadata(J,Z){return await this.putJson(`${J}.metadata`,Z)}async putCollection(J,Z=""){const Q=X0(),X=`${(new Date()).valueOf()}`,U=[],Y={type:"CollectionType",visibleName:J,version:0,parent:Z,synced:!0,lastModified:X};U.push(this.putMetadata(Q,Y)),U.push(this.putText(`${Q}.content`,"{}"));const q=await Promise.all(U);return await this.putEntries(Q,q)}async#M(J,Z,Q,X,U){if(U.fileType!==Q)throw new Error(`internal error: fileTypes don't match: ${Q}, ${U.fileType}`);const Y=X0(),q=`${(new Date()).valueOf()}`,z=[];z.push(this.putBuffer(`${Y}.${Q}`,Z));const K={type:"DocumentType",visibleName:J,version:0,parent:X,synced:!0,lastModified:q};z.push(this.putMetadata(Y,K)),z.push(this.putText(`${Y}.content`,JSON.stringify(U)));const V=await Promise.all(z);return await this.putEntries(Y,V)}async putEpub(J,Z,{parent:Q="",margins:X=125,orientation:U,textAlignment:Y,textScale:q=1,lineHeight:z=-1,fontName:K="",cover:V="visited",lastTool:B}={}){const F={dummyDocument:!1,extraMetadata:{LastTool:B},fileType:"epub",pageCount:0,lastOpenedPage:0,lineHeight:typeof z==="string"?$Z[z]:z,margins:typeof X==="string"?LZ[X]:X,textScale:typeof q==="string"?NZ[q]:q,pages:[],coverPageNumber:V==="first"?0:-1,formatVersion:1,orientation:U,textAlignment:Y,fontName:K};return await this.#M(J,Z,"epub",Q,F)}async putPdf(J,Z,{parent:Q="",orientation:X,cover:U="first",lastTool:Y}={}){const q={dummyDocument:!1,extraMetadata:{LastTool:Y},fileType:"pdf",pageCount:0,lastOpenedPage:0,lineHeight:-1,margins:125,textScale:1,pages:[],coverPageNumber:U==="first"?0:-1,formatVersion:1,orientation:X};return await this.#M(J,Z,"pdf",Q,q)}async syncComplete(J){const Z=`{ "generation": ${J} }`;await this.#U(`${this.#Q}/sync/v2/sync-complete`,{body:Z})}async#w(J,Z,Q){const{hash:X}=await this.putEntries("",Z),U=await this.putRootHash(X,J);if(Q)try{return await this.syncComplete(U),!0}catch{return!1}else return!1}async create(J,{cache:Z=!0,sync:Q=!0}={}){const[X,U]=await this.getRootHash({cache:Z}),Y=await this.getEntries(X);return Y.push(J),await this.#w(U,Y,Q)}async move(J,Z,{cache:Q=!0,sync:X=!0}={}){const[U,Y]=await this.getRootHash({cache:Q}),q=await this.getEntries(U);if(!Z||Z==="trash");else{const R=q.find((T)=>T.documentId===Z);if(!R)throw new Error(`destination id not found: ${Z}`);else if(R.type!=="80000000")throw new Error(`destination id was a raw file: ${Z}`);const j=await this.getEntries(R.hash),[x]=j.filter((T)=>T.documentId===`${Z}.metadata`);if(!x)throw new Error(`destination id didn't have metadata: ${Z}`);if((await this.getMetadata(x.hash)).type!=="CollectionType")throw new Error(`destination id wasn't a collection: ${Z}`)}const z=q.findIndex((R)=>R.documentId===J);if(z===-1)throw new Error(`document not found: ${J}`);const[K]=q.splice(z,1);if(K.type!=="80000000")throw new Error(`document was a raw file: ${J}`);const V=await this.getEntries(K.hash),B=V.findIndex((R)=>R.documentId===`${J}.metadata`);if(B===-1)throw new Error(`document didn't have metadata: ${J}`);const[F]=V.splice(B,1),W=await this.getMetadata(F.hash);W.parent=Z;const P=await this.putMetadata(J,W);V.push(P);const C=await this.putEntries(J,V);return q.push(C),await this.#w(Y,q,X)}async getEntriesMetadata({verify:J=!0}={}){const Q=await(await this.#U(`${this.#Q}/doc/v2/files`,{method:"GET",headers:{"rm-source":"RoR-Browser"}})).text(),X=JSON.parse(Q);return U0({elements:jZ},X,J),X}async#D(J,Z,Q,X){const Y=(new TextEncoder()).encode(JSON.stringify({file_name:J})),z=await(await this.#U(`${this.#Q}/doc/v2/files`,{body:Z,headers:{"content-type":Q,"rm-meta":I0(Y),"rm-source":"RoR-Browser"}})).text(),K=JSON.parse(z);return U0(HZ,K,X),K}async uploadEpub(J,Z,{verify:Q=!0}={}){return await this.#D(J,Z,"application/epub+zip",Q)}async uploadPdf(J,Z,{verify:Q=!0}={}){return await this.#D(J,Z,"application/pdf",Q)}async getCache(){const J=[];for(let[X,U]of this.#J)J.push(U.then((Y)=>[X,Y],()=>[X,null]));const Z=await Promise.all(J),Q=new Map;for(let[X,U]of Z)if(U)Q.set(X,U);return Q}}export{SQ as remarkable,EQ as register,EZ as parseEntry,TZ as formatEntry,jQ as builtinTools,NZ as builtinTextScales,LZ as builtinMargins,$Z as builtinLineHeights,TQ as builtinFontNames,Y0 as ResponseError,rJ as GenerationError};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FetchLike, HeadersLike, RequestInitLike, ResponseLike } from ".";
|
|
2
|
+
export declare function resolveTo<T>(val: T): [Promise<T>, () => void];
|
|
3
|
+
export declare class MockResponse implements ResponseLike {
|
|
4
|
+
private readonly content;
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly statusText: string;
|
|
7
|
+
readonly mapHeaders: Record<string, string>;
|
|
8
|
+
constructor(content?: string, status?: number, statusText?: string, mapHeaders?: Record<string, string>);
|
|
9
|
+
get ok(): boolean;
|
|
10
|
+
get headers(): HeadersLike;
|
|
11
|
+
text(): Promise<string>;
|
|
12
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
13
|
+
}
|
|
14
|
+
export interface LoggedRequest extends RequestInitLike {
|
|
15
|
+
url: string;
|
|
16
|
+
bodyText: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface MockFetch extends FetchLike {
|
|
19
|
+
pastRequests: LoggedRequest[];
|
|
20
|
+
}
|
|
21
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
22
|
+
export declare function createMockFetch(...nextResponses: Awaitable<MockResponse>[]): MockFetch;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export function resolveTo(val) {
|
|
2
|
+
let res;
|
|
3
|
+
const prom = new Promise((resolve) => {
|
|
4
|
+
res = resolve;
|
|
5
|
+
});
|
|
6
|
+
return [prom, () => res(val)];
|
|
7
|
+
}
|
|
8
|
+
export class MockResponse {
|
|
9
|
+
content;
|
|
10
|
+
status;
|
|
11
|
+
statusText;
|
|
12
|
+
mapHeaders;
|
|
13
|
+
constructor(content = "", status = 200, statusText = "", mapHeaders = {}) {
|
|
14
|
+
this.content = content;
|
|
15
|
+
this.status = status;
|
|
16
|
+
this.statusText = statusText;
|
|
17
|
+
this.mapHeaders = mapHeaders;
|
|
18
|
+
}
|
|
19
|
+
get ok() {
|
|
20
|
+
return 200 <= this.status && this.status < 300;
|
|
21
|
+
}
|
|
22
|
+
get headers() {
|
|
23
|
+
const { mapHeaders } = this;
|
|
24
|
+
return {
|
|
25
|
+
get(key) {
|
|
26
|
+
return mapHeaders[key] ?? null;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
text() {
|
|
31
|
+
return Promise.resolve(this.content);
|
|
32
|
+
}
|
|
33
|
+
arrayBuffer() {
|
|
34
|
+
const enc = new TextEncoder();
|
|
35
|
+
const encoded = enc.encode(this.content).buffer;
|
|
36
|
+
return Promise.resolve(encoded);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const dec = new TextDecoder();
|
|
40
|
+
function extractBodyText(body) {
|
|
41
|
+
if (body === undefined) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
else if (typeof body === "string") {
|
|
45
|
+
return body;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return dec.decode(body);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function createMockFetch(...nextResponses) {
|
|
52
|
+
void nextResponses.reverse();
|
|
53
|
+
const pastRequests = [];
|
|
54
|
+
const mockFetch = async (url, options) => {
|
|
55
|
+
pastRequests.push({
|
|
56
|
+
url,
|
|
57
|
+
bodyText: extractBodyText(options?.body),
|
|
58
|
+
...options,
|
|
59
|
+
});
|
|
60
|
+
const res = nextResponses.pop();
|
|
61
|
+
/* istanbul ignore else */
|
|
62
|
+
if (res) {
|
|
63
|
+
return await res;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
throw new Error("didn't set next response");
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
mockFetch.pastRequests = pastRequests;
|
|
70
|
+
return mockFetch;
|
|
71
|
+
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** convert a buffer to hex */
|
|
2
|
-
export declare function toHex(buffer:
|
|
2
|
+
export declare function toHex(buffer: Uint8Array): string;
|
|
3
3
|
/** convert a hex string to a buffer */
|
|
4
4
|
export declare function fromHex(hex: string): Uint8Array;
|
|
5
5
|
/** concat buffers */
|
package/dist/utils.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/** convert a buffer to hex */
|
|
2
2
|
export function toHex(buffer) {
|
|
3
|
-
return [...
|
|
4
|
-
.map((x) => x.toString(16).padStart(2, "0"))
|
|
5
|
-
.join("");
|
|
3
|
+
return [...buffer].map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
6
4
|
}
|
|
7
5
|
/** convert a hex string to a buffer */
|
|
8
6
|
export function fromHex(hex) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { concatBuffers, fromHex, toHex } from "./utils";
|
|
3
|
+
test("toHex()", () => {
|
|
4
|
+
const buff = new Uint8Array([0, 255, 15, 240, 154]);
|
|
5
|
+
const hex = toHex(buff);
|
|
6
|
+
expect(hex).toBe("00ff0ff09a");
|
|
7
|
+
expect(toHex(new Uint8Array(0))).toBe("");
|
|
8
|
+
});
|
|
9
|
+
test("fromHex()", () => {
|
|
10
|
+
const hex = "00ff0ff09a";
|
|
11
|
+
const buff = fromHex(hex);
|
|
12
|
+
expect([...buff]).toEqual([0, 255, 15, 240, 154]);
|
|
13
|
+
expect([...fromHex("")]).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
test("concatBuffers()", () => {
|
|
16
|
+
const a = new Uint8Array([0, 1, 2]);
|
|
17
|
+
const b = new Uint8Array([3]);
|
|
18
|
+
const c = new Uint8Array([4, 5]);
|
|
19
|
+
const joined = concatBuffers([a, b, c]);
|
|
20
|
+
expect([...joined]).toEqual([0, 1, 2, 3, 4, 5]);
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { validate } from "./validate";
|
|
3
|
+
const uploadEntrySchema = {
|
|
4
|
+
properties: {
|
|
5
|
+
docID: { type: "string" },
|
|
6
|
+
hash: { type: "string" },
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
test("validate()", () => {
|
|
10
|
+
const accurate = { docID: "", hash: "" };
|
|
11
|
+
expect(() => validate(uploadEntrySchema, accurate)).not.toThrow();
|
|
12
|
+
const innaccurate = { docID: "" };
|
|
13
|
+
expect(() => validate(uploadEntrySchema, innaccurate)).toThrow();
|
|
14
|
+
expect(() => validate(uploadEntrySchema, innaccurate, false)).not.toThrow();
|
|
15
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rmapi-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "JavaScript implementation of the reMarkable 1.5 api",
|
|
5
5
|
"repository": "git@github.com:erikbrinkman/rmapi-js.git",
|
|
6
6
|
"author": "Erik Brinkman <erik.brinkman@gmail.com>",
|
|
@@ -8,25 +8,19 @@
|
|
|
8
8
|
"keywords": [
|
|
9
9
|
"remarkable"
|
|
10
10
|
],
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"unpkg": "bundle/rmapi-js.iife.min.js",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"module": "dist/rmapi-js.esm.min.js",
|
|
15
14
|
"files": [
|
|
16
|
-
"./bundle/*.js",
|
|
17
15
|
"./dist/**/*.js",
|
|
18
16
|
"./dist/**/*.d.ts"
|
|
19
17
|
],
|
|
20
|
-
"packageManager": "yarn@4.1.1",
|
|
21
18
|
"scripts": {
|
|
22
|
-
"doc": "
|
|
23
|
-
"fmt": "
|
|
24
|
-
"lint
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"test": "jest --coverage",
|
|
28
|
-
"build": "pnpify tsc -p tsconfig.build.json && esbuild src/index.ts --bundle --minify --platform=node --outfile=bundle/rmapi-js.cjs.min.js && yarn esbuild src/index.ts --bundle --minify --platform=browser --outfile=bundle/rmapi-js.iife.min.js && yarn esbuild src/index.ts --bundle --minify --platform=neutral --outfile=bundle/rmapi-js.esm.min.js --main-fields=module,main",
|
|
29
|
-
"prepack": "yarn lint && yarn test && yarn build"
|
|
19
|
+
"doc": "typedoc",
|
|
20
|
+
"fmt": "prettier --cache --write 'src/*.ts' '*.{js,json}'",
|
|
21
|
+
"lint": "tsc && eslint --cache 'src/*.ts' && typedoc --emit none",
|
|
22
|
+
"export": "tsc -p tsconfig.build.json && bun build src/index.ts --minify --outfile dist/rmapi-js.esm.min.js",
|
|
23
|
+
"prepack": "bun lint && bun test --coverage && bun export"
|
|
30
24
|
},
|
|
31
25
|
"dependencies": {
|
|
32
26
|
"ajv": "^8.12.0",
|
|
@@ -36,125 +30,19 @@
|
|
|
36
30
|
"uuid": "^9.0.1"
|
|
37
31
|
},
|
|
38
32
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@babel/preset-typescript": "^7.24.1",
|
|
42
|
-
"@types/babel__core": "^7.20.5",
|
|
43
|
-
"@types/babel__preset-env": "^7.9.6",
|
|
44
|
-
"@types/jest": "^29.5.12",
|
|
33
|
+
"@eslint/js": "^9.0.0",
|
|
34
|
+
"@types/bun": "^1.1.0",
|
|
45
35
|
"@types/json-stable-stringify": "^1.0.36",
|
|
46
|
-
"@types/node": "^20.12.4",
|
|
47
36
|
"@types/uuid": "^9.0.8",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
49
|
-
"
|
|
50
|
-
"@yarnpkg/pnpify": "^4.0.1",
|
|
51
|
-
"babel-jest": "^29.7.0",
|
|
52
|
-
"esbuild": "^0.20.2",
|
|
53
|
-
"eslint": "^8.57.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
38
|
+
"eslint": "^9.0.0",
|
|
54
39
|
"eslint-config-prettier": "^9.1.0",
|
|
55
|
-
"eslint-plugin-jest": "^27.9.0",
|
|
56
40
|
"eslint-plugin-spellcheck": "^0.0.20",
|
|
57
41
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
58
|
-
"jest": "^29.7.0",
|
|
59
42
|
"prettier": "^3.2.5",
|
|
60
43
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
61
|
-
"typedoc": "^0.25.
|
|
62
|
-
"typescript": "^5.4.
|
|
63
|
-
|
|
64
|
-
"prettier": {
|
|
65
|
-
"plugins": [
|
|
66
|
-
"prettier-plugin-organize-imports"
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
"babel": {
|
|
70
|
-
"presets": [
|
|
71
|
-
[
|
|
72
|
-
"@babel/preset-env",
|
|
73
|
-
{
|
|
74
|
-
"targets": {
|
|
75
|
-
"node": "current"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"@babel/preset-typescript"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
"eslintConfig": {
|
|
83
|
-
"root": true,
|
|
84
|
-
"parser": "@typescript-eslint/parser",
|
|
85
|
-
"plugins": [
|
|
86
|
-
"@typescript-eslint",
|
|
87
|
-
"jest",
|
|
88
|
-
"spellcheck",
|
|
89
|
-
"eslint-plugin-tsdoc"
|
|
90
|
-
],
|
|
91
|
-
"extends": [
|
|
92
|
-
"eslint:recommended",
|
|
93
|
-
"plugin:@typescript-eslint/recommended",
|
|
94
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
95
|
-
"plugin:jest/recommended",
|
|
96
|
-
"prettier"
|
|
97
|
-
],
|
|
98
|
-
"parserOptions": {
|
|
99
|
-
"project": [
|
|
100
|
-
"./tsconfig.json"
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
"env": {
|
|
104
|
-
"node": true
|
|
105
|
-
},
|
|
106
|
-
"rules": {
|
|
107
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
108
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
109
|
-
"tsdoc/syntax": "error",
|
|
110
|
-
"no-warning-comments": [
|
|
111
|
-
"error",
|
|
112
|
-
{
|
|
113
|
-
"terms": [
|
|
114
|
-
"fixme"
|
|
115
|
-
],
|
|
116
|
-
"location": "anywhere"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"spellcheck/spell-checker": [
|
|
120
|
-
"error",
|
|
121
|
-
{
|
|
122
|
-
"identifiers": false,
|
|
123
|
-
"skipWords": [
|
|
124
|
-
"Ballpointv",
|
|
125
|
-
"Finelinerv",
|
|
126
|
-
"Garamond",
|
|
127
|
-
"Highlighterv",
|
|
128
|
-
"Maison",
|
|
129
|
-
"Markable",
|
|
130
|
-
"Markerv",
|
|
131
|
-
"Neue",
|
|
132
|
-
"Noto",
|
|
133
|
-
"Paintbrushv",
|
|
134
|
-
"Pencilv",
|
|
135
|
-
"authed",
|
|
136
|
-
"bigints",
|
|
137
|
-
"docid",
|
|
138
|
-
"ebooks",
|
|
139
|
-
"epub",
|
|
140
|
-
"fineliner",
|
|
141
|
-
"goog",
|
|
142
|
-
"iife",
|
|
143
|
-
"incrementing",
|
|
144
|
-
"linux",
|
|
145
|
-
"macos",
|
|
146
|
-
"movee",
|
|
147
|
-
"rmapi",
|
|
148
|
-
"subfiles",
|
|
149
|
-
"urls",
|
|
150
|
-
"webcrypto"
|
|
151
|
-
],
|
|
152
|
-
"skipIfMatch": [
|
|
153
|
-
"^[0-9a-f]{64}"
|
|
154
|
-
],
|
|
155
|
-
"minLength": 4
|
|
156
|
-
}
|
|
157
|
-
]
|
|
158
|
-
}
|
|
44
|
+
"typedoc": "^0.25.13",
|
|
45
|
+
"typescript": "^5.4.5",
|
|
46
|
+
"typescript-eslint": "^7.6.0"
|
|
159
47
|
}
|
|
160
|
-
}
|
|
48
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
Changelog
|
|
2
|
-
=========
|
|
3
|
-
|
|
4
|
-
All notable changes to this project will be documented in this file.
|
|
5
|
-
|
|
6
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
7
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
-
|
|
9
|
-
## [Unreleased]
|
|
10
|
-
|
|
11
|
-
## [4.0.0] - 2024-04-03
|
|
12
|
-
|
|
13
|
-
### Added
|
|
14
|
-
|
|
15
|
-
- `verify` option to some calls to disable verifying that requests follow the
|
|
16
|
-
expected format. Note that disabling verification will break typescripts
|
|
17
|
-
guarantees, and so it's only recommend if you know what you're doing.
|
|
18
|
-
|
|
19
|
-
### Modified
|
|
20
|
-
|
|
21
|
-
- `lastModified` is now optional. This might break some code that replied on it
|
|
22
|
-
to be present.
|
|
23
|
-
|
|
24
|
-
## [3.1.0] - 2023-12-05
|
|
25
|
-
|
|
26
|
-
### Added
|
|
27
|
-
|
|
28
|
-
- `createdTime` to `DocumentType` metadata, and permissive parsing of metadata
|
|
29
|
-
going forward.
|
|
30
|
-
|
|
31
|
-
## [3.0.0] - 2023-01-03
|
|
32
|
-
|
|
33
|
-
### Added
|
|
34
|
-
|
|
35
|
-
- The ability to call `getEntries` without a hash to implicitely fetch the root
|
|
36
|
-
hash.
|
|
37
|
-
- `getJson` and `putJson` methods that use stable hashing.
|
|
38
|
-
|
|
39
|
-
### Changed
|
|
40
|
-
|
|
41
|
-
- Caching behavior: You can no longer customize the caching behavior with a
|
|
42
|
-
custom `CacheLike` object, but instead specify the maximum size of objects to
|
|
43
|
-
cache. This both cleans up the caching code, and makes it easier to remove
|
|
44
|
-
most redundant calls from higher level interfaces.
|
|
45
|
-
- Changed `FetchLike` interfaces to be promises instead of awaitable.
|
|
46
|
-
|
|
47
|
-
### Removed
|
|
48
|
-
|
|
49
|
-
- Removed deprecated versions of `create` and `move`.
|
|
50
|
-
|
|
51
|
-
## [2.3.0] - 2022-12-31
|
|
52
|
-
|
|
53
|
-
### Added
|
|
54
|
-
|
|
55
|
-
- the root hash is now cached, with the default option of using the cached
|
|
56
|
-
value instead of making a request for it.
|
|
57
|
-
|
|
58
|
-
## [2.2.0] - 2022-12-30
|
|
59
|
-
|
|
60
|
-
### Added
|
|
61
|
-
|
|
62
|
-
- `create` and `move` apis added for a simple high level interface for adding
|
|
63
|
-
and moving documents.
|
|
64
|
-
|
|
65
|
-
## [2.1.0] - 2022-12-30
|
|
66
|
-
|
|
67
|
-
### Added
|
|
68
|
-
|
|
69
|
-
- `putMetadata` created for adding metadata and to parallel `getMetadata`. It's
|
|
70
|
-
just a thin wrapper around `putText`.
|
|
71
|
-
- `putCollection` add to simplify folder creation.
|
|
72
|
-
|
|
73
|
-
## [2.0.0] - 2022-12-26
|
|
74
|
-
|
|
75
|
-
### Added
|
|
76
|
-
|
|
77
|
-
- New default URLs to work with the new api.
|
|
78
|
-
- `syncComplete` was readded and working.
|
|
79
|
-
- `putPdf` added for uploading pdfs.
|
|
80
|
-
- `uploadPdf` and `uploadEpub` added to expose a different upload api.
|
|
81
|
-
|
|
82
|
-
## [1.1.0] - 2022-10-07
|
|
83
|
-
|
|
84
|
-
### Removed
|
|
85
|
-
|
|
86
|
-
- `syncComplete` api was removed as it seems to be no longer supported by
|
|
87
|
-
reMarkable, in favor of auto syncing.
|
|
88
|
-
|
|
89
|
-
## [1.0.0] - 2022-08-07
|
|
90
|
-
|
|
91
|
-
### Added
|
|
92
|
-
|
|
93
|
-
- Initial release
|