@fedify/relay 2.0.0-dev.241 → 2.0.0-dev.323

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.
@@ -3,10 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { exportSpki, getDocumentLoader, isRelayFollowerData } from "./types-Dem_nci6.js";
6
+ import { isRelayFollowerData } from "./types-PoFdJrwy.js";
7
7
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
8
8
  import { createRelay } from "@fedify/relay";
9
9
  import { Accept, Announce, Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
10
+ import { exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
10
11
  import { ok, strictEqual } from "node:assert";
11
12
  import test, { describe } from "node:test";
12
13
 
@@ -3,10 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { exportSpki, getDocumentLoader, isRelayFollowerData } from "./types-Dem_nci6.js";
6
+ import { isRelayFollowerData } from "./types-PoFdJrwy.js";
7
7
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
8
8
  import { createRelay } from "@fedify/relay";
9
9
  import { Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
10
+ import { exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
10
11
  import { ok, strictEqual } from "node:assert";
11
12
  import test, { describe } from "node:test";
12
13
 
@@ -0,0 +1,22 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ //#region src/types.ts
7
+ /**
8
+ * Type predicate to check if a value is valid RelayFollowerData from KV store.
9
+ * Validates the storage format (JSON-LD), not the deserialized Actor instance.
10
+ *
11
+ * @param value The value to check
12
+ * @returns true if the value is a RelayFollowerData
13
+ * @internal
14
+ */
15
+ function isRelayFollowerData(value) {
16
+ if (!value || typeof value !== "object") return false;
17
+ const obj = value;
18
+ return "actor" in obj && "state" in obj && typeof obj.state === "string" && (obj.state === "pending" || obj.state === "accepted");
19
+ }
20
+
21
+ //#endregion
22
+ export { isRelayFollowerData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/relay",
3
- "version": "2.0.0-dev.241+58c8126c",
3
+ "version": "2.0.0-dev.323+1d796545",
4
4
  "description": "ActivityPub relay support for Fedify",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -50,20 +50,22 @@
50
50
  "dependencies": {
51
51
  "@js-temporal/polyfill": "^0.5.1",
52
52
  "@logtape/logtape": "^2.0.0",
53
- "@fedify/fedify": "^2.0.0-dev.241+58c8126c",
54
- "@fedify/vocab": "2.0.0-dev.241+58c8126c"
53
+ "@fedify/fedify": "^2.0.0-dev.323+1d796545",
54
+ "@fedify/vocab": "2.0.0-dev.323+1d796545"
55
55
  },
56
56
  "devDependencies": {
57
57
  "tsdown": "^0.12.9",
58
58
  "typescript": "^5.9.3",
59
59
  "urlpattern-polyfill": "^10.1.0",
60
- "@fedify/vocab-runtime": "^2.0.0-dev.241+58c8126c"
60
+ "@fedify/vocab-runtime": "^2.0.0-dev.323+1d796545"
61
61
  },
62
62
  "scripts": {
63
63
  "build:self": "tsdown",
64
64
  "build": "pnpm --filter @fedify/relay... run build:self",
65
65
  "prepublish": "pnpm build",
66
- "test": "pnpm build && cd dist/ && node --test",
67
- "test:bun": "pnpm build && cd dist/ && bun test --timeout 60000"
66
+ "pretest": "pnpm build",
67
+ "test": "cd dist/ && node --test",
68
+ "pretest:bun": "pnpm build",
69
+ "test:bun": "cd dist/ && bun test --timeout 60000"
68
70
  }
69
71
  }