@fedify/fedify 1.6.1-dev.851 → 1.6.1-dev.856

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.
Files changed (74) hide show
  1. package/dist/_virtual/rolldown_runtime.js +26 -1
  2. package/dist/codegen/schema.js +5 -4
  3. package/dist/deno.js +15 -2
  4. package/dist/federation/middleware.test.js +62 -53
  5. package/dist/federation/send.test.js +8 -10
  6. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/constants.js +1 -7
  7. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/dirname.js +1 -1
  8. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize.js +1 -1
  9. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/dirname.js +1 -32
  10. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join.js +1 -32
  11. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/mod.js +0 -2
  12. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/_util.js +1 -1
  13. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js +2 -2
  14. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js +2 -2
  15. package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js +1 -1
  16. package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/join.js +1 -1
  17. package/dist/node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js +68 -0
  18. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/CallHistory.js +94 -0
  19. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/FetchMock.js +143 -0
  20. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/IsSubsetOf.js +103 -0
  21. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Matchers.js +195 -0
  22. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/RequestUtils.js +83 -0
  23. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Route.js +137 -0
  24. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Router.js +181 -0
  25. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/StatusTextMap.js +73 -0
  26. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/TypeDescriptor.js +97 -0
  27. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/index.js +11 -0
  28. package/dist/node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js +87 -0
  29. package/dist/node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.js +37 -0
  30. package/dist/runtime/authdocloader.test.js +5 -5
  31. package/dist/runtime/docloader.js +1 -1
  32. package/dist/runtime/docloader.test.js +8 -0
  33. package/dist/sig/key.js +7 -2
  34. package/dist/testing/docloader.js +34 -15
  35. package/dist/testing/fixtures/example.com/{hong-gildong → hong-gildong.json} +1 -1
  36. package/dist/testing/fixtures/example.com/{object → object.json} +1 -1
  37. package/dist/testing/fixtures/example.com/person.js +29 -0
  38. package/dist/testing/fixtures/example.com/person2.js +48 -0
  39. package/dist/testing/fixtures/example.com/{test → test.json} +1 -1
  40. package/dist/testing/fixtures/w3id.org/security/data-integrity/{v1 → v1.json} +1 -1
  41. package/dist/testing/fixtures/w3id.org/security/{v1 → v1.json} +9 -9
  42. package/dist/testing/mod.d.ts +11 -0
  43. package/dist/testing/mod.js +44 -38
  44. package/dist/vocab/lookup.test.js +30 -35
  45. package/dist/vocab/vocab.js +176 -176
  46. package/dist/vocab/vocab.test.js +2 -2
  47. package/package.json +8 -3
  48. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/_util.js +0 -19
  49. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js +0 -75
  50. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/join.js +0 -54
  51. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js +0 -87
  52. /package/dist/testing/fixtures/activitypub.academy/users/{brauca_darradiul → brauca_darradiul.json} +0 -0
  53. /package/dist/testing/fixtures/example.com/{announce → announce.json} +0 -0
  54. /package/dist/testing/fixtures/example.com/{collection → collection.json} +0 -0
  55. /package/dist/testing/fixtures/example.com/{create → create.json} +0 -0
  56. /package/dist/testing/fixtures/example.com/{cross-origin-actor → cross-origin-actor.json} +0 -0
  57. /package/dist/testing/fixtures/example.com/{invite → invite.json} +0 -0
  58. /package/dist/testing/fixtures/example.com/{key → key.json} +0 -0
  59. /package/dist/testing/fixtures/example.com/{key2 → key2.json} +0 -0
  60. /package/dist/testing/fixtures/example.com/{orderedcollectionpage → orderedcollectionpage.json} +0 -0
  61. /package/dist/testing/fixtures/example.com/paged/{a → a.json} +0 -0
  62. /package/dist/testing/fixtures/example.com/paged/{b → b.json} +0 -0
  63. /package/dist/testing/fixtures/example.com/{paged-collection → paged-collection.json} +0 -0
  64. /package/dist/testing/fixtures/example.com/{person → person.json} +0 -0
  65. /package/dist/testing/fixtures/example.com/{person2 → person2.json} +0 -0
  66. /package/dist/testing/fixtures/example.com/users/{handle → handle.json} +0 -0
  67. /package/dist/testing/fixtures/example.com/{wrong-type → wrong-type.json} +0 -0
  68. /package/dist/testing/fixtures/remote.domain/users/{bob → bob.json} +0 -0
  69. /package/dist/testing/fixtures/server.example/users/{alice → alice.json} +0 -0
  70. /package/dist/testing/fixtures/w3id.org/identity/{v1 → v1.json} +0 -0
  71. /package/dist/testing/fixtures/w3id.org/security/multikey/{v1 → v1.json} +0 -0
  72. /package/dist/testing/fixtures/wizard.casa/users/{hongminhee → hongminhee.json} +0 -0
  73. /package/dist/testing/fixtures/www.w3.org/ns/{activitystreams → activitystreams.json} +0 -0
  74. /package/dist/testing/fixtures/www.w3.org/ns/did/{v1 → v1.json} +0 -0
