@burdenoff/be-sdk 2026.1128.2 → 2026.1130.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/dist/auth/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/feature-flags/index.d.ts +1 -1
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.js +3 -2
- package/dist/graphql-DzzWneMu.js +398 -0
- package/dist/graphql-DzzWneMu.js.map +1 -0
- package/dist/{index-B-yXdMeb.d.ts → index-BFNCCa2W.d.ts} +2 -2
- package/dist/{index-cPPtZTJh.d.ts → index-BaB4Nsv7.d.ts} +1 -1
- package/dist/{index-Cx3z-7T1.d.ts → index-CjY5YV9F.d.ts} +1 -1
- package/dist/index-D56fE7tl.d.ts +64 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/prisma/index.js +2 -2
- package/dist/{prisma-1J9WTyAF.js → prisma-CUij0pph.js} +2 -2
- package/dist/{prisma-1J9WTyAF.js.map → prisma-CUij0pph.js.map} +1 -1
- package/dist/pubsub-health-DCeAKI3q.js +26 -0
- package/dist/pubsub-health-DCeAKI3q.js.map +1 -0
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +10 -2
- package/dist/server/index.js.map +1 -1
- package/dist/{stub-DZ332ZHG.js → stub-DNkzpQvR.js} +2 -2
- package/dist/{stub-DZ332ZHG.js.map → stub-DNkzpQvR.js.map} +1 -1
- package/dist/tracker/index.js +2 -2
- package/dist/{tracker-DE4MDVTr.js → tracker-CDVYIoCb.js} +2 -2
- package/dist/{tracker-DE4MDVTr.js.map → tracker-CDVYIoCb.js.map} +1 -1
- package/dist/{types-IXZyPJCR.d.ts → types-2PuLMwAy.d.ts} +1 -1
- package/dist/{workspace-extension-ByopOwtK.js → workspace-extension-BcMPoGWr.js} +16 -4
- package/dist/workspace-extension-BcMPoGWr.js.map +1 -0
- package/package.json +1 -1
- package/dist/graphql-DHAHHcww.js +0 -161
- package/dist/graphql-DHAHHcww.js.map +0 -1
- package/dist/index-CSRcgkVi.d.ts +0 -23
- package/dist/workspace-extension-ByopOwtK.js.map +0 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AuthCookieHelper, i as VerifyTokenResult, n as RefreshTokenResult, o as CookieOptions, r as TokenPayload, t as AuthModule } from "../index-
|
|
1
|
+
import { a as AuthCookieHelper, i as VerifyTokenResult, n as RefreshTokenResult, o as CookieOptions, r as TokenPayload, t as AuthModule } from "../index-CjY5YV9F.js";
|
|
2
2
|
export { AuthCookieHelper, AuthModule, CookieOptions, RefreshTokenResult, TokenPayload, VerifyTokenResult };
|
package/dist/context/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FeatureFlagProvider, c as FlagEvaluation, i as createOperationsFlagGatePlugin, l as FlagType, n as GatedOperationType, o as EvaluationContext, r as OperationsFlagGatePluginOptions, s as FeatureFlagProviderConfig, u as ResolutionDetails } from "../index-
|
|
1
|
+
import { a as FeatureFlagProvider, c as FlagEvaluation, i as createOperationsFlagGatePlugin, l as FlagType, n as GatedOperationType, o as EvaluationContext, r as OperationsFlagGatePluginOptions, s as FeatureFlagProviderConfig, u as ResolutionDetails } from "../index-BFNCCa2W.js";
|
|
2
2
|
export { type EvaluationContext, FeatureFlagProvider, type FeatureFlagProviderConfig, type FlagEvaluation, type FlagType, type GatedOperationType, type OperationsFlagGatePluginOptions, type ResolutionDetails, createOperationsFlagGatePlugin };
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { a as registerPubSubHealthSource, c as RedisStreamsEventTargetConnection, d as RedisStreamsRetryOptions, f as computePubSubBackoffMs, i as getPubSubHealth, l as RedisStreamsEventTargetOptions, n as PubSubHealth, o as RedisStreamsBlockingClient, p as createRedisStreamsEventTarget, r as PubSubHealthSource, s as RedisStreamsEventTarget, u as RedisStreamsEventTargetStatus } from "../index-D56fE7tl.js";
|
|
2
2
|
import { i as Logger, n as PrismaTransactionClient, r as createDatabaseService, t as DatabaseService } from "../index-DtI6aBtB.js";
|
|
3
|
-
export { type DatabaseService, Logger, type PrismaTransactionClient, type RedisStreamsEventTarget, type RedisStreamsEventTargetOptions, createDatabaseService, createRedisStreamsEventTarget };
|
|
3
|
+
export { type DatabaseService, Logger, type PrismaTransactionClient, type PubSubHealth, type PubSubHealthSource, type RedisStreamsBlockingClient, type RedisStreamsEventTarget, type RedisStreamsEventTargetConnection, type RedisStreamsEventTargetOptions, type RedisStreamsEventTargetStatus, type RedisStreamsRetryOptions, computePubSubBackoffMs, createDatabaseService, createRedisStreamsEventTarget, getPubSubHealth, registerPubSubHealthSource };
|
package/dist/graphql/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as registerPubSubHealthSource, t as getPubSubHealth } from "../pubsub-health-DCeAKI3q.js";
|
|
2
|
+
import { n as computePubSubBackoffMs, r as createRedisStreamsEventTarget } from "../graphql-DzzWneMu.js";
|
|
2
3
|
import { n as Logger, t as createDatabaseService } from "../services-BWzfz7vG.js";
|
|
3
4
|
|
|
4
|
-
export { Logger, createDatabaseService, createRedisStreamsEventTarget };
|
|
5
|
+
export { Logger, computePubSubBackoffMs, createDatabaseService, createRedisStreamsEventTarget, getPubSubHealth, registerPubSubHealthSource };
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-ad2WFvuA.js";
|
|
2
|
+
import { l as getMetricsRegistry } from "./metrics-collector-DXQrMUle.js";
|
|
3
|
+
import { a as logger } from "./logger-B6rCpb7D.js";
|
|
4
|
+
import { t as RedisStreamsConnection } from "./RedisStreamsConnection-CY8WySJy.js";
|
|
5
|
+
import { n as registerPubSubHealthSource, t as getPubSubHealth } from "./pubsub-health-DCeAKI3q.js";
|
|
6
|
+
import { n as Logger, t as createDatabaseService } from "./services-BWzfz7vG.js";
|
|
7
|
+
|
|
8
|
+
// src/graphql/redis-streams-event-target.ts
|
|
9
|
+
/**
|
|
10
|
+
* Redis Streams-based EventTarget for graphql-yoga distributed PubSub.
|
|
11
|
+
*
|
|
12
|
+
* Each server tails a per-event-type stream with `XREAD BLOCK ... $` (no
|
|
13
|
+
* consumer group) so every instance receives every dispatch — the fan-out
|
|
14
|
+
* semantics GraphQL subscriptions require.
|
|
15
|
+
*
|
|
16
|
+
* For durable inter-svc events use `event-queue/createPublisher` instead.
|
|
17
|
+
*
|
|
18
|
+
* RECOVERY (BOFF-17232)
|
|
19
|
+
* Redis can be unreachable when a pod boots (CoreDNS still starting, a
|
|
20
|
+
* Valkey failover) or later in its life. The target never gives up:
|
|
21
|
+
*
|
|
22
|
+
* - The connection is retried in the background with capped, equal-jitter
|
|
23
|
+
* exponential backoff until it is ready. ioredis keeps one client
|
|
24
|
+
* reconnecting underneath; this loop only waits on it, so a retry never
|
|
25
|
+
* builds a second client (see `RedisStreamsConnection.connect`).
|
|
26
|
+
* - Each per-event-type reader is supervised. If it cannot get a blocking
|
|
27
|
+
* client, or XREAD fails, it backs off and starts again. Before the fix a
|
|
28
|
+
* reader whose first connect timed out logged "reader crashed" and was
|
|
29
|
+
* never restarted, so that pod's subscribers silently received nothing —
|
|
30
|
+
* not even events published on the same pod — for the life of the process.
|
|
31
|
+
* - A reader that never managed to read resumes from the moment it was
|
|
32
|
+
* subscribed, so events dispatched while Redis was down (up to `maxLen`)
|
|
33
|
+
* still reach the subscriber once Redis is back.
|
|
34
|
+
* - The degraded state is logged on entry and on recovery, exported as the
|
|
35
|
+
* `graphql_pubsub_redis_degraded` gauge, and reported to `createServer`'s
|
|
36
|
+
* readiness probe as the optional `pubsub` dependency.
|
|
37
|
+
*/
|
|
38
|
+
const DEFAULT_PUBSUB_RETRY_BASE_MS = 500;
|
|
39
|
+
const DEFAULT_PUBSUB_RETRY_MAX_MS = 3e4;
|
|
40
|
+
const DEFAULT_HEALTH_CHECK_INTERVAL_MS = 5e3;
|
|
41
|
+
const DEFAULT_BLOCK_MS = 5e3;
|
|
42
|
+
/**
|
|
43
|
+
* Equal-jitter exponential backoff: the ceiling doubles per attempt up to
|
|
44
|
+
* `maxMs`, and the delay is drawn from [ceiling/2, ceiling). Half the window
|
|
45
|
+
* is fixed so retries never collapse to zero; the random half spreads a
|
|
46
|
+
* fleet of pods that lost the same Redis at the same moment.
|
|
47
|
+
*/
|
|
48
|
+
function computePubSubBackoffMs(attempt, baseMs = 500, maxMs = DEFAULT_PUBSUB_RETRY_MAX_MS, random = Math.random) {
|
|
49
|
+
const exponent = Math.max(0, attempt - 1);
|
|
50
|
+
const half = Math.min(maxMs, baseMs * Math.pow(2, Math.min(exponent, 30))) / 2;
|
|
51
|
+
return Math.round(half + random() * half);
|
|
52
|
+
}
|
|
53
|
+
function errorMessage(err) {
|
|
54
|
+
return err instanceof Error ? err.message : String(err);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Default transport: adapts the SDK's shared Redis Streams connection.
|
|
58
|
+
* Exported for tests only; not part of the package entry point.
|
|
59
|
+
*/
|
|
60
|
+
function adaptRedisStreamsConnection(conn) {
|
|
61
|
+
return {
|
|
62
|
+
connect: () => conn.connect(),
|
|
63
|
+
isConnected: () => conn.isConnected(),
|
|
64
|
+
async xadd(...args) {
|
|
65
|
+
let client;
|
|
66
|
+
try {
|
|
67
|
+
client = conn.getClient();
|
|
68
|
+
} catch {
|
|
69
|
+
await conn.connect();
|
|
70
|
+
client = conn.getClient();
|
|
71
|
+
}
|
|
72
|
+
return client.xadd(...args);
|
|
73
|
+
},
|
|
74
|
+
async makeBlockingClient() {
|
|
75
|
+
const client = await conn.makeBlockingClient();
|
|
76
|
+
const raw = client;
|
|
77
|
+
return {
|
|
78
|
+
xread: (...args) => raw.call("XREAD", ...args),
|
|
79
|
+
disconnect: () => client.disconnect()
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
disconnect: () => conn.disconnect()
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async function createRedisStreamsEventTarget(options = {}) {
|
|
86
|
+
const prefix = options.subjectPrefix ?? "graphql.pubsub";
|
|
87
|
+
const maxLen = options.maxLen ?? 1e3;
|
|
88
|
+
const baseDelayMs = options.retry?.baseDelayMs ?? 500;
|
|
89
|
+
const maxDelayMs = options.retry?.maxDelayMs ?? 3e4;
|
|
90
|
+
const healthCheckIntervalMs = options.healthCheckIntervalMs ?? DEFAULT_HEALTH_CHECK_INTERVAL_MS;
|
|
91
|
+
const blockMs = options.blockMs ?? DEFAULT_BLOCK_MS;
|
|
92
|
+
const serializer = options.serializer ?? {
|
|
93
|
+
stringify: (d) => JSON.stringify(d),
|
|
94
|
+
parse: (m) => JSON.parse(m)
|
|
95
|
+
};
|
|
96
|
+
let conn;
|
|
97
|
+
if (options.connection) conn = options.connection;
|
|
98
|
+
else {
|
|
99
|
+
const url = options.redisUrl ?? process.env["REDIS_URL"];
|
|
100
|
+
if (!url) throw new Error("[RedisStreamsEventTarget] redisUrl or REDIS_URL is required");
|
|
101
|
+
conn = adaptRedisStreamsConnection(new RedisStreamsConnection({
|
|
102
|
+
type: "redis-streams",
|
|
103
|
+
url,
|
|
104
|
+
password: options.password ?? process.env["REDIS_PASSWORD"],
|
|
105
|
+
name: "graphql-pubsub"
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
const streamKey = (type) => `boff:pubsub:${prefix}:${type.replace(/\./g, ":")}`;
|
|
109
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
110
|
+
const readers = /* @__PURE__ */ new Map();
|
|
111
|
+
let closed = false;
|
|
112
|
+
let connectLoop = null;
|
|
113
|
+
let connectFailures = 0;
|
|
114
|
+
let connectWake = null;
|
|
115
|
+
let degradedSince = null;
|
|
116
|
+
const metricLabels = { prefix };
|
|
117
|
+
function recordRetry(component) {
|
|
118
|
+
getMetricsRegistry().createCounter("graphql_pubsub_redis_retries_total", "Retries of the GraphQL subscription pubsub Redis connection or stream readers").inc({
|
|
119
|
+
prefix,
|
|
120
|
+
component
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function recordDispatchFailure() {
|
|
124
|
+
getMetricsRegistry().createCounter("graphql_pubsub_dispatch_failures_total", "GraphQL subscription events that could not be published").inc(metricLabels);
|
|
125
|
+
}
|
|
126
|
+
/** Sleep that `close()` / reader stop can cut short. */
|
|
127
|
+
function sleep(ms, setWake) {
|
|
128
|
+
return new Promise((resolve) => {
|
|
129
|
+
const done = () => {
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
setWake(null);
|
|
132
|
+
resolve();
|
|
133
|
+
};
|
|
134
|
+
const timer = setTimeout(done, ms);
|
|
135
|
+
setWake(done);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function retryingReaderCount() {
|
|
139
|
+
let n = 0;
|
|
140
|
+
for (const r of readers.values()) if (r.retrying) n++;
|
|
141
|
+
return n;
|
|
142
|
+
}
|
|
143
|
+
function isDegraded() {
|
|
144
|
+
return !conn.isConnected() || retryingReaderCount() > 0;
|
|
145
|
+
}
|
|
146
|
+
/** Log and export degraded-state transitions. */
|
|
147
|
+
function refreshDegraded() {
|
|
148
|
+
if (closed) return;
|
|
149
|
+
const degraded = isDegraded();
|
|
150
|
+
getMetricsRegistry().createGauge("graphql_pubsub_redis_degraded", "1 while the GraphQL subscription pubsub cannot reach Redis or a stream reader is retrying").set(degraded ? 1 : 0, metricLabels);
|
|
151
|
+
if (degraded && degradedSince === null) {
|
|
152
|
+
degradedSince = Date.now();
|
|
153
|
+
logger.warn("[RedisStreamsEventTarget] pubsub degraded: subscribers on this replica may miss events until Redis recovers", {
|
|
154
|
+
prefix,
|
|
155
|
+
connected: conn.isConnected(),
|
|
156
|
+
retryingReaders: retryingReaderCount()
|
|
157
|
+
});
|
|
158
|
+
} else if (!degraded && degradedSince !== null) {
|
|
159
|
+
logger.info("[RedisStreamsEventTarget] pubsub recovered", {
|
|
160
|
+
prefix,
|
|
161
|
+
degradedForMs: Date.now() - degradedSince
|
|
162
|
+
});
|
|
163
|
+
degradedSince = null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/** Retry the connection with backoff until it is ready. Idempotent. */
|
|
167
|
+
function ensureConnected() {
|
|
168
|
+
if (closed || connectLoop || conn.isConnected()) return;
|
|
169
|
+
connectLoop = (async () => {
|
|
170
|
+
while (!closed && !conn.isConnected()) try {
|
|
171
|
+
await conn.connect();
|
|
172
|
+
} catch (err) {
|
|
173
|
+
if (closed) break;
|
|
174
|
+
connectFailures++;
|
|
175
|
+
recordRetry("connection");
|
|
176
|
+
const delayMs = computePubSubBackoffMs(connectFailures, baseDelayMs, maxDelayMs);
|
|
177
|
+
logger.warn("[RedisStreamsEventTarget] redis connect failed; retrying", {
|
|
178
|
+
prefix,
|
|
179
|
+
attempt: connectFailures,
|
|
180
|
+
delayMs,
|
|
181
|
+
error: errorMessage(err)
|
|
182
|
+
});
|
|
183
|
+
refreshDegraded();
|
|
184
|
+
await sleep(delayMs, (wake) => {
|
|
185
|
+
connectWake = wake;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (!closed && conn.isConnected()) {
|
|
189
|
+
if (connectFailures > 0) logger.info("[RedisStreamsEventTarget] redis connected after retries", {
|
|
190
|
+
prefix,
|
|
191
|
+
attempts: connectFailures
|
|
192
|
+
});
|
|
193
|
+
else logger.info("[RedisStreamsEventTarget] redis connected", { prefix });
|
|
194
|
+
connectFailures = 0;
|
|
195
|
+
}
|
|
196
|
+
})().finally(() => {
|
|
197
|
+
connectLoop = null;
|
|
198
|
+
refreshDegraded();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
async function deliver(type, rawFields) {
|
|
202
|
+
const fields = {};
|
|
203
|
+
for (let i = 0; i + 1 < rawFields.length; i += 2) fields[rawFields[i]] = rawFields[i + 1];
|
|
204
|
+
let payload;
|
|
205
|
+
try {
|
|
206
|
+
payload = await serializer.parse(fields["payload"] ?? "null");
|
|
207
|
+
} catch (err) {
|
|
208
|
+
logger.error("[RedisStreamsEventTarget] dropping unparseable event", {
|
|
209
|
+
type,
|
|
210
|
+
error: errorMessage(err)
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const cbs = listeners.get(type);
|
|
215
|
+
if (!cbs) return;
|
|
216
|
+
const ev = new CustomEvent(type, { detail: payload });
|
|
217
|
+
for (const cb of Array.from(cbs)) try {
|
|
218
|
+
cb(ev);
|
|
219
|
+
} catch (cbErr) {
|
|
220
|
+
logger.error("[RedisStreamsEventTarget] listener error", {
|
|
221
|
+
type,
|
|
222
|
+
error: errorMessage(cbErr)
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function startReader(type) {
|
|
227
|
+
if (readers.has(type) || closed) return;
|
|
228
|
+
const state = {
|
|
229
|
+
stopped: false,
|
|
230
|
+
retrying: false,
|
|
231
|
+
attempt: 0,
|
|
232
|
+
client: null,
|
|
233
|
+
wake: null
|
|
234
|
+
};
|
|
235
|
+
readers.set(type, state);
|
|
236
|
+
const stream = streamKey(type);
|
|
237
|
+
let resumeFrom = Date.now();
|
|
238
|
+
let lastId = "$";
|
|
239
|
+
const run = async () => {
|
|
240
|
+
while (!state.stopped && !closed) try {
|
|
241
|
+
state.client = await conn.makeBlockingClient();
|
|
242
|
+
if (state.stopped || closed) break;
|
|
243
|
+
while (!state.stopped && !closed) {
|
|
244
|
+
const raw = await state.client.xread("COUNT", 50, "BLOCK", blockMs, "STREAMS", stream, lastId);
|
|
245
|
+
if (state.retrying) {
|
|
246
|
+
logger.info("[RedisStreamsEventTarget] reader recovered", {
|
|
247
|
+
prefix,
|
|
248
|
+
type,
|
|
249
|
+
attempts: state.attempt
|
|
250
|
+
});
|
|
251
|
+
state.retrying = false;
|
|
252
|
+
state.attempt = 0;
|
|
253
|
+
refreshDegraded();
|
|
254
|
+
}
|
|
255
|
+
if (!raw) {
|
|
256
|
+
if (lastId === "$") resumeFrom = Date.now();
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
for (const [, entries] of raw) for (const [id, rawFields] of entries) {
|
|
260
|
+
lastId = id;
|
|
261
|
+
await deliver(type, rawFields);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
} catch (err) {
|
|
265
|
+
if (state.stopped || closed) break;
|
|
266
|
+
if (lastId === "$") lastId = `${String(resumeFrom)}-0`;
|
|
267
|
+
state.attempt++;
|
|
268
|
+
state.retrying = true;
|
|
269
|
+
recordRetry("reader");
|
|
270
|
+
const delayMs = computePubSubBackoffMs(state.attempt, baseDelayMs, maxDelayMs);
|
|
271
|
+
logger.warn("[RedisStreamsEventTarget] reader failed; retrying", {
|
|
272
|
+
prefix,
|
|
273
|
+
type,
|
|
274
|
+
attempt: state.attempt,
|
|
275
|
+
delayMs,
|
|
276
|
+
error: errorMessage(err)
|
|
277
|
+
});
|
|
278
|
+
refreshDegraded();
|
|
279
|
+
ensureConnected();
|
|
280
|
+
await sleep(delayMs, (wake) => {
|
|
281
|
+
state.wake = wake;
|
|
282
|
+
});
|
|
283
|
+
} finally {
|
|
284
|
+
const client = state.client;
|
|
285
|
+
state.client = null;
|
|
286
|
+
if (client) try {
|
|
287
|
+
client.disconnect();
|
|
288
|
+
} catch {}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
run().finally(() => {
|
|
292
|
+
state.retrying = false;
|
|
293
|
+
refreshDegraded();
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function stopReader(type) {
|
|
297
|
+
const r = readers.get(type);
|
|
298
|
+
if (!r) return;
|
|
299
|
+
r.stopped = true;
|
|
300
|
+
readers.delete(type);
|
|
301
|
+
r.wake?.();
|
|
302
|
+
try {
|
|
303
|
+
r.client?.disconnect();
|
|
304
|
+
} catch {}
|
|
305
|
+
}
|
|
306
|
+
const target = {
|
|
307
|
+
addEventListener(type, listener) {
|
|
308
|
+
let set = listeners.get(type);
|
|
309
|
+
if (!set) {
|
|
310
|
+
set = /* @__PURE__ */ new Set();
|
|
311
|
+
listeners.set(type, set);
|
|
312
|
+
startReader(type);
|
|
313
|
+
}
|
|
314
|
+
set.add(listener);
|
|
315
|
+
},
|
|
316
|
+
removeEventListener(type, listener) {
|
|
317
|
+
const set = listeners.get(type);
|
|
318
|
+
if (!set) return;
|
|
319
|
+
set.delete(listener);
|
|
320
|
+
if (set.size === 0) {
|
|
321
|
+
listeners.delete(type);
|
|
322
|
+
stopReader(type);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
dispatchEvent(event) {
|
|
326
|
+
const detail = "detail" in event ? event.detail : event;
|
|
327
|
+
(async () => {
|
|
328
|
+
try {
|
|
329
|
+
const payload = await serializer.stringify(detail);
|
|
330
|
+
await conn.xadd(streamKey(event.type), "MAXLEN", "~", maxLen, "*", "payload", payload);
|
|
331
|
+
} catch (err) {
|
|
332
|
+
recordDispatchFailure();
|
|
333
|
+
logger.error("[RedisStreamsEventTarget] dispatch failed", {
|
|
334
|
+
type: event.type,
|
|
335
|
+
error: errorMessage(err)
|
|
336
|
+
});
|
|
337
|
+
ensureConnected();
|
|
338
|
+
}
|
|
339
|
+
})();
|
|
340
|
+
return true;
|
|
341
|
+
},
|
|
342
|
+
async close() {
|
|
343
|
+
if (closed) return;
|
|
344
|
+
closed = true;
|
|
345
|
+
clearInterval(healthTimer);
|
|
346
|
+
unregister();
|
|
347
|
+
connectWake?.();
|
|
348
|
+
for (const type of Array.from(readers.keys())) stopReader(type);
|
|
349
|
+
listeners.clear();
|
|
350
|
+
await conn.disconnect();
|
|
351
|
+
},
|
|
352
|
+
isHealthy() {
|
|
353
|
+
return !isDegraded();
|
|
354
|
+
},
|
|
355
|
+
getStatus() {
|
|
356
|
+
return {
|
|
357
|
+
prefix,
|
|
358
|
+
connected: conn.isConnected(),
|
|
359
|
+
degraded: isDegraded(),
|
|
360
|
+
degradedSince,
|
|
361
|
+
readers: readers.size,
|
|
362
|
+
retryingReaders: retryingReaderCount(),
|
|
363
|
+
connectFailures
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
const unregister = registerPubSubHealthSource({
|
|
368
|
+
isHealthy: () => target.isHealthy(),
|
|
369
|
+
describe: () => {
|
|
370
|
+
const s = target.getStatus();
|
|
371
|
+
return `${prefix}: connected=${String(s.connected)} retryingReaders=${String(s.retryingReaders)}`;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
const healthTimer = setInterval(() => {
|
|
375
|
+
if (conn.isConnected()) {
|
|
376
|
+
connectWake?.();
|
|
377
|
+
for (const r of readers.values()) if (r.retrying) r.wake?.();
|
|
378
|
+
} else ensureConnected();
|
|
379
|
+
refreshDegraded();
|
|
380
|
+
}, healthCheckIntervalMs);
|
|
381
|
+
healthTimer.unref?.();
|
|
382
|
+
ensureConnected();
|
|
383
|
+
logger.info("[RedisStreamsEventTarget] ready", { prefix });
|
|
384
|
+
return target;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// src/graphql/index.ts
|
|
388
|
+
var graphql_exports = /* @__PURE__ */ __exportAll({
|
|
389
|
+
Logger: () => Logger,
|
|
390
|
+
computePubSubBackoffMs: () => computePubSubBackoffMs,
|
|
391
|
+
createDatabaseService: () => createDatabaseService,
|
|
392
|
+
createRedisStreamsEventTarget: () => createRedisStreamsEventTarget,
|
|
393
|
+
getPubSubHealth: () => getPubSubHealth,
|
|
394
|
+
registerPubSubHealthSource: () => registerPubSubHealthSource
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
export { computePubSubBackoffMs as n, createRedisStreamsEventTarget as r, graphql_exports as t };
|
|
398
|
+
//# sourceMappingURL=graphql-DzzWneMu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-DzzWneMu.js","names":[],"sources":["../src/graphql/redis-streams-event-target.ts","../src/graphql/index.ts"],"sourcesContent":["/**\n * Redis Streams-based EventTarget for graphql-yoga distributed PubSub.\n *\n * Each server tails a per-event-type stream with `XREAD BLOCK ... $` (no\n * consumer group) so every instance receives every dispatch — the fan-out\n * semantics GraphQL subscriptions require.\n *\n * For durable inter-svc events use `event-queue/createPublisher` instead.\n *\n * RECOVERY (BOFF-17232)\n * Redis can be unreachable when a pod boots (CoreDNS still starting, a\n * Valkey failover) or later in its life. The target never gives up:\n *\n * - The connection is retried in the background with capped, equal-jitter\n * exponential backoff until it is ready. ioredis keeps one client\n * reconnecting underneath; this loop only waits on it, so a retry never\n * builds a second client (see `RedisStreamsConnection.connect`).\n * - Each per-event-type reader is supervised. If it cannot get a blocking\n * client, or XREAD fails, it backs off and starts again. Before the fix a\n * reader whose first connect timed out logged \"reader crashed\" and was\n * never restarted, so that pod's subscribers silently received nothing —\n * not even events published on the same pod — for the life of the process.\n * - A reader that never managed to read resumes from the moment it was\n * subscribed, so events dispatched while Redis was down (up to `maxLen`)\n * still reach the subscriber once Redis is back.\n * - The degraded state is logged on entry and on recovery, exported as the\n * `graphql_pubsub_redis_degraded` gauge, and reported to `createServer`'s\n * readiness probe as the optional `pubsub` dependency.\n */\nimport { getMetricsRegistry } from '../instrumentation/metrics-collector.js';\nimport { logger } from '../logger/index.js';\nimport { RedisStreamsConnection } from '../event-queue/implementations/redis-streams/RedisStreamsConnection.js';\nimport { registerPubSubHealthSource } from './pubsub-health.js';\n\nexport interface RedisStreamsEventTarget {\n addEventListener(type: string, listener: (event: Event) => void): void;\n removeEventListener(type: string, listener: (event: Event) => void): void;\n dispatchEvent(event: Event): boolean;\n close(): Promise<void>;\n /** True when Redis is connected and no reader is retrying. */\n isHealthy(): boolean;\n /** Point-in-time view of the transport, for health endpoints and logs. */\n getStatus(): RedisStreamsEventTargetStatus;\n}\n\nexport interface RedisStreamsEventTargetStatus {\n /** The `subjectPrefix` this target was created with. */\n prefix: string;\n /** The shared command connection is ready. */\n connected: boolean;\n /** Not connected, or at least one reader is retrying. */\n degraded: boolean;\n /** Epoch milliseconds when the current degraded period began, else null. */\n degradedSince: number | null;\n /** Event types with a live reader. */\n readers: number;\n /** Readers currently backing off after a failure. */\n retryingReaders: number;\n /** Consecutive failed connection attempts (0 once connected). */\n connectFailures: number;\n}\n\n/** Backoff for connection and reader retries. */\nexport interface RedisStreamsRetryOptions {\n /** First retry delay ceiling in ms. Default 500. */\n baseDelayMs?: number;\n /** Maximum retry delay ceiling in ms. Default 30000. */\n maxDelayMs?: number;\n}\n\n/** Blocking client used by a reader (one per event type). */\nexport interface RedisStreamsBlockingClient {\n /** Runs `XREAD <args>`; resolves to the raw reply or null on timeout. */\n xread(...args: Array<string | number>): Promise<unknown>;\n disconnect(): void;\n}\n\n/**\n * Transport the target runs on. The default wraps `RedisStreamsConnection`;\n * tests and custom transports can supply their own.\n */\nexport interface RedisStreamsEventTargetConnection {\n connect(): Promise<void>;\n isConnected(): boolean;\n /** Runs `XADD <args>`, connecting first when no client exists yet. */\n xadd(...args: Array<string | number>): Promise<unknown>;\n makeBlockingClient(): Promise<RedisStreamsBlockingClient>;\n disconnect(): Promise<void>;\n}\n\nexport interface RedisStreamsEventTargetOptions {\n /** Redis connection URL. Defaults to `REDIS_URL` env. */\n redisUrl?: string;\n /** Optional password override. */\n password?: string;\n /** Subject prefix; keys become `<prefix>.<type>` mapped via `:` separator. */\n subjectPrefix?: string;\n /** Approximate MAXLEN trim for each pubsub stream. Default 1000. */\n maxLen?: number;\n /** Per-event serialiser. */\n serializer?: {\n stringify: (data: unknown) => string | Promise<string>;\n parse: (msg: string) => unknown | Promise<unknown>;\n };\n /** Retry backoff for the connection and the readers. */\n retry?: RedisStreamsRetryOptions;\n /** How often the degraded state is re-evaluated, in ms. Default 5000. */\n healthCheckIntervalMs?: number;\n /** XREAD BLOCK timeout in ms. Default 5000. */\n blockMs?: number;\n /** Transport override. When set, `redisUrl` is not required. */\n connection?: RedisStreamsEventTargetConnection;\n}\n\nexport const DEFAULT_PUBSUB_RETRY_BASE_MS = 500;\nexport const DEFAULT_PUBSUB_RETRY_MAX_MS = 30_000;\nconst DEFAULT_HEALTH_CHECK_INTERVAL_MS = 5000;\nconst DEFAULT_BLOCK_MS = 5000;\n\n/**\n * Equal-jitter exponential backoff: the ceiling doubles per attempt up to\n * `maxMs`, and the delay is drawn from [ceiling/2, ceiling). Half the window\n * is fixed so retries never collapse to zero; the random half spreads a\n * fleet of pods that lost the same Redis at the same moment.\n */\nexport function computePubSubBackoffMs(\n attempt: number,\n baseMs: number = DEFAULT_PUBSUB_RETRY_BASE_MS,\n maxMs: number = DEFAULT_PUBSUB_RETRY_MAX_MS,\n random: () => number = Math.random\n): number {\n const exponent = Math.max(0, attempt - 1);\n // Cap the exponent before Math.pow so a long outage cannot overflow.\n const ceiling = Math.min(maxMs, baseMs * Math.pow(2, Math.min(exponent, 30)));\n const half = ceiling / 2;\n return Math.round(half + random() * half);\n}\n\nfunction errorMessage(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n\ntype ConnectionLike = Pick<\n RedisStreamsConnection,\n 'connect' | 'isConnected' | 'getClient' | 'makeBlockingClient' | 'disconnect'\n>;\n\n/**\n * Default transport: adapts the SDK's shared Redis Streams connection.\n * Exported for tests only; not part of the package entry point.\n */\nexport function adaptRedisStreamsConnection(conn: ConnectionLike): RedisStreamsEventTargetConnection {\n return {\n connect: () => conn.connect(),\n isConnected: () => conn.isConnected(),\n async xadd(...args) {\n let client: ReturnType<ConnectionLike['getClient']>;\n try {\n client = conn.getClient();\n } catch {\n // No client yet (first connect still loading ioredis, or it failed\n // before a client existed). Connect once; a reconnecting client\n // otherwise queues the command until it is ready.\n await conn.connect();\n client = conn.getClient();\n }\n return client.xadd(...args);\n },\n async makeBlockingClient() {\n const client = await conn.makeBlockingClient();\n // XREAD is not on the narrowed ioredis type; `call` sends it verbatim.\n const raw = client as unknown as { call: (command: string, ...args: unknown[]) => Promise<unknown> };\n return {\n xread: (...args) => raw.call('XREAD', ...args),\n disconnect: () => client.disconnect(),\n };\n },\n disconnect: () => conn.disconnect(),\n };\n}\n\ntype XReadReply = Array<[string, Array<[string, string[]]>]>;\n\ninterface ReaderState {\n stopped: boolean;\n retrying: boolean;\n attempt: number;\n client: RedisStreamsBlockingClient | null;\n wake: (() => void) | null;\n}\n\nexport async function createRedisStreamsEventTarget(\n options: RedisStreamsEventTargetOptions = {}\n): Promise<RedisStreamsEventTarget> {\n const prefix = options.subjectPrefix ?? 'graphql.pubsub';\n const maxLen = options.maxLen ?? 1000;\n const baseDelayMs = options.retry?.baseDelayMs ?? DEFAULT_PUBSUB_RETRY_BASE_MS;\n const maxDelayMs = options.retry?.maxDelayMs ?? DEFAULT_PUBSUB_RETRY_MAX_MS;\n const healthCheckIntervalMs = options.healthCheckIntervalMs ?? DEFAULT_HEALTH_CHECK_INTERVAL_MS;\n const blockMs = options.blockMs ?? DEFAULT_BLOCK_MS;\n const serializer = options.serializer ?? {\n stringify: (d: unknown): string => JSON.stringify(d),\n parse: (m: string): unknown => JSON.parse(m),\n };\n\n let conn: RedisStreamsEventTargetConnection;\n if (options.connection) {\n conn = options.connection;\n } else {\n const url = options.redisUrl ?? process.env['REDIS_URL'];\n if (!url) throw new Error('[RedisStreamsEventTarget] redisUrl or REDIS_URL is required');\n conn = adaptRedisStreamsConnection(\n new RedisStreamsConnection({\n type: 'redis-streams',\n url,\n password: options.password ?? process.env['REDIS_PASSWORD'],\n name: 'graphql-pubsub',\n })\n );\n }\n\n const streamKey = (type: string): string => `boff:pubsub:${prefix}:${type.replace(/\\./g, ':')}`;\n\n const listeners = new Map<string, Set<(event: Event) => void>>();\n const readers = new Map<string, ReaderState>();\n let closed = false;\n let connectLoop: Promise<void> | null = null;\n let connectFailures = 0;\n let connectWake: (() => void) | null = null;\n let degradedSince: number | null = null;\n\n // Metrics are resolved per use: the registry can be (re)initialised after\n // this target is created, and lookups are a map hit.\n const metricLabels = { prefix };\n function recordRetry(component: 'connection' | 'reader'): void {\n getMetricsRegistry()\n .createCounter(\n 'graphql_pubsub_redis_retries_total',\n 'Retries of the GraphQL subscription pubsub Redis connection or stream readers'\n )\n .inc({ prefix, component });\n }\n function recordDispatchFailure(): void {\n getMetricsRegistry()\n .createCounter(\n 'graphql_pubsub_dispatch_failures_total',\n 'GraphQL subscription events that could not be published'\n )\n .inc(metricLabels);\n }\n\n /** Sleep that `close()` / reader stop can cut short. */\n function sleep(ms: number, setWake: (wake: (() => void) | null) => void): Promise<void> {\n return new Promise<void>((resolve) => {\n const done = (): void => {\n clearTimeout(timer);\n setWake(null);\n resolve();\n };\n const timer = setTimeout(done, ms);\n setWake(done);\n });\n }\n\n function retryingReaderCount(): number {\n let n = 0;\n for (const r of readers.values()) if (r.retrying) n++;\n return n;\n }\n\n function isDegraded(): boolean {\n return !conn.isConnected() || retryingReaderCount() > 0;\n }\n\n /** Log and export degraded-state transitions. */\n function refreshDegraded(): void {\n if (closed) return;\n const degraded = isDegraded();\n getMetricsRegistry()\n .createGauge(\n 'graphql_pubsub_redis_degraded',\n '1 while the GraphQL subscription pubsub cannot reach Redis or a stream reader is retrying'\n )\n .set(degraded ? 1 : 0, metricLabels);\n if (degraded && degradedSince === null) {\n degradedSince = Date.now();\n logger.warn(\n '[RedisStreamsEventTarget] pubsub degraded: subscribers on this replica may miss events until Redis recovers',\n { prefix, connected: conn.isConnected(), retryingReaders: retryingReaderCount() }\n );\n } else if (!degraded && degradedSince !== null) {\n logger.info('[RedisStreamsEventTarget] pubsub recovered', { prefix, degradedForMs: Date.now() - degradedSince });\n degradedSince = null;\n }\n }\n\n /** Retry the connection with backoff until it is ready. Idempotent. */\n function ensureConnected(): void {\n if (closed || connectLoop || conn.isConnected()) return;\n connectLoop = (async (): Promise<void> => {\n while (!closed && !conn.isConnected()) {\n try {\n await conn.connect();\n } catch (err) {\n if (closed) break;\n connectFailures++;\n recordRetry('connection');\n const delayMs = computePubSubBackoffMs(connectFailures, baseDelayMs, maxDelayMs);\n logger.warn('[RedisStreamsEventTarget] redis connect failed; retrying', {\n prefix,\n attempt: connectFailures,\n delayMs,\n error: errorMessage(err),\n });\n refreshDegraded();\n await sleep(delayMs, (wake) => {\n connectWake = wake;\n });\n }\n }\n if (!closed && conn.isConnected()) {\n if (connectFailures > 0) {\n logger.info('[RedisStreamsEventTarget] redis connected after retries', { prefix, attempts: connectFailures });\n } else {\n logger.info('[RedisStreamsEventTarget] redis connected', { prefix });\n }\n connectFailures = 0;\n }\n })().finally(() => {\n connectLoop = null;\n refreshDegraded();\n });\n }\n\n async function deliver(type: string, rawFields: string[]): Promise<void> {\n const fields: Record<string, string> = {};\n for (let i = 0; i + 1 < rawFields.length; i += 2) {\n fields[rawFields[i]!] = rawFields[i + 1]!;\n }\n let payload: unknown;\n try {\n payload = await serializer.parse(fields['payload'] ?? 'null');\n } catch (err) {\n // One malformed entry must not stop the stream for every subscriber.\n logger.error('[RedisStreamsEventTarget] dropping unparseable event', { type, error: errorMessage(err) });\n return;\n }\n const cbs = listeners.get(type);\n if (!cbs) return;\n const ev = new CustomEvent(type, { detail: payload });\n for (const cb of Array.from(cbs)) {\n try {\n cb(ev);\n } catch (cbErr) {\n logger.error('[RedisStreamsEventTarget] listener error', { type, error: errorMessage(cbErr) });\n }\n }\n }\n\n function startReader(type: string): void {\n if (readers.has(type) || closed) return;\n const state: ReaderState = { stopped: false, retrying: false, attempt: 0, client: null, wake: null };\n readers.set(type, state);\n const stream = streamKey(type);\n // While nothing has arrived yet, the point to resume from after a failure:\n // the subscribe time, moved forward by every empty XREAD so a later\n // failure never replays entries older than what the reader already waited\n // through.\n let resumeFrom = Date.now();\n // `$` = only entries added after the first XREAD. Replaced by the last\n // seen id once anything arrives, so a restart resumes where it stopped.\n let lastId = '$';\n\n const run = async (): Promise<void> => {\n while (!state.stopped && !closed) {\n try {\n state.client = await conn.makeBlockingClient();\n if (state.stopped || closed) break;\n while (!state.stopped && !closed) {\n const raw = (await state.client.xread(\n 'COUNT',\n 50,\n 'BLOCK',\n blockMs,\n 'STREAMS',\n stream,\n lastId\n )) as XReadReply | null;\n if (state.retrying) {\n logger.info('[RedisStreamsEventTarget] reader recovered', { prefix, type, attempts: state.attempt });\n state.retrying = false;\n state.attempt = 0;\n refreshDegraded();\n }\n if (!raw) {\n if (lastId === '$') resumeFrom = Date.now();\n continue;\n }\n for (const [, entries] of raw) {\n for (const [id, rawFields] of entries) {\n lastId = id;\n await deliver(type, rawFields);\n }\n }\n }\n } catch (err) {\n if (state.stopped || closed) break;\n // Never read anything yet: resume from the last known-empty point\n // instead of `$`, so events dispatched during the outage are not lost.\n if (lastId === '$') lastId = `${String(resumeFrom)}-0`;\n state.attempt++;\n state.retrying = true;\n recordRetry('reader');\n const delayMs = computePubSubBackoffMs(state.attempt, baseDelayMs, maxDelayMs);\n logger.warn('[RedisStreamsEventTarget] reader failed; retrying', {\n prefix,\n type,\n attempt: state.attempt,\n delayMs,\n error: errorMessage(err),\n });\n refreshDegraded();\n ensureConnected();\n await sleep(delayMs, (wake) => {\n state.wake = wake;\n });\n } finally {\n const client = state.client;\n state.client = null;\n if (client) {\n try {\n client.disconnect();\n } catch {\n /* already closed */\n }\n }\n }\n }\n };\n\n void run().finally(() => {\n // A stopped reader no longer counts toward the degraded state.\n state.retrying = false;\n refreshDegraded();\n });\n }\n\n function stopReader(type: string): void {\n const r = readers.get(type);\n if (!r) return;\n r.stopped = true;\n readers.delete(type);\n r.wake?.();\n // Unblock a pending XREAD now rather than after the BLOCK timeout.\n try {\n r.client?.disconnect();\n } catch {\n /* already closed */\n }\n }\n\n const target: RedisStreamsEventTarget = {\n addEventListener(type, listener): void {\n let set = listeners.get(type);\n if (!set) {\n set = new Set();\n listeners.set(type, set);\n startReader(type);\n }\n set.add(listener);\n },\n removeEventListener(type, listener): void {\n const set = listeners.get(type);\n if (!set) return;\n set.delete(listener);\n if (set.size === 0) {\n listeners.delete(type);\n stopReader(type);\n }\n },\n dispatchEvent(event): boolean {\n const detail = 'detail' in event ? (event as CustomEvent).detail : event;\n void (async (): Promise<void> => {\n try {\n const payload = await serializer.stringify(detail);\n await conn.xadd(streamKey(event.type), 'MAXLEN', '~', maxLen, '*', 'payload', payload);\n } catch (err) {\n recordDispatchFailure();\n logger.error('[RedisStreamsEventTarget] dispatch failed', { type: event.type, error: errorMessage(err) });\n ensureConnected();\n }\n })();\n return true;\n },\n async close(): Promise<void> {\n if (closed) return;\n closed = true;\n clearInterval(healthTimer);\n unregister();\n connectWake?.();\n for (const type of Array.from(readers.keys())) stopReader(type);\n listeners.clear();\n await conn.disconnect();\n },\n isHealthy(): boolean {\n return !isDegraded();\n },\n getStatus(): RedisStreamsEventTargetStatus {\n return {\n prefix,\n connected: conn.isConnected(),\n degraded: isDegraded(),\n degradedSince,\n readers: readers.size,\n retryingReaders: retryingReaderCount(),\n connectFailures,\n };\n },\n };\n\n const unregister = registerPubSubHealthSource({\n isHealthy: () => target.isHealthy(),\n describe: () => {\n const s = target.getStatus();\n return `${prefix}: connected=${String(s.connected)} retryingReaders=${String(s.retryingReaders)}`;\n },\n });\n\n // Re-evaluate on a timer as well: a mid-life disconnect is only visible by\n // polling the connection, and the connect loop must restart after it.\n const healthTimer = setInterval(() => {\n if (conn.isConnected()) {\n // Redis is back: cut short any backoff so recovery does not wait for\n // the full (up to maxDelayMs) sleep.\n connectWake?.();\n for (const r of readers.values()) if (r.retrying) r.wake?.();\n } else {\n ensureConnected();\n }\n refreshDegraded();\n }, healthCheckIntervalMs);\n healthTimer.unref?.();\n\n // Connect in the background — don't block svc startup on Redis reachability.\n ensureConnected();\n\n logger.info('[RedisStreamsEventTarget] ready', { prefix });\n return target;\n}\n","/**\n * GraphQL Utilities Module\n *\n * Provides GraphQL-related utilities for Burdenoff products.\n *\n * @module graphql\n */\n\n// NATS event target was removed on 2026-05-16. Use\n// `createRedisStreamsEventTarget` from `./redis-streams-event-target.js`\n// for distributed GraphQL Yoga subscriptions.\n\nexport { createRedisStreamsEventTarget } from './redis-streams-event-target.js';\nexport { computePubSubBackoffMs } from './redis-streams-event-target.js';\nexport type {\n RedisStreamsBlockingClient,\n RedisStreamsEventTarget,\n RedisStreamsEventTargetConnection,\n RedisStreamsEventTargetOptions,\n RedisStreamsEventTargetStatus,\n RedisStreamsRetryOptions,\n} from './redis-streams-event-target.js';\nexport { getPubSubHealth, registerPubSubHealthSource } from './pubsub-health.js';\nexport type { PubSubHealth, PubSubHealthSource } from './pubsub-health.js';\n\n// Injectable services for GraphQL Modules\nexport { Logger, createDatabaseService } from './services/index.js';\nexport type { DatabaseService, PrismaTransactionClient } from './services/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,MAAa,+BAA+B;AAC5C,MAAa,8BAA8B;AAC3C,MAAM,mCAAmC;AACzC,MAAM,mBAAmB;;;;;;;AAQzB,SAAgB,uBACd,SACA,cACA,QAAgB,6BAChB,SAAuB,KAAK,QACpB;CACR,MAAM,WAAW,KAAK,IAAI,GAAG,UAAU,CAAC;CAGxC,MAAM,OADU,KAAK,IAAI,OAAO,SAAS,KAAK,IAAI,GAAG,KAAK,IAAI,UAAU,EAAE,CAAC,CACxD,IAAI;CACvB,OAAO,KAAK,MAAM,OAAO,OAAO,IAAI,IAAI;AAC1C;AAEA,SAAS,aAAa,KAAsB;CAC1C,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACxD;;;;;AAWA,SAAgB,4BAA4B,MAAyD;CACnG,OAAO;EACL,eAAe,KAAK,QAAQ;EAC5B,mBAAmB,KAAK,YAAY;EACpC,MAAM,KAAK,GAAG,MAAM;GAClB,IAAI;GACJ,IAAI;IACF,SAAS,KAAK,UAAU;GAC1B,QAAQ;IAIN,MAAM,KAAK,QAAQ;IACnB,SAAS,KAAK,UAAU;GAC1B;GACA,OAAO,OAAO,KAAK,GAAG,IAAI;EAC5B;EACA,MAAM,qBAAqB;GACzB,MAAM,SAAS,MAAM,KAAK,mBAAmB;GAE7C,MAAM,MAAM;GACZ,OAAO;IACL,QAAQ,GAAG,SAAS,IAAI,KAAK,SAAS,GAAG,IAAI;IAC7C,kBAAkB,OAAO,WAAW;GACtC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ACF;EACF;CACF;CAEA,MAAM,aAAa,2BAA2B;EAC5C,iBAAiB,OAAO,UAAU;EAClC,gBAAgB;GACd,MAAM,IAAI,OAAO,UAAU;GAC3B,OAAO,GAAG,OAAO,cAAc,OAAO,EAAE,SAAS,EAAE,mBAAmB,OAAO,EAAE,eAAe;EAChG;CACF,CAAC;CAID,MAAM,cAAc,kBAAkB;EACpC,IAAI,KAAK,YAAY,GAAG;GAGtB,cAAc;GACd,KAAK,MAAM,KAAK,QAAQ,OAAO,GAAG,IAAI,EAAE,UAAU,EAAE,OAAO;EAC7D,OACE,gBAAgB;EAElB,gBAAgB;CAClB,GAAG,qBAAqB;CACxB,YAAY,QAAQ;CAGpB,gBAAgB;CAEhB,OAAO,KAAK,mCAAmC,EAAE,OAAO,CAAC;CACzD,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as YogaPlugin } from "./types-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { E as YogaPlugin } from "./types-2PuLMwAy.js";
|
|
2
|
+
import "./index-BaB4Nsv7.js";
|
|
3
3
|
type FlagType = 'BOOLEAN' | 'STRING' | 'NUMBER' | 'JSON';
|
|
4
4
|
interface EvaluationContext {
|
|
5
5
|
actorId?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as VerifiedDelegationContext, E as YogaPlugin, S as ServerInstance, _ as RESTEndpoint, a as IActor, d as ITenant, i as GraphQLContext, m as JWTPayload, w as WorkspaceSecret, y as ServerDefinition } from "./types-
|
|
1
|
+
import { C as VerifiedDelegationContext, E as YogaPlugin, S as ServerInstance, _ as RESTEndpoint, a as IActor, d as ITenant, i as GraphQLContext, m as JWTPayload, w as WorkspaceSecret, y as ServerDefinition } from "./types-2PuLMwAy.js";
|
|
2
2
|
import { E as I18n } from "./index-CPQDMSFS.js";
|
|
3
3
|
import { VerifyOptions } from "jsonwebtoken";
|
|
4
4
|
import { DocumentNode, GraphQLError } from "graphql";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as BurdenoffGraphQLClient } from "./graphql-DcZAKC6p.js";
|
|
2
2
|
import { m as SDKContext } from "./index-CQ3vxT5P.js";
|
|
3
|
-
import { i as GraphQLContext } from "./types-
|
|
3
|
+
import { i as GraphQLContext } from "./types-2PuLMwAy.js";
|
|
4
4
|
interface CookieOptions {
|
|
5
5
|
name: string;
|
|
6
6
|
value: string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { i as Logger, n as PrismaTransactionClient, r as createDatabaseService, t as DatabaseService } from "./index-DtI6aBtB.js";
|
|
2
|
+
interface RedisStreamsEventTarget {
|
|
3
|
+
addEventListener(type: string, listener: (event: Event) => void): void;
|
|
4
|
+
removeEventListener(type: string, listener: (event: Event) => void): void;
|
|
5
|
+
dispatchEvent(event: Event): boolean;
|
|
6
|
+
close(): Promise<void>;
|
|
7
|
+
isHealthy(): boolean;
|
|
8
|
+
getStatus(): RedisStreamsEventTargetStatus;
|
|
9
|
+
}
|
|
10
|
+
interface RedisStreamsEventTargetStatus {
|
|
11
|
+
prefix: string;
|
|
12
|
+
connected: boolean;
|
|
13
|
+
degraded: boolean;
|
|
14
|
+
degradedSince: number | null;
|
|
15
|
+
readers: number;
|
|
16
|
+
retryingReaders: number;
|
|
17
|
+
connectFailures: number;
|
|
18
|
+
}
|
|
19
|
+
interface RedisStreamsRetryOptions {
|
|
20
|
+
baseDelayMs?: number;
|
|
21
|
+
maxDelayMs?: number;
|
|
22
|
+
}
|
|
23
|
+
interface RedisStreamsBlockingClient {
|
|
24
|
+
xread(...args: Array<string | number>): Promise<unknown>;
|
|
25
|
+
disconnect(): void;
|
|
26
|
+
}
|
|
27
|
+
interface RedisStreamsEventTargetConnection {
|
|
28
|
+
connect(): Promise<void>;
|
|
29
|
+
isConnected(): boolean;
|
|
30
|
+
xadd(...args: Array<string | number>): Promise<unknown>;
|
|
31
|
+
makeBlockingClient(): Promise<RedisStreamsBlockingClient>;
|
|
32
|
+
disconnect(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
interface RedisStreamsEventTargetOptions {
|
|
35
|
+
redisUrl?: string;
|
|
36
|
+
password?: string;
|
|
37
|
+
subjectPrefix?: string;
|
|
38
|
+
maxLen?: number;
|
|
39
|
+
serializer?: {
|
|
40
|
+
stringify: (data: unknown) => string | Promise<string>;
|
|
41
|
+
parse: (msg: string) => unknown | Promise<unknown>;
|
|
42
|
+
};
|
|
43
|
+
retry?: RedisStreamsRetryOptions;
|
|
44
|
+
healthCheckIntervalMs?: number;
|
|
45
|
+
blockMs?: number;
|
|
46
|
+
connection?: RedisStreamsEventTargetConnection;
|
|
47
|
+
}
|
|
48
|
+
declare function computePubSubBackoffMs(attempt: number, baseMs?: number, maxMs?: number, random?: () => number): number;
|
|
49
|
+
declare function createRedisStreamsEventTarget(options?: RedisStreamsEventTargetOptions): Promise<RedisStreamsEventTarget>;
|
|
50
|
+
interface PubSubHealthSource {
|
|
51
|
+
isHealthy(): boolean;
|
|
52
|
+
describe(): string;
|
|
53
|
+
}
|
|
54
|
+
interface PubSubHealth {
|
|
55
|
+
ok: boolean;
|
|
56
|
+
unhealthy: string[];
|
|
57
|
+
total: number;
|
|
58
|
+
}
|
|
59
|
+
declare function registerPubSubHealthSource(source: PubSubHealthSource): () => void;
|
|
60
|
+
declare function getPubSubHealth(): PubSubHealth | undefined;
|
|
61
|
+
declare namespace index_d_exports {
|
|
62
|
+
export { DatabaseService, Logger, PrismaTransactionClient, PubSubHealth, PubSubHealthSource, RedisStreamsBlockingClient, RedisStreamsEventTarget, RedisStreamsEventTargetConnection, RedisStreamsEventTargetOptions, RedisStreamsEventTargetStatus, RedisStreamsRetryOptions, computePubSubBackoffMs, createDatabaseService, createRedisStreamsEventTarget, getPubSubHealth, registerPubSubHealthSource };
|
|
63
|
+
}
|
|
64
|
+
export { registerPubSubHealthSource as a, RedisStreamsEventTargetConnection as c, RedisStreamsRetryOptions as d, computePubSubBackoffMs as f, getPubSubHealth as i, RedisStreamsEventTargetOptions as l, PubSubHealth as n, RedisStreamsBlockingClient as o, createRedisStreamsEventTarget as p, PubSubHealthSource as r, RedisStreamsEventTarget as s, index_d_exports as t, RedisStreamsEventTargetStatus as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { a as DEFAULT_LAYER_RESOURCES, c as GatewayRetryConfig, d as LayerFullCo
|
|
|
2
2
|
import { _ as SDKShutdownOptions, a as EventQueueHealthStatus, c as LoggerTransport, g as SDKHealthStatus, m as SDKContext, o as EventQueueSDKConfig, p as SDKConfig, s as LoggerConfig, v as TemporalHealthStatus } from "./index-CQ3vxT5P.js";
|
|
3
3
|
import { c as index_d_exports$17, r as Logger } from "./index-CZWopQsh.js";
|
|
4
4
|
import { ContextManager } from "./context/index.js";
|
|
5
|
-
import { t as AuthModule } from "./index-
|
|
5
|
+
import { t as AuthModule } from "./index-CjY5YV9F.js";
|
|
6
6
|
import { _ as TenantNotificationsModule, o as NotificationsModule, v as tenant_notifications_d_exports } from "./index-C96mNrLW.js";
|
|
7
7
|
import { _ as createRBACDirective, m as RBACDirectiveConfig, o as RBACModule, u as LayerAwareRBACConfig, v as createRBACDirectiveForLayer, y as createRBACDirectiveFromEnv } from "./index-j1B6eYHc.js";
|
|
8
8
|
import { Activity, ActivityActorType, ActivityModule, ActivityOperationUnsupportedError, GetActivitiesOptions, LogActivityOptions } from "./activity/index.js";
|
|
@@ -27,7 +27,7 @@ import { t as index_d_exports } from "./index-BJwHEzpN.js";
|
|
|
27
27
|
import { o as index_d_exports$1 } from "./index-SvWwlTUC.js";
|
|
28
28
|
import { t as index_d_exports$18 } from "./index-BMIMnp6T.js";
|
|
29
29
|
import { t as index_d_exports$19 } from "./index-C5uEKchX.js";
|
|
30
|
-
import { t as index_d_exports$11 } from "./index-
|
|
30
|
+
import { t as index_d_exports$11 } from "./index-D56fE7tl.js";
|
|
31
31
|
import { t as index_d_exports$21 } from "./index-B4ckqUZX.js";
|
|
32
32
|
import { s as index_d_exports$25 } from "./index-BrRQe24P.js";
|
|
33
33
|
import { C as getLocale, S as getLanguage, T as t, b as Translator, r as index_d_exports$12, w as hasI18n, x as createTranslator, y as I18nCapableContext } from "./index-CPQDMSFS.js";
|
|
@@ -38,12 +38,12 @@ import { a as index_d_exports$14 } from "./index-BmL-JjQK.js";
|
|
|
38
38
|
import { a as index_d_exports$15 } from "./index-Base-sg5.js";
|
|
39
39
|
import { t as index_d_exports$3 } from "./index-BVOL7458.js";
|
|
40
40
|
import { t as index_d_exports$9 } from "./index-XkPephwV.js";
|
|
41
|
-
import { t as index_d_exports$7 } from "./index-
|
|
41
|
+
import { t as index_d_exports$7 } from "./index-BFNCCa2W.js";
|
|
42
42
|
import { a as index_d_exports$2, c as verifyCaptchaIfEnabled, n as RecaptchaVerifyResult, o as isCaptchaEnabled, s as verifyCaptcha, t as RecaptchaVerifyOptions } from "./index-yBSjMY32.js";
|
|
43
43
|
import { t as index_d_exports$20 } from "./index-DY3dNhMN.js";
|
|
44
44
|
import { B as validateUsername, D as assertRbacCoverage, E as analyzeRbacCoverage, F as validateUserFields, G as lengthInCodePoints, H as NAME_MIN_LENGTH, I as USERNAME_MAX_LENGTH, K as validateName, L as USERNAME_MIN_LENGTH, M as UserFieldKey, N as UserFieldsValidationResult, P as ValidatedUserFields, R as UsernameErrorCode, U as NameErrorCode, V as NAME_MAX_LENGTH, W as NameValidationResult, _ as RbacCoverageError, b as RbacCoverageSource, j as UserFieldError, t as index_d_exports$26, v as RbacCoverageOptions, y as RbacCoverageReport, z as UsernameValidationResult } from "./index-CIgoeobA.js";
|
|
45
45
|
import { A as normalizeTemplateKey, C as isSameTemplateKey, D as normalizeProductSlug, E as normalizeGraphQLName, F as templateKeyVariants, I as toCurrentName, L as toLegacyName, M as quotaKeyVariants, N as rbacResourceVariants, O as normalizeQuotaKey, P as readRenamedEnv, S as isSameRbacResource, T as normalizeBillingId, _ as isSameBillingId, a as ProductRename, b as isSameProductSlug, c as billingIdVariants, d as emitProductSlug, f as emitQuotaKey, g as isLegacyName, h as index_d_exports$22, i as PRODUCT_SLUG_ALIASES, j as productSlugVariants, k as normalizeRbacResource, l as emitBillingId, m as emitTemplateKey, n as PRODUCT_RENAMES, o as RENAME_CONCERNS, p as emitRbacResource, r as PRODUCT_RENAME_EMIT, s as RenameConcern, t as EmitGeneration, u as emitName, v as isSameGraphQLName, w as nameVariants, x as isSameQuotaKey, y as isSameName } from "./index-BBqooJ52.js";
|
|
46
|
-
import { A as assertDsarOrchestrator, C as DSAR_REQUIRE_VERIFIED_SERVICE_TOKEN_ENV, D as DsarOrchestratorRejectionReason, E as DsarOrchestratorOptions, M as isDsarOrchestratorActor, N as resolveDsarCallerIdentity, O as ResolvedDsarCaller, S as DSAR_ALLOWED_ORCHESTRATORS_ENV, T as DsarOrchestratorForbiddenError, j as getAllowedDsarOrchestrators, k as VERIFIED_SERVICE_IDENTITY_HEADER, w as DsarOrchestratorContext, x as DEFAULT_DSAR_ORCHESTRATOR_ID } from "./index-
|
|
46
|
+
import { A as assertDsarOrchestrator, C as DSAR_REQUIRE_VERIFIED_SERVICE_TOKEN_ENV, D as DsarOrchestratorRejectionReason, E as DsarOrchestratorOptions, M as isDsarOrchestratorActor, N as resolveDsarCallerIdentity, O as ResolvedDsarCaller, S as DSAR_ALLOWED_ORCHESTRATORS_ENV, T as DsarOrchestratorForbiddenError, j as getAllowedDsarOrchestrators, k as VERIFIED_SERVICE_IDENTITY_HEADER, w as DsarOrchestratorContext, x as DEFAULT_DSAR_ORCHESTRATOR_ID } from "./index-BaB4Nsv7.js";
|
|
47
47
|
interface TenantBackendClientConfig {
|
|
48
48
|
tenantBackendUrl: string;
|
|
49
49
|
workspacesBackendUrl?: string;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { c as tenant_notifications_exports, r as NotificationsModule, s as Tenan
|
|
|
9
9
|
import { c as createRBACDirectiveFromEnv, o as createRBACDirective, s as createRBACDirectiveForLayer, t as RBACModule } from "./rbac-pRCcWVS_.js";
|
|
10
10
|
import { ActivityModule, ActivityOperationUnsupportedError } from "./activity/index.js";
|
|
11
11
|
import { a as UsageModule, c as BillingUsageClient } from "./usage-BK7eyP42.js";
|
|
12
|
-
import { t as TrackerModule } from "./tracker-
|
|
12
|
+
import { t as TrackerModule } from "./tracker-CDVYIoCb.js";
|
|
13
13
|
import { DatabaseModule } from "./database/index.js";
|
|
14
14
|
import { T as EventsModule, t as event_queue_exports } from "./event-queue-CKvgAqF3.js";
|
|
15
15
|
import { a as unregisterDisposable, i as registerDisposable, n as disposeAll, r as getRegisteredDisposableCount, t as lifecycle_exports } from "./lifecycle-DeoLSX0U.js";
|
|
@@ -30,8 +30,8 @@ import { a as TemporalClient, i as TemporalWorkerManager, n as TemporalWorker, o
|
|
|
30
30
|
import { t as cache_exports } from "./cache-CU0uLwcS.js";
|
|
31
31
|
import { t as middleware_exports } from "./middleware-Cq0zFMGp.js";
|
|
32
32
|
import { t as observability_exports } from "./observability-DBDXipTU.js";
|
|
33
|
-
import { t as graphql_exports } from "./graphql-
|
|
34
|
-
import { t as prisma_exports } from "./prisma-
|
|
33
|
+
import { t as graphql_exports } from "./graphql-DzzWneMu.js";
|
|
34
|
+
import { t as prisma_exports } from "./prisma-CUij0pph.js";
|
|
35
35
|
import { v as utils_exports } from "./utils-DpW6K_iB.js";
|
|
36
36
|
import { a as getLanguage, c as t, i as createTranslator, o as getLocale, r as i18n_exports, s as hasI18n } from "./i18n-BBMYFd0P.js";
|
|
37
37
|
import { t as export_exports } from "./export-D3EySJjJ.js";
|