@fedify/fedify 2.0.0-pr.458.1791 → 2.0.0-pr.467.1876

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 (121) hide show
  1. package/dist/{actor-B1Ok0M4n.cjs → actor-9gjVpXgd.cjs} +185 -185
  2. package/dist/{actor-Cca09Hlc.js → actor-CsH6QBYT.js} +185 -185
  3. package/dist/{actor-BjOdI0ZL.js → actor-D1LkZWVU.js} +1 -1
  4. package/dist/{builder-G4Si9uyR.js → builder-DCBCGtfN.js} +3 -3
  5. package/dist/compat/mod.d.cts +2 -3
  6. package/dist/compat/mod.d.ts +2 -3
  7. package/dist/compat/transformers.test.js +14 -14
  8. package/dist/{context-DJ8aSy2Q.d.cts → context-PxGADCsD.d.cts} +140 -3
  9. package/dist/{context-DG0huGW-.d.ts → context-V-XS2_6O.d.ts} +140 -3
  10. package/dist/{docloader-7NmfEq4O.js → docloader-BaWIuRb2.js} +2 -2
  11. package/dist/{esm-CXBuq5BO.js → esm-uX3RtJS9.js} +1 -1
  12. package/dist/federation/builder.test.js +4 -4
  13. package/dist/federation/collection.test.js +2 -2
  14. package/dist/federation/handler.test.js +15 -15
  15. package/dist/federation/idempotency.test.js +15 -15
  16. package/dist/federation/inbox.test.js +3 -3
  17. package/dist/federation/keycache.test.js +3 -3
  18. package/dist/federation/kv.test.js +2 -2
  19. package/dist/federation/middleware.test.js +16 -16
  20. package/dist/federation/mod.cjs +7 -7
  21. package/dist/federation/mod.d.cts +2 -3
  22. package/dist/federation/mod.d.ts +2 -3
  23. package/dist/federation/mod.js +7 -7
  24. package/dist/federation/mq.test.js +6 -4
  25. package/dist/federation/negotiation.test.js +2 -2
  26. package/dist/federation/retry.test.js +2 -2
  27. package/dist/federation/router.test.js +2 -2
  28. package/dist/federation/send.test.js +9 -9
  29. package/dist/{http-CaEsjA2G.js → http-C5NpY8dE.js} +2 -2
  30. package/dist/{http-Cs287TmP.js → http-Cw6Nfbii.js} +2 -2
  31. package/dist/{http-DUTeGoKz.cjs → http-zanXjqHu.cjs} +2 -2
  32. package/dist/{inbox-CWHlU-4p.js → inbox-Bu3THMpw.js} +1 -1
  33. package/dist/{key-DEdR04Ab.js → key-KT2Sua_C.js} +2 -2
  34. package/dist/{keycache-BviIhg2b.js → keycache-CH77mwdO.js} +1 -1
  35. package/dist/{keys-CHylGW0O.js → keys-DM8I6W_Z.js} +1 -1
  36. package/dist/{kv-cache-BZnZAYno.js → kv-cache-DspkH6f2.js} +1 -1
  37. package/dist/{kv-cache-CZGTfHxH.cjs → kv-cache-DxziE8JZ.cjs} +1 -1
  38. package/dist/{ld-CImM10Xd.js → ld-RF_UxhNp.js} +2 -2
  39. package/dist/{lookup-BQkOrVtQ.js → lookup-D029Hgmr.js} +187 -192
  40. package/dist/{lookup-CxaofAPS.js → lookup-EXeITSkB.js} +3 -8
  41. package/dist/{lookup-CmWpZY_M.cjs → lookup-ZMUieFn0.cjs} +3 -8
  42. package/dist/middleware-BuhoXDtM.js +15 -0
  43. package/dist/middleware-C2X56NUR.cjs +15 -0
  44. package/dist/{middleware-CZBCqMIK.js → middleware-C32-qFyf.js} +7 -7
  45. package/dist/{middleware-CHrx6VCp.js → middleware-CI-4cLU9.js} +11 -11
  46. package/dist/{middleware-DehGSDBK.cjs → middleware-CMT8W2oG.cjs} +7 -7
  47. package/dist/middleware-DWijkoj4.js +26 -0
  48. package/dist/{mod-DJcZDvjA.d.cts → mod-BoRKfJPE.d.cts} +1 -1
  49. package/dist/{mod-BoHnwOCs.d.ts → mod-Cdo6SYlJ.d.ts} +1 -1
  50. package/dist/mod.cjs +7 -7
  51. package/dist/mod.d.cts +5 -6
  52. package/dist/mod.d.ts +5 -6
  53. package/dist/mod.js +7 -7
  54. package/dist/nodeinfo/client.test.js +3 -3
  55. package/dist/nodeinfo/handler.test.js +14 -14
  56. package/dist/nodeinfo/mod.d.cts +1 -1
  57. package/dist/nodeinfo/mod.d.ts +1 -1
  58. package/dist/nodeinfo/types.test.js +2 -2
  59. package/dist/{owner-C5k5U7z5.js → owner-6JbsaBQB.js} +2 -2
  60. package/dist/{proof-QPC0OByc.cjs → proof-CB7YKfl6.cjs} +3 -3
  61. package/dist/{proof-0QlPOspl.js → proof-D8SPvADT.js} +3 -3
  62. package/dist/{proof-DGsrnIEU.js → proof-gHlNO1tx.js} +2 -2
  63. package/dist/{send-BXuinmF1.js → send-CmpkYTnR.js} +2 -2
  64. package/dist/sig/http.test.js +7 -7
  65. package/dist/sig/key.test.js +5 -5
  66. package/dist/sig/ld.test.js +6 -6
  67. package/dist/sig/mod.cjs +4 -4
  68. package/dist/sig/mod.d.cts +1 -1
  69. package/dist/sig/mod.d.ts +1 -1
  70. package/dist/sig/mod.js +4 -4
  71. package/dist/sig/owner.test.js +6 -6
  72. package/dist/sig/proof.test.js +6 -6
  73. package/dist/testing/docloader.test.js +2 -2
  74. package/dist/testing/mod.js +2 -2
  75. package/dist/{testing-D4BaH0xH.js → testing-BJ493d9l.js} +1 -1
  76. package/dist/utils/docloader.test.js +8 -8
  77. package/dist/utils/kv-cache.test.js +2 -2
  78. package/dist/utils/mod.cjs +4 -4
  79. package/dist/utils/mod.d.cts +1 -1
  80. package/dist/utils/mod.d.ts +1 -1
  81. package/dist/utils/mod.js +4 -4
  82. package/dist/vocab/actor.test.js +4 -4
  83. package/dist/vocab/lookup.test.js +3 -3
  84. package/dist/vocab/mod.cjs +3 -3
  85. package/dist/vocab/mod.js +3 -3
  86. package/dist/vocab/type.test.js +2 -2
  87. package/dist/vocab/vocab.test.js +3 -3
  88. package/dist/{vocab-Bh3jSO8n.js → vocab-BY_op-IW.js} +2 -2
  89. package/dist/{vocab-lZ1-2A_O.cjs → vocab-I0FskT0s.cjs} +2 -2
  90. package/dist/webfinger/handler.test.js +14 -14
  91. package/dist/webfinger/lookup.test.js +3 -3
  92. package/dist/webfinger/mod.cjs +1 -1
  93. package/dist/webfinger/mod.js +1 -1
  94. package/package.json +5 -36
  95. package/dist/denokv-CCssOzMJ.js +0 -57
  96. package/dist/middleware-BXYjRNT8.js +0 -15
  97. package/dist/middleware-BiG0cANp.cjs +0 -15
  98. package/dist/middleware-DTljmOoB.js +0 -26
  99. package/dist/mq-CUKlBw08.d.ts +0 -143
  100. package/dist/mq-DcJPkXD5.d.cts +0 -140
  101. package/dist/vocab/schema.yaml +0 -247
  102. package/dist/x/cfworkers.cjs +0 -100
  103. package/dist/x/cfworkers.d.cts +0 -59
  104. package/dist/x/cfworkers.d.ts +0 -61
  105. package/dist/x/cfworkers.js +0 -98
  106. package/dist/x/cfworkers.test.d.ts +0 -3
  107. package/dist/x/cfworkers.test.js +0 -177
  108. package/dist/x/hono.cjs +0 -61
  109. package/dist/x/hono.d.cts +0 -53
  110. package/dist/x/hono.d.ts +0 -55
  111. package/dist/x/hono.js +0 -60
  112. package/dist/x/sveltekit.cjs +0 -69
  113. package/dist/x/sveltekit.d.cts +0 -45
  114. package/dist/x/sveltekit.d.ts +0 -47
  115. package/dist/x/sveltekit.js +0 -68
  116. /package/dist/{mod-C2tOeRkN.d.cts → mod-CcDPcLJW.d.cts} +0 -0
  117. /package/dist/{mod-B2iOw50L.d.ts → mod-D5Z2tISD.d.ts} +0 -0
  118. /package/dist/{mod-0noXw66R.d.cts → mod-DMpuiKXi.d.cts} +0 -0
  119. /package/dist/{mod-DgdBYYa0.d.cts → mod-DgxG-byT.d.cts} +0 -0
  120. /package/dist/{mod-B9M-8jm2.d.ts → mod-aAE2wOWV.d.ts} +0 -0
  121. /package/dist/{mod-xIj-IT58.d.ts → mod-bjzj5QIb.d.ts} +0 -0
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./lookup-BQkOrVtQ.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-CHrx6VCp.js";
8
- import "./client-pY7-3icS.js";
9
- import "./types-C2XVl6gj.js";
10
- import "./actor-BjOdI0ZL.js";
11
- import "./key-DEdR04Ab.js";
12
- import "./http-CaEsjA2G.js";
13
- import "./ld-CImM10Xd.js";
14
- import "./owner-C5k5U7z5.js";
15
- import "./proof-DGsrnIEU.js";
16
- import "./docloader-7NmfEq4O.js";
17
- import "./kv-cache-DN9pfMBe.js";
18
- import "./inbox-CWHlU-4p.js";
19
- import "./builder-G4Si9uyR.js";
20
- import "./collection-BzWsN9pB.js";
21
- import "./keycache-BviIhg2b.js";
22
- import "./negotiation-C4nFufNk.js";
23
- import "./retry-CfF8Gn4d.js";
24
- import "./send-BXuinmF1.js";
25
-
26
- export { FederationImpl };
@@ -1,143 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
-
4
- //#region src/federation/mq.d.ts
5
- /**
6
- * Additional options for enqueuing a message in a queue.
7
- *
8
- * @since 0.5.0
9
- */
10
- interface MessageQueueEnqueueOptions {
11
- /**
12
- * The delay before the message is enqueued. No delay by default.
13
- *
14
- * It must not be negative.
15
- */
16
- delay?: Temporal.Duration;
17
- }
18
- /**
19
- * Additional options for listening to a message queue.
20
- *
21
- * @since 1.0.0
22
- */
23
- interface MessageQueueListenOptions {
24
- /**
25
- * The signal to abort listening to the message queue.
26
- */
27
- signal?: AbortSignal;
28
- }
29
- /**
30
- * An abstract interface for a message queue.
31
- *
32
- * @since 0.5.0
33
- */
34
- interface MessageQueue {
35
- /**
36
- * Whether the message queue backend provides native retry mechanisms.
37
- * When `true`, Fedify will skip its own retry logic and rely on the backend
38
- * to handle retries. When `false` or omitted, Fedify will handle retries
39
- * using its own retry policies.
40
- *
41
- * @default `false`
42
- * @since 1.7.0
43
- */
44
- readonly nativeRetrial?: boolean;
45
- /**
46
- * Enqueues a message in the queue.
47
- * @param message The message to enqueue.
48
- * @param options Additional options for enqueuing the message.
49
- */
50
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
51
- /**
52
- * Enqueues multiple messages in the queue. This operation is optional,
53
- * and may not be supported by all implementations. If not supported,
54
- * Fedify will invoke {@link enqueue} for each message.
55
- *
56
- * @param messages The messages to enqueue.
57
- * @param options Additional options for enqueuing the messages.
58
- */
59
- enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
60
- /**
61
- * Listens for messages in the queue.
62
- * @param handler The handler for messages in the queue.
63
- * @param options Additional options for listening to the message queue.
64
- * @returns A promise that resolves when the listening is done. It never
65
- * rejects, and is resolved when the signal is aborted. If no
66
- * signal is provided, it never resolves.
67
- */
68
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
69
- }
70
- /**
71
- * Additional options for {@link InProcessMessageQueue}.
72
- * @since 1.0.0
73
- */
74
- interface InProcessMessageQueueOptions {
75
- /**
76
- * The interval to poll for messages in the queue. 5 seconds by default.
77
- * @default `{ seconds: 5 }`
78
- */
79
- pollInterval?: Temporal.Duration | Temporal.DurationLike;
80
- }
81
- /**
82
- * A message queue that processes messages in the same process.
83
- * Do not use this in production as it does neither persist messages nor
84
- * distribute them across multiple processes.
85
- *
86
- * @since 0.5.0
87
- */
88
- declare class InProcessMessageQueue implements MessageQueue {
89
- #private;
90
- /**
91
- * In-process message queue does not provide native retry mechanisms.
92
- * @since 1.7.0
93
- */
94
- readonly nativeRetrial = false;
95
- /**
96
- * Constructs a new {@link InProcessMessageQueue} with the given options.
97
- * @param options Additional options for the in-process message queue.
98
- */
99
- constructor(options?: InProcessMessageQueueOptions);
100
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
101
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
102
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
103
- }
104
- /**
105
- * A message queue that processes messages in parallel. It takes another
106
- * {@link MessageQueue}, and processes messages in parallel up to a certain
107
- * number of workers.
108
- *
109
- * Actually, it's rather a decorator than a queue itself.
110
- *
111
- * Note that the workers do not run in truly parallel, in the sense that they
112
- * are not running in separate threads or processes. They are running in the
113
- * same process, but are scheduled to run in parallel. Hence, this is useful
114
- * for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
115
- * workloads.
116
- *
117
- * @since 1.0.0
118
- */
119
- declare class ParallelMessageQueue implements MessageQueue {
120
- #private;
121
- readonly queue: MessageQueue;
122
- readonly workers: number;
123
- /**
124
- * Inherits the native retry capability from the wrapped queue.
125
- * @since 1.7.0
126
- */
127
- readonly nativeRetrial?: boolean;
128
- /**
129
- * Constructs a new {@link ParallelMessageQueue} with the given queue and
130
- * number of workers.
131
- * @param queue The message queue to use under the hood. Note that
132
- * {@link ParallelMessageQueue} cannot be nested.
133
- * @param workers The number of workers to process messages in parallel.
134
- * @throws {TypeError} If the given queue is an instance of
135
- * {@link ParallelMessageQueue}.
136
- */
137
- constructor(queue: MessageQueue, workers: number);
138
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
139
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
140
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
141
- }
142
- //#endregion
143
- export { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue };
@@ -1,140 +0,0 @@
1
- //#region src/federation/mq.d.ts
2
- /**
3
- * Additional options for enqueuing a message in a queue.
4
- *
5
- * @since 0.5.0
6
- */
7
- interface MessageQueueEnqueueOptions {
8
- /**
9
- * The delay before the message is enqueued. No delay by default.
10
- *
11
- * It must not be negative.
12
- */
13
- delay?: Temporal.Duration;
14
- }
15
- /**
16
- * Additional options for listening to a message queue.
17
- *
18
- * @since 1.0.0
19
- */
20
- interface MessageQueueListenOptions {
21
- /**
22
- * The signal to abort listening to the message queue.
23
- */
24
- signal?: AbortSignal;
25
- }
26
- /**
27
- * An abstract interface for a message queue.
28
- *
29
- * @since 0.5.0
30
- */
31
- interface MessageQueue {
32
- /**
33
- * Whether the message queue backend provides native retry mechanisms.
34
- * When `true`, Fedify will skip its own retry logic and rely on the backend
35
- * to handle retries. When `false` or omitted, Fedify will handle retries
36
- * using its own retry policies.
37
- *
38
- * @default `false`
39
- * @since 1.7.0
40
- */
41
- readonly nativeRetrial?: boolean;
42
- /**
43
- * Enqueues a message in the queue.
44
- * @param message The message to enqueue.
45
- * @param options Additional options for enqueuing the message.
46
- */
47
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
48
- /**
49
- * Enqueues multiple messages in the queue. This operation is optional,
50
- * and may not be supported by all implementations. If not supported,
51
- * Fedify will invoke {@link enqueue} for each message.
52
- *
53
- * @param messages The messages to enqueue.
54
- * @param options Additional options for enqueuing the messages.
55
- */
56
- enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
57
- /**
58
- * Listens for messages in the queue.
59
- * @param handler The handler for messages in the queue.
60
- * @param options Additional options for listening to the message queue.
61
- * @returns A promise that resolves when the listening is done. It never
62
- * rejects, and is resolved when the signal is aborted. If no
63
- * signal is provided, it never resolves.
64
- */
65
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
66
- }
67
- /**
68
- * Additional options for {@link InProcessMessageQueue}.
69
- * @since 1.0.0
70
- */
71
- interface InProcessMessageQueueOptions {
72
- /**
73
- * The interval to poll for messages in the queue. 5 seconds by default.
74
- * @default `{ seconds: 5 }`
75
- */
76
- pollInterval?: Temporal.Duration | Temporal.DurationLike;
77
- }
78
- /**
79
- * A message queue that processes messages in the same process.
80
- * Do not use this in production as it does neither persist messages nor
81
- * distribute them across multiple processes.
82
- *
83
- * @since 0.5.0
84
- */
85
- declare class InProcessMessageQueue implements MessageQueue {
86
- #private;
87
- /**
88
- * In-process message queue does not provide native retry mechanisms.
89
- * @since 1.7.0
90
- */
91
- readonly nativeRetrial = false;
92
- /**
93
- * Constructs a new {@link InProcessMessageQueue} with the given options.
94
- * @param options Additional options for the in-process message queue.
95
- */
96
- constructor(options?: InProcessMessageQueueOptions);
97
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
98
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
99
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
100
- }
101
- /**
102
- * A message queue that processes messages in parallel. It takes another
103
- * {@link MessageQueue}, and processes messages in parallel up to a certain
104
- * number of workers.
105
- *
106
- * Actually, it's rather a decorator than a queue itself.
107
- *
108
- * Note that the workers do not run in truly parallel, in the sense that they
109
- * are not running in separate threads or processes. They are running in the
110
- * same process, but are scheduled to run in parallel. Hence, this is useful
111
- * for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
112
- * workloads.
113
- *
114
- * @since 1.0.0
115
- */
116
- declare class ParallelMessageQueue implements MessageQueue {
117
- #private;
118
- readonly queue: MessageQueue;
119
- readonly workers: number;
120
- /**
121
- * Inherits the native retry capability from the wrapped queue.
122
- * @since 1.7.0
123
- */
124
- readonly nativeRetrial?: boolean;
125
- /**
126
- * Constructs a new {@link ParallelMessageQueue} with the given queue and
127
- * number of workers.
128
- * @param queue The message queue to use under the hood. Note that
129
- * {@link ParallelMessageQueue} cannot be nested.
130
- * @param workers The number of workers to process messages in parallel.
131
- * @throws {TypeError} If the given queue is an instance of
132
- * {@link ParallelMessageQueue}.
133
- */
134
- constructor(queue: MessageQueue, workers: number);
135
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
136
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
137
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
138
- }
139
- //#endregion
140
- export { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue };
@@ -1,247 +0,0 @@
1
- $schema: "https://json-schema.org/draft/2020-12/schema"
2
- title: Fedify model schema
3
-
4
- $defs:
5
- property:
6
- description: >-
7
- The schema of a property. It is used to generate property accessors of
8
- a class.
9
- anyOf:
10
- - allOf:
11
- - $ref: "#/$defs/property-base"
12
- - $ref: "#/$defs/property-typing"
13
- - type: object
14
- properties:
15
- functional:
16
- description: &functional-description >-
17
- Marks the property that it can have only one value. Turning on
18
- this flag will generate only singular property accessors,
19
- so pluralName and singularAccessor should not be specified.
20
- const: false
21
- pluralName:
22
- description: >-
23
- The plural form of the property name. It is used as the name of
24
- the generated property accessors.
25
- type: string
26
- singularAccessor:
27
- description: >-
28
- Whether to generate singular property accessors. Regardless of
29
- this flag, plural property accessors are generated
30
- (unless functional is turned on).
31
- type: boolean
32
- container:
33
- description: >-
34
- The container type of the property values. It can be unspecified.
35
- enum:
36
- - graph
37
- - list
38
- required:
39
- - pluralName
40
- - allOf:
41
- - $ref: "#/$defs/property-base"
42
- - $ref: "#/$defs/property-typing"
43
- - type: object
44
- properties:
45
- functional:
46
- description: *functional-description
47
- const: true
48
- redundantProperties::
49
- description: >-
50
- If it's present, those redundant properties are also filled with
51
- the same value altogether when the object is serialized into
52
- JSON-LD. When it's deserialized from JSON-LD, it tries to
53
- parse the values of the specified properties in order.
54
- type: array
55
- items:
56
- type: object
57
- properties:
58
- uri:
59
- description: The qualified URI of the property.
60
- type: string
61
- format: uri
62
- compactName:
63
- description: >-
64
- The property name used in the compacted JSON-LD document.
65
- It is used as the key of the property.
66
- type: string
67
- required:
68
- - uri
69
- required:
70
- - functional
71
-
72
- property-base:
73
- type: object
74
- properties:
75
- singularName:
76
- description: >-
77
- The singular form of the property name. It is used as the name of the
78
- generated property accessors.
79
- type: string
80
- uri:
81
- description: The qualified URI of the property.
82
- type: string
83
- format: uri
84
- compactName:
85
- description: >-
86
- The property name used in the compacted JSON-LD document. It is used
87
- as the key of the property.
88
- type: string
89
- subpropertyOf:
90
- description: >-
91
- The qualified URI of the superproperty of the property (if any).
92
- It means that the property is a specialization of the referenced
93
- property.
94
- type: string
95
- format: uri
96
- description:
97
- description: >-
98
- The description of the property. It is used as the doc comment of
99
- the generated property accessors.
100
- type: string
101
- embedContext:
102
- description: >-
103
- Whether the enclosed object should have its own context when
104
- the document is compacted.
105
- type: object
106
- properties:
107
- compactName:
108
- description: >-
109
- The compact name of the property that contains the context.
110
- type: string
111
- inherit:
112
- description: >-
113
- Whether the embedded context should be the same as the context of
114
- the enclosing document.
115
- const: true
116
- required:
117
- - singularName
118
- - uri
119
- - description
120
-
121
- property-typing:
122
- anyOf:
123
- - type: object
124
- properties:
125
- untyped:
126
- description: >-
127
- Whether the property value has @type field. If true, the range must
128
- have only one element.
129
- const: false
130
- range:
131
- description: >-
132
- The qualified URIs of all possible types of the property values.
133
- type: array
134
- items:
135
- $ref: "#/$defs/typeUri"
136
- minItems: 1
137
- uniqueItems: true
138
- required:
139
- - range
140
- - type: object
141
- properties:
142
- untyped:
143
- description: >-
144
- Whether the property value has @type field. If true, the range must
145
- have only one element.
146
- const: true
147
- range:
148
- description: >-
149
- The qualified URIs of all possible types of the property values.
150
- type: array
151
- items:
152
- $ref: "#/$defs/typeUri"
153
- minItems: 1
154
- maxItems: 1
155
- required:
156
- - untyped
157
- - range
158
-
159
- typeUri:
160
- description: >-
161
- The qualified URI of a type. It is used as the range of a property.
162
- anyOf:
163
- - type: string
164
- format: uri
165
- - enum:
166
- - fedify:langTag
167
-
168
- ldContext:
169
- anyOf:
170
- - type: string
171
- format: uri
172
- - $ref: "#/$defs/ldEmbeddedContext"
173
- - type: array
174
- items:
175
- anyOf:
176
- - type: string
177
- format: uri
178
- - $ref: "#/$defs/ldEmbeddedContext"
179
- uniqueItems: true
180
-
181
- ldEmbeddedContext:
182
- type: object
183
- patternProperties:
184
- "^.+$":
185
- $ref: "#/$defs/ldTermDefinition"
186
-
187
- ldTermDefinition:
188
- anyOf:
189
- - type: string
190
- format: uri
191
- - type: object
192
- patternProperties:
193
- "^.+$":
194
- anyOf:
195
- - type: string
196
- format: uri
197
- - const: "@id"
198
-
199
- description: The schema of a type. It is used to generate a class.
200
- type: object
201
- properties:
202
- name:
203
- description: The type name. It is used as the name of the generated class.
204
- type: string
205
- uri:
206
- description: The qualified URI of the type.
207
- type: string
208
- format: uri
209
- compactName:
210
- description: >-
211
- The type name used in the compacted JSON-LD document. It is used as the
212
- value of the `type` field.
213
- type: string
214
- extends:
215
- description: The qualified URIs of the base type of the type (if any).
216
- type: string
217
- format: uri
218
- entity:
219
- description: >-
220
- Marks the type an entity type rather than a value type. Turning on this
221
- flag will make property accessors for the type asynchronous, so that they
222
- can load the values of the properties from the remote server.
223
-
224
- The extended subtypes must have the consistent value of this flag.
225
- type: boolean
226
- description:
227
- description: >-
228
- The description of the type. It is used as the doc comment of
229
- the generated class.
230
- type: string
231
- properties:
232
- description: The possible properties of the type.
233
- type: array
234
- items:
235
- $ref: "#/$defs/property"
236
- uniqueItems: true
237
- defaultContext:
238
- description: >-
239
- The default JSON-LD context of the type. It is used as the default
240
- context of the generated toJsonLd() method.
241
- $ref: "#/$defs/ldContext"
242
- required:
243
- - name
244
- - uri
245
- - entity
246
- - description
247
- - properties
@@ -1,100 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- const require_chunk = require('../chunk-DqRYRqnO.cjs');
6
- const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
7
-
8
- //#region src/x/cfworkers.ts
9
- /**
10
- * Implementation of the {@link KvStore} interface for Cloudflare Workers KV
11
- * binding. This class provides a wrapper around Cloudflare's KV namespace to
12
- * store and retrieve JSON-serializable values using structured keys.
13
- *
14
- * Note that this implementation does not support the {@link KvStore.cas}
15
- * operation, as Cloudflare Workers KV does not support atomic compare-and-swap
16
- * operations. If you need this functionality, consider using a different
17
- * key–value store that supports atomic operations.
18
- *
19
- * @deprecated This class has been moved to `@fedify/cfworkers` package.
20
- * Import `WorkersKvStore` from `@fedify/cfworkers` instead.
21
- * This class will be removed in Fedify v2.0.
22
- * @since 1.6.0
23
- */
24
- var WorkersKvStore = class {
25
- #namespace;
26
- constructor(namespace) {
27
- const logger = (0, __logtape_logtape.getLogger)(["fedify", "cfworkers"]);
28
- logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersKvStore` from `@fedify/cfworkers` package instead.");
29
- this.#namespace = namespace;
30
- }
31
- #encodeKey(key) {
32
- return JSON.stringify(key);
33
- }
34
- async get(key) {
35
- const encodedKey = this.#encodeKey(key);
36
- const { value, metadata } = await this.#namespace.getWithMetadata(encodedKey, "json");
37
- return metadata == null || metadata.expires < Date.now() ? void 0 : value;
38
- }
39
- async set(key, value, options) {
40
- const encodedKey = this.#encodeKey(key);
41
- const metadata = options?.ttl == null ? {} : { expires: Date.now() + options.ttl.total("milliseconds") };
42
- await this.#namespace.put(encodedKey, JSON.stringify(value), options?.ttl == null ? { metadata } : {
43
- expirationTtl: Math.max(options.ttl.total("seconds"), 60),
44
- metadata
45
- });
46
- }
47
- delete(key) {
48
- return this.#namespace.delete(this.#encodeKey(key));
49
- }
50
- };
51
- /**
52
- * Implementation of the {@link MessageQueue} interface for Cloudflare
53
- * Workers Queues binding. This class provides a wrapper around Cloudflare's
54
- * Queues to send messages to a queue.
55
- *
56
- * Note that this implementation does not support the `listen()` method,
57
- * as Cloudflare Workers Queues do not support message consumption in the same
58
- * way as other message queue systems. Instead, you should use
59
- * the {@link Federation.processQueuedTask} method to process messages
60
- * passed to the queue.
61
- *
62
- * @deprecated This class has been moved to `@fedify/cfworkers` package.
63
- * Import `WorkersMessageQueue` from `@fedify/cfworkers` instead.
64
- * This class will be removed in Fedify v2.0.
65
- * @since 1.6.0
66
- */
67
- var WorkersMessageQueue = class {
68
- #queue;
69
- /**
70
- * Cloudflare Queues provide automatic retry with exponential backoff
71
- * and Dead Letter Queues.
72
- * @since 1.7.0
73
- */
74
- nativeRetrial = true;
75
- constructor(queue) {
76
- const logger = (0, __logtape_logtape.getLogger)(["fedify", "cfworkers"]);
77
- logger.warn("The `@fedify/fedify/x/cfworkers` module is deprecated; use `WorkersMessageQueue` from `@fedify/cfworkers` package instead.");
78
- this.#queue = queue;
79
- }
80
- enqueue(message, options) {
81
- return this.#queue.send(message, {
82
- contentType: "json",
83
- delaySeconds: options?.delay?.total("seconds") ?? 0
84
- });
85
- }
86
- enqueueMany(messages, options) {
87
- const requests = messages.map((msg) => ({
88
- body: msg,
89
- contentType: "json"
90
- }));
91
- return this.#queue.sendBatch(requests, { delaySeconds: options?.delay?.total("seconds") ?? 0 });
92
- }
93
- listen(_handler, _options) {
94
- throw new TypeError("WorkersMessageQueue does not support listen(). Use Federation.processQueuedTask() method instead.");
95
- }
96
- };
97
-
98
- //#endregion
99
- exports.WorkersKvStore = WorkersKvStore;
100
- exports.WorkersMessageQueue = WorkersMessageQueue;