@powersync/web 1.8.2 → 1.9.1

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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # PowerSync SDK for Web
6
6
 
7
- *[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres or MongoDB on the server-side (MySQL coming soon).*
7
+ *[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side.*
8
8
 
9
9
  This package (`packages/web`) is the PowerSync SDK for JavaScript Web clients. It is an extension of `packages/common`.
10
10
 
package/dist/index.umd.js CHANGED
@@ -6801,41 +6801,45 @@ exports["des-ede"] = {
6801
6801
  \**************************************************/
6802
6802
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6803
6803
 
6804
- var BN = __webpack_require__(/*! bn.js */ "../../node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js")
6805
- var randomBytes = __webpack_require__(/*! randombytes */ "../../node_modules/randombytes/browser.js")
6804
+ "use strict";
6806
6805
 
6807
- function blind (priv) {
6808
- var r = getr(priv)
6809
- var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()
6810
- return { blinder: blinder, unblinder: r.invm(priv.modulus) }
6806
+
6807
+ var BN = __webpack_require__(/*! bn.js */ "../../node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js");
6808
+ var randomBytes = __webpack_require__(/*! randombytes */ "../../node_modules/randombytes/browser.js");
6809
+ var Buffer = (__webpack_require__(/*! safe-buffer */ "../../node_modules/safe-buffer/index.js").Buffer);
6810
+
6811
+ function getr(priv) {
6812
+ var len = priv.modulus.byteLength();
6813
+ var r;
6814
+ do {
6815
+ r = new BN(randomBytes(len));
6816
+ } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));
6817
+ return r;
6811
6818
  }
6812
6819
 
6813
- function getr (priv) {
6814
- var len = priv.modulus.byteLength()
6815
- var r
6816
- do {
6817
- r = new BN(randomBytes(len))
6818
- } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))
6819
- return r
6820
+ function blind(priv) {
6821
+ var r = getr(priv);
6822
+ var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();
6823
+ return { blinder: blinder, unblinder: r.invm(priv.modulus) };
6820
6824
  }
6821
6825
 
6822
- function crt (msg, priv) {
6823
- var blinds = blind(priv)
6824
- var len = priv.modulus.byteLength()
6825
- var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)
6826
- var c1 = blinded.toRed(BN.mont(priv.prime1))
6827
- var c2 = blinded.toRed(BN.mont(priv.prime2))
6828
- var qinv = priv.coefficient
6829
- var p = priv.prime1
6830
- var q = priv.prime2
6831
- var m1 = c1.redPow(priv.exponent1).fromRed()
6832
- var m2 = c2.redPow(priv.exponent2).fromRed()
6833
- var h = m1.isub(m2).imul(qinv).umod(p).imul(q)
6834
- return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)
6826
+ function crt(msg, priv) {
6827
+ var blinds = blind(priv);
6828
+ var len = priv.modulus.byteLength();
6829
+ var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus);
6830
+ var c1 = blinded.toRed(BN.mont(priv.prime1));
6831
+ var c2 = blinded.toRed(BN.mont(priv.prime2));
6832
+ var qinv = priv.coefficient;
6833
+ var p = priv.prime1;
6834
+ var q = priv.prime2;
6835
+ var m1 = c1.redPow(priv.exponent1).fromRed();
6836
+ var m2 = c2.redPow(priv.exponent2).fromRed();
6837
+ var h = m1.isub(m2).imul(qinv).umod(p).imul(q);
6838
+ return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len);
6835
6839
  }
6836
- crt.getr = getr
6840
+ crt.getr = getr;
6837
6841
 
6838
- module.exports = crt
6842
+ module.exports = crt;
6839
6843
 
6840
6844
 
6841
6845
  /***/ }),
@@ -35299,7 +35303,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
35299
35303
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
35300
35304
 
35301
35305
  "use strict";
35302
- module.exports = __webpack_require__.p + "fe5d98632ac68b2022d7.wasm";
35306
+ module.exports = __webpack_require__.p + "d96c8ebf66d665ac9ff6.wasm";
35303
35307
 
35304
35308
  /***/ }),
35305
35309
 
