rmapi-js 5.0.0 → 6.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/README.md +32 -90
- package/dist/index.d.ts +101 -514
- package/dist/index.js +159 -706
- package/dist/rmapi-js.esm.min.js +1 -1
- package/package.json +14 -15
- package/dist/index.spec.d.ts +0 -1
- package/dist/index.spec.js +0 -800
- package/dist/test-utils.d.ts +0 -22
- package/dist/test-utils.js +0 -71
- package/dist/utils.d.ts +0 -6
- package/dist/utils.js +0 -22
- package/dist/utils.spec.d.ts +0 -1
- package/dist/utils.spec.js +0 -21
- package/dist/validate.d.ts +0 -3
- package/dist/validate.js +0 -8
- package/dist/validate.spec.d.ts +0 -1
- package/dist/validate.spec.js +0 -15
package/dist/rmapi-js.esm.min.js
CHANGED
|
@@ -1 +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};
|
|
1
|
+
function lt(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[t&63]}function ot(t,n,r){var u,i=[];for(var c=n;c<r;c+=3)u=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),i.push(lt(u));return i.join("")}function at(t){var n,r=t.length,u=r%3,i=[],c=16383;for(var a=0,d=r-u;a<d;a+=c)i.push(ot(t,a,a+c>d?d:a+c));if(u===1)n=t[r-1],i.push(o[n>>2]+o[n<<4&63]+"==");else if(u===2)n=(t[r-2]<<8)+t[r-1],i.push(o[n>>10]+o[n>>4&63]+o[n<<2&63]+"=");return i.join("")}var P=at;var o=[],U=[];var K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(w=0,I=K.length;w<I;++w)o[w]=K[w],U[K.charCodeAt(w)]=w;var w,I;U["-".charCodeAt(0)]=62;U["_".charCodeAt(0)]=63;function X(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function M(t=0.5){return Math.random()<t}function q(t,n){return t+Math.floor(Math.random()*(n-t))}function D(t){return t[q(0,t.length)]}function S(){if(j===void 0){const t=Math.sqrt(-2*Math.log(Math.random())),n=2*Math.PI*Math.random();return j=t*Math.sin(n),t*Math.cos(n)}else{const t=j;return j=void 0,t}}function h(t=1){const n=Math.exp(-t);let r=0,u=Math.random();while(u>n)r++,u*=Math.random();return r}function A(t){return Array(t).fill(null).map(()=>Y.charAt(Math.floor(Math.random()*Y.length))).join("")}function*e(...t){for(let n of t)yield*n}function*O(t,n){let r=0;for(let u of t)yield n(u,r++)}function*ht(t,n){let r=0;for(let u of t)if(n(u,r++))yield u}function*mt(t){for(let n=0;n<t;++n)yield n}function _(){return new V}function F(){return new b("float64")}function l(){return new R}function C(...t){const n=new Set(t);if(n.size!==t.length)throw new Error("enum can't contain duplicates");else return new y(t,n)}function Z(t){if(t.definitions)throw new Error("definitions can only exist on a root schema");else return new k(t)}function N(t){if(t.definitions)throw new Error("definitions can only exist on a root schema");else return new L(t)}function m(t,n,r){return zt(t?Object.entries(t):void 0,n?Object.entries(n):void 0,r)}function B(t,n){return ft(t,n,Object.entries(n))}var wt={int8:[-128,128],int16:[-32768,32768],int32:[-2147483648,2147483648],uint8:[0,256],uint16:[0,65536],uint32:[0,4294967296]},j,Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ;,'\"",zt=function(t,n,r){const u=new Set(O(e(t??[],n??[]),([i])=>i));if(t?.some(([,i])=>i.definitions))throw new Error("definitions can only exist on a root schema");else if(n?.some(([,i])=>i.definitions))throw new Error("definitions can only exist on a root schema");else if(u.size!==(t?.length??0)+(n?.length??0))throw new Error("properties and optionalProperties keys must be unique");else return new H(t,n,r??!1,u)},ft=function(t,n,r){if(r.some(([,u])=>u.definitions))throw new Error("definitions can only exist on a root schema");else if(r.some(([,u])=>u.keys?.has(t)??!0))throw new Error("all discriminator mappings must be properties schemas that don't contain discriminator");else return new p(t,n,r)};class dt{#t;definitions;nullable=!0;constructor(t){this.#t=t,this.definitions=t.definitions}guard(t){return t===null||this.#t.guard(t)}fuzz(){return M(0.1)?null:this.#t.fuzz()}schema(){return{...this.#t.schema(),nullable:!0}}}class jt{#t;#n;definitions;nullable;constructor(t,n){this.#t=t,this.#n=n,this.definitions=t.definitions,this.nullable=t.nullable}guard(t){return this.#t.guard(t)}fuzz(){return this.#t.fuzz()}schema(){return{...this.#t.schema(),metadata:this.#n}}}class V{guard(t){return typeof t==="boolean"}fuzz(){return M()}schema(){return{type:"boolean"}}}class Ot{#t;#n;#r;constructor(t){this.#t=t,[this.#n,this.#r]=wt[t]}guard(t){return typeof t==="number"&&t%1===0&&this.#n<=t&&t<this.#r}fuzz(){return q(this.#n,this.#r)}schema(){return{type:this.#t}}}class b{#t;constructor(t){this.#t=t}guard(t){return typeof t==="number"}fuzz(){return S()}schema(){return{type:this.#t}}}class R{guard(t){return typeof t==="string"}fuzz(){return A(h(3))}schema(){return{type:"string"}}}class y{#t;#n;constructor(t,n){this.#t=t,this.#n=n}guard(t){return typeof t==="string"&&this.#n.has(t)}fuzz(){return D(this.#t)}schema(){return{enum:[...this.#t]}}}class k{#t;constructor(t){this.#t=t}guard(t){return Array.isArray(t)&&t.every((n)=>this.#t.guard(n))}fuzz(){return Array(h()).fill(null).map(()=>this.#t.fuzz())}schema(){return{elements:this.#t.schema()}}}class L{#t;constructor(t){this.#t=t}guard(t){return X(t)&&Object.values(t).every((n)=>this.#t.guard(n))}fuzz(){return Object.fromEntries(Array(h()).fill(null).map(()=>[A(h(3)),this.#t.fuzz()]))}schema(){return{values:this.#t.schema()}}}class H{#t;#n;#r;keys;constructor(t,n,r,u){this.#t=t,this.#n=n,this.#r=r,this.keys=u}guard(t){return X(t)&&(this.#t?.every(([n,r])=>r.guard(t[n]))??!0)&&(this.#n?.every(([n,r])=>t[n]===void 0||r.guard(t[n]))??!0)&&(this.#r||Object.keys(t).every((n)=>this.keys.has(n)))}fuzz(){const t=O(this.#t??[],([u,i])=>[u,i.fuzz()]),n=O(ht(this.#n??[],()=>M()),([u,i])=>[u,i.fuzz()]),r=this.#r?O(mt(h()),()=>[A(h(3)),D([()=>null,M,S,()=>A(h()),()=>[],()=>({})])()]):[];return Object.fromEntries(e(t,n,r))}schema(){const t={};if(this.#t)t.properties=Object.fromEntries(this.#t.map(([n,r])=>[n,r.schema()]));if(this.#n)t.optionalProperties=Object.fromEntries(this.#n.map(([n,r])=>[n,r.schema()]));if(this.#r)t.additionalProperties=!0;return t}}class p{#t;#n;#r;constructor(t,n,r){this.#t=t,this.#n=n,this.#r=r}guard(t){if(!X(t))return!1;const{[this.#t]:n,...r}=t;if(typeof n!=="string")return!1;return this.#n[n]?.guard(r)??!1}fuzz(){const[t,n]=D(this.#r);return{...n.fuzz(),[this.#t]:t}}schema(){const t=Object.fromEntries(this.#r.map(([n,r])=>[n,r.schema()]));return{discriminator:this.#t,mapping:t}}}class T{#t;#n;definitions=!0;constructor(t,n){this.#t=t,this.#n=n}guard(t){return this.#n.guard(t)}fuzz(){return this.#n.fuzz()}schema(){const t=Object.fromEntries(Object.entries(this.#t).map(([n,r])=>[n,r.schema()]));return{...this.#n.schema(),definitions:t}}}class v{#t;#n;constructor(t,n){this.#t=t,this.#n=n}guard(t){return this.#n.guard(t)}fuzz(){return this.#n.fuzz()}schema(){return{ref:this.#t}}}class tt{#t;#n;constructor(t,n){this.#t=t,this.#n=n}def(t,n){const r=n(this.#n);return new tt({...this.#t,[t]:r},{...this.#n,[t]:new v(t,r)})}build(t){return new T(this.#t,t(this.#n))}}class Mt{#t;#n;constructor(t,n){this.#n=t,this.#t=n}guard(t){return this.#n[this.#t].guard(t)}fuzz(){return this.#n[this.#t].fuzz()}schema(){return{ref:this.#t}}}function nt(t,n=0){return(s[t[n+0]]+s[t[n+1]]+s[t[n+2]]+s[t[n+3]]+"-"+s[t[n+4]]+s[t[n+5]]+"-"+s[t[n+6]]+s[t[n+7]]+"-"+s[t[n+8]]+s[t[n+9]]+"-"+s[t[n+10]]+s[t[n+11]]+s[t[n+12]]+s[t[n+13]]+s[t[n+14]]+s[t[n+15]]).toLowerCase()}var s=[];for(E=0;E<256;++E)s.push((E+256).toString(16).slice(1));var E;var J,At=new Uint8Array(16);function $(){if(!J){if(J=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return J(At)}var Et=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),G={randomUUID:Et};function Jt(t,n,r){if(G.randomUUID&&!n&&!t)return G.randomUUID();t=t||{};var u=t.random||(t.rng||$)();if(u[6]=u[6]&15|64,u[8]=u[8]&63|128,n){r=r||0;for(var i=0;i<16;++i)n[r+i]=u[i];return n}return nt(u)}var W=Jt;function x(t,n,r){if(!r||n.guard(t))return t;else throw new Error(`couldn't validate schema: ${JSON.stringify(t)} didn't match schema ${JSON.stringify(n.schema())}`)}async function Bt(t,{deviceDesc:n="browser-chrome",uuid:r=W(),authHost:u=it,fetch:i=globalThis.fetch}={}){if(t.length!==8)throw new Error(`code should be length 8, but was ${t.length}`);const c=await i(`${u}/token/json/2/device/new`,{method:"POST",headers:{Authorization:"Bearer"},body:JSON.stringify({code:t,deviceDesc:n,deviceID:r})});if(!c.ok)throw new g(c.status,c.statusText,"couldn't register api");else return await c.text()}async function Vt(t,{fetch:n=globalThis.fetch,authHost:r=it,syncHost:u=Qt}={}){const i=await n(`${r}/token/json/2/user/new`,{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`couldn't fetch auth token: ${i.statusText}`);const c=await i.text();return new ct(c,n,u)}var it="https://webapp-prod.cloud.remarkable.engineering",Qt="https://web.eu.tectonic.remarkable.com",z=/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}||trash)$/,Q=/^[0-9a-f]{64}$/,rt={id:l(),hash:l(),visibleName:l(),lastModified:l(),pinned:_()},ut={parent:l(),tags:Z(m({name:l(),timestamp:F()}))},xt=B("type",{CollectionType:m(rt,ut,!0),DocumentType:m({...rt,lastOpened:l(),fileType:C("epub","pdf","notebook")},ut,!0)}),Kt=Z(xt),Ut=m({docID:l(),hash:l()}),Pt=m({hash:l()}),Xt=m({hashes:N(l())});class g extends Error{status;statusText;constructor(t,n,r){super(r);this.status=t,this.statusText=n}}class f extends Error{field;regex;constructor(t,n,r){super(r);this.field=t,this.regex=n}}class ct{#t;#n;#r;constructor(t,n,r){this.#t=t,this.#n=n,this.#r=r}async#s(t,{body:n,method:r="POST",headers:u={}}){const i=await this.#n(t,{method:r,headers:{Authorization:`Bearer ${this.#t}`,...u},body:n});if(!i.ok){const c=await i.text();throw new g(i.status,i.statusText,`failed reMarkable request: ${c}`)}else return i}async#u({meta:t="",method:n="GET",contentType:r="text/plain;charset=UTF-8",body:u,hash:i}={}){const a=new TextEncoder().encode(t),d=i===void 0?"":`/${i}`,st=await(await this.#s(`${this.#r}/doc/v2/files${d}`,{body:u,method:n,headers:{"content-type":r,"rm-meta":P(a),"rm-source":"WebLibrary"}})).text();return JSON.parse(st)}async listFiles({verify:t=!0}={}){const n=await this.#u();return x(n,Kt,t)}async#i(t,n,r,u,i){if(i&&!z.test(t))throw new f(t,z,"parent must be a valid document id");const c=await this.#u({meta:JSON.stringify({parent:t,file_name:n}),method:"POST",contentType:u,body:r});return x(c,Ut,i)}async createFolder(t,{parent:n="",verify:r=!0}={}){return await this.#i(n,t,new ArrayBuffer(0),"folder",r)}async uploadEpub(t,n,{parent:r="",verify:u=!0}={}){return await this.#i(r,t,n,"application/epub+zip",u)}async uploadPdf(t,n,{parent:r="",verify:u=!0}={}){return await this.#i(r,t,n,"application/pdf",u)}async#c(t,n,r){if(r&&!Q.test(t))throw new f(t,Q,"hash to modify was not a valid hash");const u=await this.#u({hash:t,body:JSON.stringify(n),method:"PATCH"});return x(u,Pt,r)}async move(t,n,{verify:r=!0}={}){if(r&&!z.test(n))throw new f(n,z,"parent must be a valid document id");return await this.#c(t,{parent:n},r)}async delete(t,n={}){return await this.move(t,"trash",n)}async rename(t,n,{verify:r=!0}={}){return await this.#c(t,{file_name:n},r)}async#l(t,n,r){if(r){if(t.filter((c)=>!Q.test(c)).length)throw new f(t.join(", "),Q,"hashes to modify were not a valid hashes")}const u=await this.#u({body:JSON.stringify({updates:n,hashes:t}),method:"PATCH"});return x(u,Xt,r)}async bulkMove(t,n,{verify:r=!0}={}){if(r&&!z.test(n))throw new f(n,z,"parent must be a valid document id");return await this.#l(t,{parent:n},r)}async bulkDelete(t,n={}){return await this.bulkMove(t,"trash",n)}}export{Vt as remarkable,Bt as register,f as ValidationError,g as ResponseError};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rmapi-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.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>",
|
|
@@ -23,26 +23,25 @@
|
|
|
23
23
|
"prepack": "bun lint && bun test --coverage && bun export"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"ajv": "^8.12.0",
|
|
27
26
|
"base64-js": "^1.5.1",
|
|
28
27
|
"json-stable-stringify": "^1.1.1",
|
|
29
|
-
"jtd": "^0.1.
|
|
30
|
-
"uuid": "^
|
|
28
|
+
"jtd-ts": "^0.1.0",
|
|
29
|
+
"uuid": "^10.0.0"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@eslint/js": "^9.
|
|
34
|
-
"@types/bun": "^1.1.
|
|
32
|
+
"@eslint/js": "^9.11.0",
|
|
33
|
+
"@types/bun": "^1.1.10",
|
|
35
34
|
"@types/json-stable-stringify": "^1.0.36",
|
|
36
|
-
"@types/uuid": "^
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"eslint": "^9.
|
|
35
|
+
"@types/uuid": "^10.0.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.6.0",
|
|
37
|
+
"eslint": "^9.11.0",
|
|
39
38
|
"eslint-config-prettier": "^9.1.0",
|
|
40
39
|
"eslint-plugin-spellcheck": "^0.0.20",
|
|
41
|
-
"eslint-plugin-tsdoc": "^0.
|
|
42
|
-
"prettier": "^3.
|
|
43
|
-
"prettier-plugin-organize-imports": "^
|
|
44
|
-
"typedoc": "^0.
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"typescript-eslint": "^
|
|
40
|
+
"eslint-plugin-tsdoc": "^0.3.0",
|
|
41
|
+
"prettier": "^3.3.3",
|
|
42
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
43
|
+
"typedoc": "^0.26.7",
|
|
44
|
+
"typescript": "^5.6.2",
|
|
45
|
+
"typescript-eslint": "^8.6.0"
|
|
47
46
|
}
|
|
48
47
|
}
|
package/dist/index.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|