@fedify/sqlite 2.0.0-dev.1641 → 2.0.0-dev.1690

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/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/sqlite",
3
- "version": "2.0.0-dev.1641+6b0c942c",
3
+ "version": "2.0.0-dev.1690+304896b8",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts",
@@ -8,9 +8,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
8
  var __getOwnPropNames = Object.getOwnPropertyNames;
9
9
  var __getProtoOf = Object.getPrototypeOf;
10
10
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __commonJS = (cb, mod) => function() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
11
  var __copyProps = (to, from, except, desc) => {
15
12
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
13
  key = keys[i];
@@ -28,12 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
25
 
29
26
  //#endregion
30
27
 
31
- Object.defineProperty(exports, '__commonJS', {
32
- enumerable: true,
33
- get: function () {
34
- return __commonJS;
35
- }
36
- });
37
28
  Object.defineProperty(exports, '__toESM', {
38
29
  enumerable: true,
39
30
  get: function () {
package/dist/kv.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
 
4
4
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
5
- const require_index_esm = require('./node_modules/.pnpm/@js-temporal_polyfill@0.5.1/node_modules/@js-temporal/polyfill/dist/index.esm.cjs');
6
5
  const __sqlite = require_rolldown_runtime.__toESM(require("#sqlite"));
6
+ const __js_temporal_polyfill = require_rolldown_runtime.__toESM(require("@js-temporal/polyfill"));
7
7
  const __logtape_logtape = require_rolldown_runtime.__toESM(require("@logtape/logtape"));
8
8
  const es_toolkit = require_rolldown_runtime.__toESM(require("es-toolkit"));
9
9
 
@@ -54,7 +54,7 @@ var SqliteKvStore = class SqliteKvStore {
54
54
  async get(key) {
55
55
  this.initialize();
56
56
  const encodedKey = this.#encodeKey(key);
57
- const now = require_index_esm.qi.Now.instant().epochMilliseconds;
57
+ const now = __js_temporal_polyfill.Temporal.Now.instant().epochMilliseconds;
58
58
  const result = this.#db.prepare(`
59
59
  SELECT value
60
60
  FROM "${this.#tableName}"
@@ -71,7 +71,7 @@ var SqliteKvStore = class SqliteKvStore {
71
71
  if (value === void 0) return;
72
72
  const encodedKey = this.#encodeKey(key);
73
73
  const encodedValue = this.#encodeValue(value);
74
- const now = require_index_esm.qi.Now.instant().epochMilliseconds;
74
+ const now = __js_temporal_polyfill.Temporal.Now.instant().epochMilliseconds;
75
75
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
76
76
  this.#db.prepare(`INSERT INTO "${this.#tableName}" (key, value, created, expires)
77
77
  VALUES (?, ?, ?, ?)
@@ -99,7 +99,7 @@ var SqliteKvStore = class SqliteKvStore {
99
99
  async cas(key, expectedValue, newValue, options) {
100
100
  this.initialize();
101
101
  const encodedKey = this.#encodeKey(key);
102
- const now = require_index_esm.qi.Now.instant().epochMilliseconds;
102
+ const now = __js_temporal_polyfill.Temporal.Now.instant().epochMilliseconds;
103
103
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
104
104
  try {
105
105
  this.#db.exec("BEGIN IMMEDIATE");
@@ -157,7 +157,7 @@ var SqliteKvStore = class SqliteKvStore {
157
157
  logger.debug("Initialized the key–value store table {tableName}.", { tableName: this.#tableName });
158
158
  }
159
159
  #expire() {
160
- const now = require_index_esm.qi.Now.instant().epochMilliseconds;
160
+ const now = __js_temporal_polyfill.Temporal.Now.instant().epochMilliseconds;
161
161
  this.#db.prepare(`
162
162
  DELETE FROM "${this.#tableName}"
163
163
  WHERE expires IS NOT NULL AND expires <= ?
package/dist/kv.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
 
4
- import { qi } from "./node_modules/.pnpm/@js-temporal_polyfill@0.5.1/node_modules/@js-temporal/polyfill/dist/index.esm.js";
5
4
  import { SqliteDatabase } from "#sqlite";
5
+ import { Temporal } from "@js-temporal/polyfill";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { isEqual } from "es-toolkit";
8
8
 
@@ -53,7 +53,7 @@ var SqliteKvStore = class SqliteKvStore {
53
53
  async get(key) {
54
54
  this.initialize();
55
55
  const encodedKey = this.#encodeKey(key);
56
- const now = qi.Now.instant().epochMilliseconds;
56
+ const now = Temporal.Now.instant().epochMilliseconds;
57
57
  const result = this.#db.prepare(`
58
58
  SELECT value
59
59
  FROM "${this.#tableName}"
@@ -70,7 +70,7 @@ var SqliteKvStore = class SqliteKvStore {
70
70
  if (value === void 0) return;
71
71
  const encodedKey = this.#encodeKey(key);
72
72
  const encodedValue = this.#encodeValue(value);
73
- const now = qi.Now.instant().epochMilliseconds;
73
+ const now = Temporal.Now.instant().epochMilliseconds;
74
74
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
75
75
  this.#db.prepare(`INSERT INTO "${this.#tableName}" (key, value, created, expires)
76
76
  VALUES (?, ?, ?, ?)
@@ -98,7 +98,7 @@ var SqliteKvStore = class SqliteKvStore {
98
98
  async cas(key, expectedValue, newValue, options) {
99
99
  this.initialize();
100
100
  const encodedKey = this.#encodeKey(key);
101
- const now = qi.Now.instant().epochMilliseconds;
101
+ const now = Temporal.Now.instant().epochMilliseconds;
102
102
  const expiresAt = options?.ttl !== void 0 ? now + options.ttl.total({ unit: "milliseconds" }) : null;
103
103
  try {
104
104
  this.#db.exec("BEGIN IMMEDIATE");
@@ -156,7 +156,7 @@ var SqliteKvStore = class SqliteKvStore {
156
156
  logger.debug("Initialized the key–value store table {tableName}.", { tableName: this.#tableName });
157
157
  }
158
158
  #expire() {
159
- const now = qi.Now.instant().epochMilliseconds;
159
+ const now = Temporal.Now.instant().epochMilliseconds;
160
160
  this.#db.prepare(`
161
161
  DELETE FROM "${this.#tableName}"
162
162
  WHERE expires IS NOT NULL AND expires <= ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/sqlite",
3
- "version": "2.0.0-dev.1641+6b0c942c",
3
+ "version": "2.0.0-dev.1690+304896b8",
4
4
  "description": "SQLite drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -57,14 +57,14 @@
57
57
  }
58
58
  },
59
59
  "dependencies": {
60
+ "@js-temporal/polyfill": "^0.5.1",
60
61
  "@logtape/logtape": "^1.0.0",
61
62
  "es-toolkit": "^1.31.0"
62
63
  },
63
64
  "peerDependencies": {
64
- "@fedify/fedify": "^2.0.0-dev.1641+6b0c942c"
65
+ "@fedify/fedify": "^2.0.0-dev.1690+304896b8"
65
66
  },
66
67
  "devDependencies": {
67
- "@js-temporal/polyfill": "^0.5.1",
68
68
  "@std/async": "npm:@jsr/std__async@^1.0.13",
69
69
  "tsdown": "^0.12.9",
70
70
  "typescript": "^5.9.2"
@@ -1,30 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
-
4
- //#region rolldown:runtime
5
- var __create = Object.create;
6
- var __defProp = Object.defineProperty;
7
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
- var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __commonJS = (cb, mod) => function() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
- key = keys[i];
17
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: ((k) => from[k]).bind(null, key),
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
- value: mod,
26
- enumerable: true
27
- }) : target, mod));
28
-
29
- //#endregion
30
- export { __commonJS, __toESM };