@orpc/experimental-publisher-durable-object 0.0.1 → 1.12.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
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
2
+ <image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
3
3
  </div>
4
4
 
5
5
  <h1></h1>
@@ -45,7 +45,7 @@
45
45
 
46
46
  ## Documentation
47
47
 
48
- You can find the full documentation [here](https://orpc.unnoq.com).
48
+ You can find the full documentation [here](https://orpc.dev).
49
49
 
50
50
  ## Packages
51
51
 
package/dist/index.d.mts CHANGED
@@ -19,14 +19,15 @@ interface ResumeStorageOptions {
19
19
  */
20
20
  retentionSeconds?: number;
21
21
  /**
22
- * How long (in seconds) of inactivity before auto-deleting the durable object's data.
23
- * Inactivity means no active WebSocket connections and no events within the retention period.
22
+ * Interval (in seconds) between cleanup checks for the Durable Object.
24
23
  *
25
- * The alarm is scheduled at `retentionSeconds + inactiveDataRetentionTime`.
24
+ * At each interval, verify whether the Durable Object is inactive
25
+ * (no active WebSocket connections and no stored events). If inactive, all
26
+ * data is deleted to free resources; otherwise, another check is scheduled.
26
27
  *
27
- * @default 6 * 60 * 60 (6 hours)
28
+ * @default 12 * 60 * 60 (12 hours)
28
29
  */
29
- inactiveDataRetentionTime?: number;
30
+ cleanupIntervalSeconds?: number;
30
31
  /**
31
32
  * Prefix for the resume storage table schema.
32
33
  * Used to avoid naming conflicts with other tables in the same Durable Object.
@@ -38,7 +39,7 @@ interface ResumeStorageOptions {
38
39
  declare class ResumeStorage {
39
40
  private readonly ctx;
40
41
  private readonly retentionSeconds;
41
- private readonly inactiveDataRetentionTime;
42
+ private readonly cleanupIntervalSeconds;
42
43
  private readonly schemaPrefix;
43
44
  private isInitedSchema;
44
45
  private isInitedAlarm;
package/dist/index.d.ts CHANGED
@@ -19,14 +19,15 @@ interface ResumeStorageOptions {
19
19
  */
20
20
  retentionSeconds?: number;
21
21
  /**
22
- * How long (in seconds) of inactivity before auto-deleting the durable object's data.
23
- * Inactivity means no active WebSocket connections and no events within the retention period.
22
+ * Interval (in seconds) between cleanup checks for the Durable Object.
24
23
  *
25
- * The alarm is scheduled at `retentionSeconds + inactiveDataRetentionTime`.
24
+ * At each interval, verify whether the Durable Object is inactive
25
+ * (no active WebSocket connections and no stored events). If inactive, all
26
+ * data is deleted to free resources; otherwise, another check is scheduled.
26
27
  *
27
- * @default 6 * 60 * 60 (6 hours)
28
+ * @default 12 * 60 * 60 (12 hours)
28
29
  */
29
- inactiveDataRetentionTime?: number;
30
+ cleanupIntervalSeconds?: number;
30
31
  /**
31
32
  * Prefix for the resume storage table schema.
32
33
  * Used to avoid naming conflicts with other tables in the same Durable Object.
@@ -38,7 +39,7 @@ interface ResumeStorageOptions {
38
39
  declare class ResumeStorage {
39
40
  private readonly ctx;
40
41
  private readonly retentionSeconds;
41
- private readonly inactiveDataRetentionTime;
42
+ private readonly cleanupIntervalSeconds;
42
43
  private readonly schemaPrefix;
43
44
  private isInitedSchema;
44
45
  private isInitedAlarm;
package/dist/index.mjs CHANGED
@@ -8,11 +8,11 @@ class ResumeStorage {
8
8
  constructor(ctx, options = {}) {
9
9
  this.ctx = ctx;
10
10
  this.retentionSeconds = options.retentionSeconds ?? 0;
11
- this.inactiveDataRetentionTime = options.inactiveDataRetentionTime ?? 6 * 60 * 60;
11
+ this.cleanupIntervalSeconds = options.cleanupIntervalSeconds ?? 12 * 60 * 60;
12
12
  this.schemaPrefix = options.schemaPrefix ?? "orpc:publisher:resume:";
13
13
  }
14
14
  retentionSeconds;
15
- inactiveDataRetentionTime;
15
+ cleanupIntervalSeconds;
16
16
  schemaPrefix;
17
17
  isInitedSchema = false;
18
18
  isInitedAlarm = false;
@@ -145,7 +145,7 @@ class ResumeStorage {
145
145
  await this.ensureSchemaAndCleanup();
146
146
  }
147
147
  scheduleAlarm() {
148
- return this.ctx.storage.setAlarm(Date.now() + (this.retentionSeconds + this.inactiveDataRetentionTime) * 1e3);
148
+ return this.ctx.storage.setAlarm(Date.now() + this.cleanupIntervalSeconds * 1e3);
149
149
  }
150
150
  }
151
151
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@orpc/experimental-publisher-durable-object",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "1.12.1",
5
5
  "license": "MIT",
6
- "homepage": "https://orpc.unnoq.com",
6
+ "homepage": "https://orpc.dev",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/unnoq/orpc.git",
@@ -24,15 +24,15 @@
24
24
  "dist"
25
25
  ],
26
26
  "dependencies": {
27
- "@orpc/client": "1.11.3",
28
- "@orpc/experimental-publisher": "1.11.3",
29
- "@orpc/standard-server": "1.11.3",
30
- "@orpc/shared": "1.11.3"
27
+ "@orpc/client": "1.12.1",
28
+ "@orpc/experimental-publisher": "1.12.1",
29
+ "@orpc/standard-server": "1.12.1",
30
+ "@orpc/shared": "1.12.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@cloudflare/workers-types": "^4.20251118.0",
34
34
  "@types/node": "^22.15.30",
35
- "@orpc/standard-server-peer": "1.11.3"
35
+ "@orpc/standard-server-peer": "1.12.1"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "unbuild",