@@ -40018,7 +40022,7 @@ d._sqlite3_extended_result_codes=(a,b)=>(d._sqlite3_extended_result_codes=V.Le)(
40018
40022
  d._sqlite3_uri_boolean=(a,b,c)=>(d._sqlite3_uri_boolean=V.Se)(a,b,c);d._sqlite3_uri_int64=(a,b,c,e)=>(d._sqlite3_uri_int64=V.Te)(a,b,c,e);d._sqlite3_filename_database=a=>(d._sqlite3_filename_database=V.Ue)(a);d._sqlite3_filename_journal=a=>(d._sqlite3_filename_journal=V.Ve)(a);d._sqlite3_filename_wal=a=>(d._sqlite3_filename_wal=V.We)(a);d._sqlite3_db_name=(a,b)=>(d._sqlite3_db_name=V.Xe)(a,b);d._sqlite3_db_filename=(a,b)=>(d._sqlite3_db_filename=V.Ye)(a,b);
40019
40023
  d._sqlite3_db_readonly=(a,b)=>(d._sqlite3_db_readonly=V.Ze)(a,b);d._sqlite3_compileoption_used=a=>(d._sqlite3_compileoption_used=V._e)(a);d._sqlite3_compileoption_get=a=>(d._sqlite3_compileoption_get=V.$e)(a);d._sqlite3_sourceid=()=>(d._sqlite3_sourceid=V.af)();var $c=d._malloc=a=>($c=d._malloc=V.bf)(a),ed=d._free=a=>(ed=d._free=V.cf)(a);d._RegisterExtensionFunctions=a=>(d._RegisterExtensionFunctions=V.df)(a);d._set_authorizer=a=>(d._set_authorizer=V.ef)(a);
40020
40024
  d._create_function=(a,b,c,e,f,h)=>(d._create_function=V.ff)(a,b,c,e,f,h);d._on_tables_changed=(a,b,c,e,f,h)=>(d._on_tables_changed=V.gf)(a,b,c,e,f,h);d._register_table_update_hook=a=>(d._register_table_update_hook=V.hf)(a);d._create_module=(a,b,c,e)=>(d._create_module=V.jf)(a,b,c,e);d._progress_handler=(a,b)=>(d._progress_handler=V.kf)(a,b);d._register_vfs=(a,b,c,e)=>(d._register_vfs=V.lf)(a,b,c,e);d._getSqliteFree=()=>(d._getSqliteFree=V.mf)();var qd=d._main=(a,b)=>(qd=d._main=V.nf)(a,b);
40021
- d._setup_powersync=()=>(d._setup_powersync=V.of)();var gb=(a,b)=>(gb=V.qf)(a,b),rd=()=>(rd=V.rf)(),ld=a=>(ld=V.sf)(a),md=a=>(md=V.tf)(a),nd=()=>(nd=V.uf)(),cd=a=>(cd=V.vf)(a),Rc=()=>(Rc=V.wf)(),bd=a=>(bd=V.xf)(a),dd=()=>(dd=V.yf)();d._sqlite3_version=46872;d.getTempRet0=()=>rd();d.ccall=Z;d.cwrap=(a,b,c,e)=>{var f=!c||c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&f&&!e?d["_"+a]:(...h)=>Z(a,b,c,h,e)};
40025
+ d._setup_powersync=()=>(d._setup_powersync=V.of)();var gb=(a,b)=>(gb=V.qf)(a,b),rd=()=>(rd=V.rf)(),ld=a=>(ld=V.sf)(a),md=a=>(md=V.tf)(a),nd=()=>(nd=V.uf)(),cd=a=>(cd=V.vf)(a),Rc=()=>(Rc=V.wf)(),bd=a=>(bd=V.xf)(a),dd=()=>(dd=V.yf)();d._sqlite3_version=50840;d.getTempRet0=()=>rd();d.ccall=Z;d.cwrap=(a,b,c,e)=>{var f=!c||c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&f&&!e?d["_"+a]:(...h)=>Z(a,b,c,h,e)};
40022
40026
  d.addFunction=(a,b)=>{if(!jd){jd=new WeakMap;var c=hd.length;if(jd)for(var e=0;e<0+c;e++){var f=hd.get(e);f&&jd.set(f,e)}}if(c=jd.get(a)||0)return c;if(kd.length)c=kd.pop();else{try{hd.grow(1)}catch(n){if(!(n instanceof RangeError))throw n;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}c=hd.length-1}try{hd.set(c,a)}catch(n){if(!(n instanceof TypeError))throw n;if("function"==typeof WebAssembly.Function){e=WebAssembly.Function;f={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"};for(var h=
40023
40027
  {parameters:[],results:"v"==b[0]?[]:[f[b[0]]]},k=1;k<b.length;++k)h.parameters.push(f[b[k]]);b=new e(h,a)}else{e=[1];f=b.slice(0,1);b=b.slice(1);h={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96);k=b.length;128>k?e.push(k):e.push(k%128|128,k>>7);for(k=0;k<b.length;++k)e.push(h[b[k]]);"v"==f?e.push(0):e.push(1,h[f]);b=[0,97,115,109,1,0,0,0,1];f=e.length;128>f?b.push(f):b.push(f%128|128,f>>7);b.push(...e);b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(new Uint8Array(b));b=(new WebAssembly.Instance(b,
40024
40028
  {e:{f:a}})).exports.f}hd.set(c,b)}jd.set(a,c);return c};d.setValue=I;d.getValue=H;d.UTF8ToString=(a,b)=>a?J(w,a,b):"";d.stringToUTF8=(a,b,c)=>K(a,w,b,c);d.lengthBytesUTF8=Ua;d.intArrayFromString=Va;d.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];255<e&&(e&=255);b.push(String.fromCharCode(e))}return b.join("")};d.AsciiToString=a=>{for(var b="";;){var c=w[a++];if(!c)return b;b+=String.fromCharCode(c)}};