@fedify/fedify 2.0.0-pr.458.1796 → 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.
- package/dist/{actor-DPWo8e6F.cjs → actor-9gjVpXgd.cjs} +185 -185
- package/dist/{actor-D5sOur2R.js → actor-CsH6QBYT.js} +185 -185
- package/dist/{actor-DVMBUtCV.js → actor-D1LkZWVU.js} +1 -1
- package/dist/{builder-CExUnivT.js → builder-DCBCGtfN.js} +3 -3
- package/dist/compat/mod.d.cts +2 -3
- package/dist/compat/mod.d.ts +2 -3
- package/dist/compat/transformers.test.js +14 -14
- package/dist/{context-DJ8aSy2Q.d.cts → context-PxGADCsD.d.cts} +140 -3
- package/dist/{context-DG0huGW-.d.ts → context-V-XS2_6O.d.ts} +140 -3
- package/dist/{docloader-D0GvHC51.js → docloader-BaWIuRb2.js} +2 -2
- package/dist/{esm-Dx1ANaUf.js → esm-uX3RtJS9.js} +1 -1
- package/dist/federation/builder.test.js +4 -4
- package/dist/federation/collection.test.js +2 -2
- package/dist/federation/handler.test.js +15 -15
- package/dist/federation/idempotency.test.js +15 -15
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +3 -3
- package/dist/federation/kv.test.js +2 -2
- package/dist/federation/middleware.test.js +16 -16
- package/dist/federation/mod.cjs +7 -7
- package/dist/federation/mod.d.cts +2 -3
- package/dist/federation/mod.d.ts +2 -3
- package/dist/federation/mod.js +7 -7
- package/dist/federation/mq.test.js +6 -4
- package/dist/federation/negotiation.test.js +2 -2
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +2 -2
- package/dist/federation/send.test.js +9 -9
- package/dist/{http-BSN6RQOC.js → http-C5NpY8dE.js} +2 -2
- package/dist/{http-Cei_vVzc.js → http-Cw6Nfbii.js} +2 -2
- package/dist/{http-DGcqtcol.cjs → http-zanXjqHu.cjs} +2 -2
- package/dist/{inbox-9IhtKqHT.js → inbox-Bu3THMpw.js} +1 -1
- package/dist/{key-m63kqSGm.js → key-KT2Sua_C.js} +2 -2
- package/dist/{keycache-BZvso79n.js → keycache-CH77mwdO.js} +1 -1
- package/dist/{keys-C3Onp7Fd.js → keys-DM8I6W_Z.js} +1 -1
- package/dist/{kv-cache--RKYzX3Q.js → kv-cache-DspkH6f2.js} +1 -1
- package/dist/{kv-cache-tUGFCM0H.cjs → kv-cache-DxziE8JZ.cjs} +1 -1
- package/dist/{ld-BkW6zBWj.js → ld-RF_UxhNp.js} +2 -2
- package/dist/{lookup-DgpTsAyI.js → lookup-D029Hgmr.js} +187 -192
- package/dist/{lookup-Bl3pwcyk.js → lookup-EXeITSkB.js} +3 -8
- package/dist/{lookup-DkCTtfbf.cjs → lookup-ZMUieFn0.cjs} +3 -8
- package/dist/middleware-BuhoXDtM.js +15 -0
- package/dist/middleware-C2X56NUR.cjs +15 -0
- package/dist/{middleware-BKkWaVlz.js → middleware-C32-qFyf.js} +7 -7
- package/dist/{middleware-By89ws1y.js → middleware-CI-4cLU9.js} +11 -11
- package/dist/{middleware-Cs-UBi-8.cjs → middleware-CMT8W2oG.cjs} +7 -7
- package/dist/middleware-DWijkoj4.js +26 -0
- package/dist/{mod-DJcZDvjA.d.cts → mod-BoRKfJPE.d.cts} +1 -1
- package/dist/{mod-BoHnwOCs.d.ts → mod-Cdo6SYlJ.d.ts} +1 -1
- package/dist/mod.cjs +7 -7
- package/dist/mod.d.cts +5 -6
- package/dist/mod.d.ts +5 -6
- package/dist/mod.js +7 -7
- package/dist/nodeinfo/client.test.js +3 -3
- package/dist/nodeinfo/handler.test.js +14 -14
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/nodeinfo/types.test.js +2 -2
- package/dist/{owner-BVcVlOj2.js → owner-6JbsaBQB.js} +2 -2
- package/dist/{proof-BO4lGs3o.cjs → proof-CB7YKfl6.cjs} +3 -3
- package/dist/{proof-DHvk0L4Q.js → proof-D8SPvADT.js} +3 -3
- package/dist/{proof-pdiYnkHt.js → proof-gHlNO1tx.js} +2 -2
- package/dist/{send-BJrafhoh.js → send-CmpkYTnR.js} +2 -2
- package/dist/sig/http.test.js +7 -7
- package/dist/sig/key.test.js +5 -5
- package/dist/sig/ld.test.js +6 -6
- package/dist/sig/mod.cjs +4 -4
- package/dist/sig/mod.d.cts +1 -1
- package/dist/sig/mod.d.ts +1 -1
- package/dist/sig/mod.js +4 -4
- package/dist/sig/owner.test.js +6 -6
- package/dist/sig/proof.test.js +6 -6
- package/dist/testing/docloader.test.js +2 -2
- package/dist/testing/mod.js +2 -2
- package/dist/{testing-DQu183XY.js → testing-BJ493d9l.js} +1 -1
- package/dist/utils/docloader.test.js +8 -8
- package/dist/utils/kv-cache.test.js +2 -2
- package/dist/utils/mod.cjs +4 -4
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +4 -4
- package/dist/vocab/actor.test.js +4 -4
- package/dist/vocab/lookup.test.js +3 -3
- package/dist/vocab/mod.cjs +3 -3
- package/dist/vocab/mod.js +3 -3
- package/dist/vocab/type.test.js +2 -2
- package/dist/vocab/vocab.test.js +3 -3
- package/dist/{vocab-D7w9PSpd.js → vocab-BY_op-IW.js} +2 -2
- package/dist/{vocab-DPJyg4oW.cjs → vocab-I0FskT0s.cjs} +2 -2
- package/dist/webfinger/handler.test.js +14 -14
- package/dist/webfinger/lookup.test.js +3 -3
- package/dist/webfinger/mod.cjs +1 -1
- package/dist/webfinger/mod.js +1 -1
- package/package.json +5 -36
- package/dist/denokv-CCssOzMJ.js +0 -57
- package/dist/middleware-C4qOO14D.js +0 -26
- package/dist/middleware-CGfrkoHW.js +0 -15
- package/dist/middleware-CsQiHdGR.cjs +0 -15
- package/dist/mq-CUKlBw08.d.ts +0 -143
- package/dist/mq-DcJPkXD5.d.cts +0 -140
- package/dist/vocab/schema.yaml +0 -247
- package/dist/x/cfworkers.cjs +0 -100
- package/dist/x/cfworkers.d.cts +0 -59
- package/dist/x/cfworkers.d.ts +0 -61
- package/dist/x/cfworkers.js +0 -98
- package/dist/x/cfworkers.test.d.ts +0 -3
- package/dist/x/cfworkers.test.js +0 -177
- package/dist/x/hono.cjs +0 -61
- package/dist/x/hono.d.cts +0 -53
- package/dist/x/hono.d.ts +0 -55
- package/dist/x/hono.js +0 -60
- package/dist/x/sveltekit.cjs +0 -69
- package/dist/x/sveltekit.d.cts +0 -45
- package/dist/x/sveltekit.d.ts +0 -47
- package/dist/x/sveltekit.js +0 -68
- /package/dist/{mod-C2tOeRkN.d.cts → mod-CcDPcLJW.d.cts} +0 -0
- /package/dist/{mod-B2iOw50L.d.ts → mod-D5Z2tISD.d.ts} +0 -0
- /package/dist/{mod-0noXw66R.d.cts → mod-DMpuiKXi.d.cts} +0 -0
- /package/dist/{mod-DgdBYYa0.d.cts → mod-DgxG-byT.d.cts} +0 -0
- /package/dist/{mod-B9M-8jm2.d.ts → mod-aAE2wOWV.d.ts} +0 -0
- /package/dist/{mod-xIj-IT58.d.ts → mod-bjzj5QIb.d.ts} +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
5
|
-
import "./transformers-BFT6d7J5.js";
|
|
6
|
-
import "./lookup-Bl3pwcyk.js";
|
|
7
|
-
import "./actor-D5sOur2R.js";
|
|
8
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-BKkWaVlz.js";
|
|
9
|
-
import "./http-Cei_vVzc.js";
|
|
10
|
-
import "./proof-DHvk0L4Q.js";
|
|
11
|
-
import "./types-BtUjyi5y.js";
|
|
12
|
-
import "./kv-cache--RKYzX3Q.js";
|
|
13
|
-
import "./vocab-D7w9PSpd.js";
|
|
14
|
-
|
|
15
|
-
export { FederationImpl };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
-
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
|
-
|
|
5
|
-
require('./transformers-CoBS-oFG.cjs');
|
|
6
|
-
require('./lookup-DkCTtfbf.cjs');
|
|
7
|
-
require('./actor-DPWo8e6F.cjs');
|
|
8
|
-
const require_middleware = require('./middleware-Cs-UBi-8.cjs');
|
|
9
|
-
require('./http-DGcqtcol.cjs');
|
|
10
|
-
require('./proof-BO4lGs3o.cjs');
|
|
11
|
-
require('./types-CWgzGaqk.cjs');
|
|
12
|
-
require('./kv-cache-tUGFCM0H.cjs');
|
|
13
|
-
require('./vocab-DPJyg4oW.cjs');
|
|
14
|
-
|
|
15
|
-
exports.FederationImpl = require_middleware.FederationImpl;
|
package/dist/mq-CUKlBw08.d.ts
DELETED
|
@@ -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 };
|
package/dist/mq-DcJPkXD5.d.cts
DELETED
|
@@ -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 };
|
package/dist/vocab/schema.yaml
DELETED
|
@@ -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
|
package/dist/x/cfworkers.cjs
DELETED
|
@@ -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;
|