@@ -634,7 +634,7 @@ const sampleValues = {
634
634
  "fedify:proofPurpose": "assertionMethod",
635
635
  "fedify:units": "m"
636
636
  };
637
- const types = await loadSchemaFiles(import.meta.dirname);
637
+ const types = navigator?.userAgent === "Cloudflare-Workers" ? {} : await loadSchemaFiles(import.meta.dirname);
638
638
  for (const typeUri in types) {
639
639
  const type = types[typeUri];
640
640
  const cls = vocab_exports[type.name];
@@ -823,7 +823,7 @@ for (const typeUri in types) {
823
823
  }), TypeError);
824
824
  });
825
825
  if ("Deno" in globalThis) {
826
- const { assertSnapshot } = await import("@std/testing/snapshot");
826
+ const { assertSnapshot } = await import("@std/testing/snapshot").catch(() => ({ assertSnapshot: () => Promise.resolve() }));
827
827
  test(`Deno.inspect(${type.name}) [auto]`, async (t) => {
828
828
  const empty = new cls({});
829
829
  assertEquals(Deno.inspect(empty), `${type.name} {}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.6.1-dev.851+58ee54ab",
3
+ "version": "1.6.1-dev.856+77c62d3e",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -106,13 +106,18 @@
106
106
  "@std/yaml": "npm:@jsr/std__yaml@^1.0.6",
107
107
  "@types/node": "^22.15.21",
108
108
  "fast-check": "^3.22.0",
109
+ "fetch-mock": "^12.5.2",
110
+ "miniflare": "^4.20250523.0",
109
111
  "tsdown": "^0.12.2",
110
- "typescript": "^5.8.3"
112
+ "tsx": "^4.19.4",
113
+ "typescript": "^5.8.3",
114
+ "wrangler": "^4.17.0"
111
115
  },
112
116
  "scripts": {
113
117
  "build": "deno task codegen && tsdown",
114
118
  "prepublish": "deno task codegen && tsdown && deno task check-version",
115
119
  "test": "deno task codegen && tsdown && cd dist/ && node --test",
116
- "test:bun": "deno task codegen && tsdown && cd dist/ && bun test --timeout 60000"
120
+ "test:bun": "deno task codegen && tsdown && cd dist/ && bun test --timeout 60000",
121
+ "test:cfworkers": "deno task codegen && wrangler deploy --dry-run --outdir cfworkers && node --import=tsx cfworkers/client.ts"
117
122
  }
118
123
  }
@@ -1,19 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { CHAR_BACKWARD_SLASH, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, CHAR_UPPERCASE_A, CHAR_UPPERCASE_Z } from "../_common/constants.js";
6
-
7
- //#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/_util.js
8
- function isPosixPathSeparator(code) {
9
- return code === CHAR_FORWARD_SLASH;
10
- }
11
- function isPathSeparator(code) {
12
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
13
- }
14
- function isWindowsDeviceRoot(code) {
15
- return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
16
- }
17
-
18
- //#endregion
19
- export { isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot };
@@ -1,75 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
6
- import { CHAR_COLON } from "../_common/constants.js";
7
- import { isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot } from "./_util.js";
8
- import { assertArg$1 as assertArg } from "../_common/dirname.js";
9
-
10
- //#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js
11
- /**
12
- * Return the directory path of a `path`.
13
- *
14
- * @example Usage
15
- * ```ts
16
- * import { dirname } from "@std/path/windows/dirname";
17
- * import { assertEquals } from "@std/assert";
18
- *
19
- * const dir = dirname("C:\\foo\\bar\\baz.ext");
20
- * assertEquals(dir, "C:\\foo\\bar");
21
- * ```
22
- *
23
- * Note: If you are working with file URLs,
24
- * use the new version of `dirname` from `@std/path/windows/unstable-dirname`.
25
- *
26
- * @param path The path to get the directory from.
27
- * @returns The directory path.
28
- */ function dirname(path) {
29
- assertArg(path);
30
- const len = path.length;
31
- let rootEnd = -1;
32
- let end = -1;
33
- let matchedSlash = true;
34
- let offset = 0;
35
- const code = path.charCodeAt(0);
36
- if (len > 1) {
37
- if (isPathSeparator(code)) {
38
- rootEnd = offset = 1;
39
- if (isPathSeparator(path.charCodeAt(1))) {
40
- let j = 2;
41
- let last = j;
42
- for (; j < len; ++j) if (isPathSeparator(path.charCodeAt(j))) break;
43
- if (j < len && j !== last) {
44
- last = j;
45
- for (; j < len; ++j) if (!isPathSeparator(path.charCodeAt(j))) break;
46
- if (j < len && j !== last) {
47
- last = j;
48
- for (; j < len; ++j) if (isPathSeparator(path.charCodeAt(j))) break;
49
- if (j === len) return path;
50
- if (j !== last) rootEnd = offset = j + 1;
51
- }
52
- }
53
- }
54
- } else if (isWindowsDeviceRoot(code)) {
55
- if (path.charCodeAt(1) === CHAR_COLON) {
56
- rootEnd = offset = 2;
57
- if (len > 2) {
58
- if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
59
- }
60
- }
61
- }
62
- } else if (isPathSeparator(code)) return path;
63
- for (let i = len - 1; i >= offset; --i) if (isPathSeparator(path.charCodeAt(i))) {
64
- if (!matchedSlash) {
65
- end = i;
66
- break;
67
- }
68
- } else matchedSlash = false;
69
- if (end === -1) if (rootEnd === -1) return ".";
70
- else end = rootEnd;
71
- return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
72
- }
73
-
74
- //#endregion
75
- export { dirname as dirname$2 };
@@ -1,54 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { assertPath } from "../_common/assert_path.js";
6
- import { isPathSeparator } from "./_util.js";
7
- import { normalize$1 as normalize } from "./normalize.js";
8
-
9
- //#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/join.js
10
- /**
11
- * Join all given a sequence of `paths`,then normalizes the resulting path.
12
- *
13
- * @example Usage
14
- * ```ts
15
- * import { join } from "@std/path/windows/join";
16
- * import { assertEquals } from "@std/assert";
17
- *
18
- * const joined = join("C:\\foo", "bar", "baz\\..");
19
- * assertEquals(joined, "C:\\foo\\bar");
20
- * ```
21
- *
22
- * Note: If you are working with file URLs,
23
- * use the new version of `join` from `@std/path/windows/unstable-join`.
24
- *
25
- * @param paths The paths to join.
26
- * @returns The joined path.
27
- */ function join(...paths) {
28
- paths.forEach((path) => assertPath(path));
29
- paths = paths.filter((path) => path.length > 0);
30
- if (paths.length === 0) return ".";
31
- let needsReplace = true;
32
- let slashCount = 0;
33
- const firstPart = paths[0];
34
- if (isPathSeparator(firstPart.charCodeAt(0))) {
35
- ++slashCount;
36
- const firstLen = firstPart.length;
37
- if (firstLen > 1) {
38
- if (isPathSeparator(firstPart.charCodeAt(1))) {
39
- ++slashCount;
40
- if (firstLen > 2) if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
41
- else needsReplace = false;
42
- }
43
- }
44
- }
45
- let joined = paths.join("\\");
46
- if (needsReplace) {
47
- for (; slashCount < joined.length; ++slashCount) if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
48
- if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
49
- }
50
- return normalize(joined);
51
- }
52
-
53
- //#endregion
54
- export { join as join$2 };
@@ -1,87 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { CHAR_COLON } from "../_common/constants.js";
6
- import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
7
- import { assertArg$2 as assertArg } from "../_common/normalize.js";
8
- import { normalizeString } from "../_common/normalize_string.js";
9
-
10
- //#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js
11
- /**
12
- * Normalize the `path`, resolving `'..'` and `'.'` segments.
13
- * Note that resolving these segments does not necessarily mean that all will be eliminated.
14
- * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
15
- *
16
- * @example Usage
17
- * ```ts
18
- * import { normalize } from "@std/path/windows/normalize";
19
- * import { assertEquals } from "@std/assert";
20
- *
21
- * const normalized = normalize("C:\\foo\\..\\bar");
22
- * assertEquals(normalized, "C:\\bar");
23
- * ```
24
- *
25
- * Note: If you are working with file URLs,
26
- * use the new version of `normalize` from `@std/path/windows/unstable-normalize`.
27
- *
28
- * @param path The path to normalize
29
- * @returns The normalized path
30
- */ function normalize(path) {
31
- assertArg(path);
32
- const len = path.length;
33
- let rootEnd = 0;
34
- let device;
35
- let isAbsolute = false;
36
- const code = path.charCodeAt(0);
37
- if (len > 1) {
38
- if (isPathSeparator(code)) {
39
- isAbsolute = true;
40
- if (isPathSeparator(path.charCodeAt(1))) {
41
- let j = 2;
42
- let last = j;
43
- for (; j < len; ++j) if (isPathSeparator(path.charCodeAt(j))) break;
44
- if (j < len && j !== last) {
45
- const firstPart = path.slice(last, j);
46
- last = j;
47
- for (; j < len; ++j) if (!isPathSeparator(path.charCodeAt(j))) break;
48
- if (j < len && j !== last) {
49
- last = j;
50
- for (; j < len; ++j) if (isPathSeparator(path.charCodeAt(j))) break;
51
- if (j === len) return `\\\\${firstPart}\\${path.slice(last)}\\`;
52
- else if (j !== last) {
53
- device = `\\\\${firstPart}\\${path.slice(last, j)}`;
54
- rootEnd = j;
55
- }
56
- }
57
- }
58
- } else rootEnd = 1;
59
- } else if (isWindowsDeviceRoot(code)) {
60
- if (path.charCodeAt(1) === CHAR_COLON) {
61
- device = path.slice(0, 2);
62
- rootEnd = 2;
63
- if (len > 2) {
64
- if (isPathSeparator(path.charCodeAt(2))) {
65
- isAbsolute = true;
66
- rootEnd = 3;
67
- }
68
- }
69
- }
70
- }
71
- } else if (isPathSeparator(code)) return "\\";
72
- let tail;
73
- if (rootEnd < len) tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
74
- else tail = "";
75
- if (tail.length === 0 && !isAbsolute) tail = ".";
76
- if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) tail += "\\";
77
- if (device === void 0) {
78
- if (isAbsolute) if (tail.length > 0) return `\\${tail}`;
79
- else return "\\";
80
- return tail;
81
- } else if (isAbsolute) if (tail.length > 0) return `${device}\\${tail}`;
82
- else return `${device}\\`;
83
- return device + tail;
84
- }
85
-
86
- //#endregion
87
- export { normalize as normalize$1 };