@tursodatabase/sync-common 0.2.1 → 0.3.0-pre.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/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAkG3D,wBAAgB,QAAQ,IAAI,UAAU,CAUrC;AAGD,wBAAsB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBlG;AAED,qBAAa,gBAAgB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;;IAOpB,IAAI,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQzC,IAAI,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAY3B,KAAK,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAc5B,UAAU,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;CAc1C"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAuG3D,wBAAgB,QAAQ,IAAI,UAAU,CAUrC;AAGD,wBAAsB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBlG;AAED,qBAAa,gBAAgB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;;IAOpB,IAAI,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQzC,IAAI,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAY3B,KAAK,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAc5B,UAAU,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;CAc1C"}
package/dist/run.js CHANGED
@@ -8,6 +8,9 @@ function trackPromise(p) {
8
8
  function timeoutMs(ms) {
9
9
  return new Promise(resolve => setTimeout(resolve, ms));
10
10
  }
11
+ function normalizeUrl(url) {
12
+ return url.replace(/^libsql:\/\//, 'https://');
13
+ }
11
14
  async function process(opts, io, request) {
12
15
  const requestType = request.request();
13
16
  const completion = request.completion();
@@ -23,6 +26,7 @@ async function process(opts, io, request) {
23
26
  completion.poison(`url is empty - sync is paused`);
24
27
  return;
25
28
  }
29
+ url = normalizeUrl(url);
26
30
  try {
27
31
  let headers = typeof opts.headers === "function" ? await opts.headers() : opts.headers;
28
32
  if (requestType.headers != null && requestType.headers.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tursodatabase/sync-common",
3
- "version": "0.2.1",
3
+ "version": "0.3.0-pre.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tursodatabase/turso"
@@ -23,6 +23,6 @@
23
23
  "test": "echo 'no tests'"
24
24
  },
25
25
  "dependencies": {
26
- "@tursodatabase/database-common": "^0.2.1"
26
+ "@tursodatabase/database-common": "^0.3.0-pre.1"
27
27
  }
28
28
  }