@classytic/arc 2.28.0 → 2.31.0
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/LICENSE +1 -1
- package/README.md +7 -0
- package/TRADEMARK.md +22 -0
- package/dist/{BaseController-B65zbz9m.mjs → BaseController-De7GqHck.mjs} +25 -24
- package/dist/{EventTransport-QmY7A258.d.mts → EventTransport-2uVV34WU.d.mts} +1 -0
- package/dist/EventTransport-9mlTgqzE.mjs +104 -0
- package/dist/{HookSystem-C1vB_Gc9.mjs → HookSystem-BcmPyq5I.mjs} +16 -35
- package/dist/{QueryCache-DOMT_iq7.d.mts → QueryCache-DFA-QrU9.d.mts} +2 -1
- package/dist/{ResourceRegistry-y9Hnypus.mjs → ResourceRegistry-qq0mn2s9.mjs} +3 -2
- package/dist/{actionPermissions-CAphcmUG.mjs → actionPermissions-BE5NwaQk.mjs} +1 -0
- package/dist/audit/index.d.mts +3 -2
- package/dist/audit/index.mjs +3 -2
- package/dist/auth/audit.d.mts +1 -0
- package/dist/auth/audit.mjs +1 -0
- package/dist/auth/index.d.mts +5 -4
- package/dist/auth/index.mjs +6 -5
- package/dist/auth/redis-session.d.mts +2 -1
- package/dist/auth/redis-session.mjs +1 -0
- package/dist/authorizationDecision-ChvUQGG1.mjs +266 -0
- package/dist/{buildHandler-Dtwd8fdz.mjs → buildHandler-CDrCJzmB.mjs} +34 -7
- package/dist/cache/index.d.mts +4 -3
- package/dist/cache/index.mjs +4 -3
- package/dist/{caching-_NJeDd1_.mjs → caching-BFHA6Scf.mjs} +2 -1
- package/dist/cleanup/index.d.mts +4 -3
- package/dist/cleanup/index.mjs +9 -13
- package/dist/cli/commands/describe.d.mts +2 -1
- package/dist/cli/commands/describe.mjs +3 -2
- package/dist/cli/commands/docs.d.mts +1 -0
- package/dist/cli/commands/docs.mjs +3 -2
- package/dist/cli/commands/doctor.d.mts +1 -0
- package/dist/cli/commands/doctor.mjs +1 -0
- package/dist/cli/commands/generate.d.mts +2 -1
- package/dist/cli/commands/generate.mjs +2 -1
- package/dist/cli/commands/init.d.mts +2 -1
- package/dist/cli/commands/init.mjs +2 -1
- package/dist/cli/commands/introspect.d.mts +1 -0
- package/dist/cli/commands/introspect.mjs +2 -1
- package/dist/cli/index.d.mts +3 -2
- package/dist/cli/index.mjs +3 -2
- package/dist/{constants-DNre0wRg.mjs → constants-D3Dv4LAV.mjs} +1 -0
- package/dist/context/index.d.mts +1 -0
- package/dist/context/index.mjs +3 -2
- package/dist/core/index.d.mts +3 -2
- package/dist/core/index.mjs +7 -5
- package/dist/{core-BGa8TXJR.mjs → core-BGpIxINN.mjs} +4 -49
- package/dist/{createActionRouter-C-N7z2EL.mjs → createActionRouter-CDXEdasl.mjs} +8 -7
- package/dist/{createAggregationRouter-wzwFa_dW.mjs → createAggregationRouter-KrQDzx-k.mjs} +10 -22
- package/dist/{createApp-Du5G54TM.mjs → createApp-Df89BEni.mjs} +505 -209
- package/dist/defineAggregation-DbPPS8RI.mjs +48 -0
- package/dist/{defineResource-2zvVVpxg.mjs → defineResource-Bv6EtN1x.mjs} +90 -72
- package/dist/discovery/index.d.mts +1 -0
- package/dist/discovery/index.mjs +1 -0
- package/dist/docs/index.d.mts +3 -2
- package/dist/docs/index.mjs +3 -2
- package/dist/{elevation-C9s5hFP_.d.mts → elevation-BXCfVcNG.d.mts} +1 -0
- package/dist/{elevation-CIz1GjGm.mjs → elevation-D2l1mh4g.mjs} +4 -3
- package/dist/encryption/index.d.mts +2 -1
- package/dist/encryption/index.mjs +3 -2
- package/dist/{errorHandler-Bq2OeEQL.mjs → errorHandler-C5NeD6bT.mjs} +3 -2
- package/dist/{errorHandler-C6yv4ZTW.d.mts → errorHandler-CpYUJmPA.d.mts} +1 -0
- package/dist/{errors-DHcHVAgk.d.mts → errors-BGdVwP25.d.mts} +1 -0
- package/dist/{errors-DkO8Nk6-.mjs → errors-Cj42AntO.mjs} +1 -0
- package/dist/{eventPlugin-DrQ_FesK.mjs → eventPlugin-CkffEihm.mjs} +6 -106
- package/dist/{eventPlugin-Bg3cP2_u.d.mts → eventPlugin-GF5nnBIq.d.mts} +2 -1
- package/dist/events/index.d.mts +4 -3
- package/dist/events/index.mjs +17 -340
- package/dist/events/transports/redis-stream-entry.d.mts +2 -1
- package/dist/events/transports/redis-stream-entry.mjs +1 -0
- package/dist/events/transports/redis.d.mts +2 -1
- package/dist/events/transports/redis.mjs +1 -0
- package/dist/{externalPaths-BE6wFpYv.d.mts → externalPaths-CmGOxOtD.d.mts} +1 -0
- package/dist/factory/index.d.mts +9 -5
- package/dist/factory/index.mjs +7 -6
- package/dist/{fastify-augmentation-OzYGIiU1.d.mts → fastify-augmentation-zh0_AYHa.d.mts} +13 -4
- package/dist/{applyPermissionResult-BnyVE9eD.mjs → fields-CB5Cuzk9.mjs} +2 -107
- package/dist/{fields-D3lhgzhD.d.mts → fields-I_EeRWND.d.mts} +1 -0
- package/dist/{generate-BnsL9GBm.d.mts → generate-DCGuEbqI.d.mts} +1 -0
- package/dist/{generate-D0wZupBg.mjs → generate-EcA6ui4i.mjs} +2 -1
- package/dist/{headers-BvlQSDMB.mjs → headers-3zvE0rM3.mjs} +2 -1
- package/dist/{health-CB_m4S32.mjs → health-DjZYjM7H.mjs} +1 -0
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/idempotency/index.d.mts +3 -2
- package/dist/idempotency/index.mjs +5 -4
- package/dist/idempotency/redis.d.mts +2 -1
- package/dist/idempotency/redis.mjs +1 -0
- package/dist/{index-CjVg-Epg.d.mts → index-Bc2ox8_U.d.mts} +6 -5
- package/dist/{index-CG4yqMDB.d.mts → index-C-481Zf2.d.mts} +74 -18
- package/dist/{index-BMnbzvtO.d.mts → index-CEJNZFtX.d.mts} +242 -24
- package/dist/index-CFThn1K9.d.mts +224 -0
- package/dist/{index-DPRH0Cme.d.mts → index-CpzxqePp.d.mts} +203 -97
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +11 -9
- package/dist/{init-tlRSt667.mjs → init-BEiNZBsJ.mjs} +19 -23
- package/dist/{init-BPEu8cs-.d.mts → init-Cscs4lab.d.mts} +1 -0
- package/dist/integrations/event-gateway.d.mts +3 -2
- package/dist/integrations/event-gateway.mjs +2 -1
- package/dist/integrations/index.d.mts +4 -3
- package/dist/integrations/index.mjs +1 -0
- package/dist/integrations/jobs/index.d.mts +2 -1
- package/dist/integrations/jobs/index.mjs +108 -32
- package/dist/integrations/mcp/index.d.mts +9 -9
- package/dist/integrations/mcp/index.mjs +2 -1
- package/dist/integrations/mcp/testing.d.mts +3 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.d.mts +1 -0
- package/dist/integrations/streamline.mjs +3 -2
- package/dist/integrations/webhooks.d.mts +1 -0
- package/dist/integrations/webhooks.mjs +1 -0
- package/dist/integrations/websocket-pushref-redis.d.mts +2 -1
- package/dist/integrations/websocket-pushref-redis.mjs +1 -0
- package/dist/integrations/websocket-redis.d.mts +2 -1
- package/dist/integrations/websocket-redis.mjs +1 -0
- package/dist/integrations/websocket.d.mts +3 -2
- package/dist/integrations/websocket.mjs +1 -0
- package/dist/{interface-BGZCzOGL.d.mts → interface-BOk3YnTz.d.mts} +1 -0
- package/dist/{interface-Uk8ONJv7.d.mts → interface-DEWNOMza.d.mts} +1 -0
- package/dist/{interface-n5hpKg1d.mjs → interface-DYzM0q-u.mjs} +1 -0
- package/dist/{jsonBody-BlzAoGCe.mjs → jsonBody-BYbLDi5D.mjs} +2 -1
- package/dist/{keys-Cd316u_y.mjs → keys-C0_pa1tY.mjs} +1 -0
- package/dist/{loadResources-DpU8pfjV.mjs → loadResources-yawi9tAE.mjs} +2 -1
- package/dist/{loadResourcesFromEntry-kvGT6EcO.mjs → loadResourcesFromEntry-BAjYZonx.mjs} +2 -1
- package/dist/logger/index.d.mts +1 -0
- package/dist/logger/index.mjs +1 -0
- package/dist/{mcpPlugin-Cs6nRGCt.mjs → mcpPlugin-B_es0hiF.mjs} +52 -60
- package/dist/{memory-CmnzXE5Z.mjs → memory-DR6wpa9F.mjs} +2 -1
- package/dist/{metrics-fdxI5mn_.mjs → metrics-CUdw_wLB.mjs} +2 -1
- package/dist/middleware/index.d.mts +2 -1
- package/dist/middleware/index.mjs +3 -2
- package/dist/migrations/index.d.mts +1 -3
- package/dist/migrations/index.mjs +2 -4
- package/dist/module-0pFJA6YW.mjs +78 -0
- package/dist/{multipartBody-D0eBvkeq.mjs → multipartBody-wOgj_fnj.mjs} +1 -0
- package/dist/{openapi-BLV4OMXb.mjs → openapi-B2L4js1v.mjs} +6 -5
- package/dist/permissions/index.d.mts +5 -4
- package/dist/permissions/index.mjs +6 -4
- package/dist/{permissions-BrtiBKGs.mjs → permissions-L--QDAir.mjs} +518 -316
- package/dist/{pipe-BOLmGIxa.mjs → pipe-DRDNsI2T.mjs} +2 -1
- package/dist/pipeline/index.d.mts +2 -1
- package/dist/pipeline/index.mjs +2 -1
- package/dist/{pipeline-BGRnV-To.mjs → pipeline-UPQFatit.mjs} +7 -20
- package/dist/plugins/index.d.mts +8 -7
- package/dist/plugins/index.mjs +16 -15
- package/dist/plugins/response-cache.d.mts +1 -0
- package/dist/plugins/response-cache.mjs +2 -1
- package/dist/plugins/tracing-entry.d.mts +2 -1
- package/dist/plugins/tracing-entry.mjs +2 -1
- package/dist/{pluralize-BhrgwZb9.mjs → pluralize-O0FZgESl.mjs} +1 -0
- package/dist/{preloadResources-CM4uUaFv.d.mts → preloadResources-CyoJMSiO.d.mts} +117 -12
- package/dist/{preloadResources-DSY5HGpS.mjs → preloadResources-Dz6BjzM6.mjs} +1 -0
- package/dist/presets/filesUpload.d.mts +6 -5
- package/dist/presets/filesUpload.mjs +9 -11
- package/dist/presets/index.d.mts +15 -2
- package/dist/presets/index.mjs +2 -1
- package/dist/presets/multiTenant.d.mts +2 -1
- package/dist/presets/multiTenant.mjs +3 -2
- package/dist/presets/search.d.mts +3 -2
- package/dist/presets/search.mjs +2 -1
- package/dist/{presets-DwFDVKP0.mjs → presets-C4-g4_4P.mjs} +27 -10
- package/dist/projection-BHw6xlOQ.mjs +18 -0
- package/dist/{pushref-registry-BbcnpNTm.d.mts → pushref-registry-Dov9l4qE.d.mts} +1 -0
- package/dist/{queryCachePlugin-DSGuSVLW.mjs → queryCachePlugin-BZr8v46E.mjs} +5 -4
- package/dist/{queryCachePlugin-br4otiqF.d.mts → queryCachePlugin-BzqxconG.d.mts} +3 -2
- package/dist/{rateLimit-DrED-C4v.mjs → rateLimit-CMPY5Qms.mjs} +7 -3
- package/dist/{rateLimitKey-BoWRH3e7.mjs → rateLimitKey-Dn5JNmkj.mjs} +1 -0
- package/dist/{realtime-DEuDu9io.mjs → realtime-C5NoxWFY.mjs} +20 -8
- package/dist/{redis-UDtLaNj6.d.mts → redis-CduhKsJi.d.mts} +2 -1
- package/dist/{redis-stream-uIaauNpZ.d.mts → redis-stream-qN6A-RFv.d.mts} +2 -1
- package/dist/{registerRoute-DTp18Ah_.mjs → registerRoute-CBN84fc7.mjs} +5 -2
- package/dist/registry/index.d.mts +3 -2
- package/dist/registry/index.mjs +3 -2
- package/dist/{registry-9km_w1aP.mjs → registry-4213U4zb.mjs} +3 -2
- package/dist/{renewingLease-3cuQH7h8.mjs → renewingLease-Dll8mGgc.mjs} +1 -0
- package/dist/{replyHelpers-67tRawQZ.mjs → replyHelpers-DIiZKGUt.mjs} +2 -1
- package/dist/repositoryFilter-f9eAfq_l.mjs +45 -0
- package/dist/{requestContext-MrlJwECf.mjs → requestContext-2TxXOJ7T.mjs} +1 -0
- package/dist/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-CUsjNX9R.mjs} +1 -0
- package/dist/{schedules-CjOd2MG9.mjs → schedules-DdtlICTf.mjs} +3 -2
- package/dist/{schemaConverter-DJvodiHj.mjs → schemaConverter-D--wdJM-.mjs} +70 -17
- package/dist/{schemaIR-Ca7ySNPx.mjs → schemaIR-Bm2enbnh.mjs} +2 -1
- package/dist/schemas/index.d.mts +1 -0
- package/dist/schemas/index.mjs +1 -0
- package/dist/scim/index.d.mts +1 -0
- package/dist/scim/index.mjs +2 -1
- package/dist/scope/index.d.mts +3 -2
- package/dist/scope/index.mjs +5 -4
- package/dist/{scope-DfaPntpo.mjs → scope-DHx5Fous.mjs} +4 -3
- package/dist/{sessionManager-BHOM3N_0.d.mts → sessionManager-qimlKV0P.d.mts} +1 -0
- package/dist/{simpleEqualityMatcher-Cg05HPsn.mjs → simpleEqualityMatcher-DjQJ7FKA.mjs} +1 -0
- package/dist/{sse-BQ1w0dfl.mjs → sse-CUTo9y0X.mjs} +5 -4
- package/dist/{sseStream-BQ7Qaynp.mjs → sseStream-B_5XcVVd.mjs} +2 -1
- package/dist/{storage-DLUZ04kK.d.mts → storage-Cx9Sz3Ou.d.mts} +1 -0
- package/dist/{store-helpers-DY6xq4sM.mjs → store-helpers-D1MP_gRG.mjs} +1 -0
- package/dist/{streaming-BQcW6_Kq.mjs → streaming-PSZwi8JV.mjs} +1 -0
- package/dist/subscribe-helpers-C0Tb2aUp.mjs +340 -0
- package/dist/sync/changelog.d.mts +1 -0
- package/dist/sync/changelog.mjs +1 -0
- package/dist/testing/cleanupStoreContract.d.mts +2 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -0
- package/dist/testing/index.d.mts +167 -12
- package/dist/testing/index.mjs +522 -205
- package/dist/testing/outboxStoreContract.d.mts +1 -0
- package/dist/testing/outboxStoreContract.mjs +1 -0
- package/dist/testing/storageContract.d.mts +2 -1
- package/dist/testing/storageContract.mjs +1 -0
- package/dist/{tracing-CsGKQJGg.d.mts → tracing-Dro5eH6j.d.mts} +1 -0
- package/dist/{transactionContext-PNdoyLLm.mjs → transactionContext-dAfBVUrk.mjs} +1 -0
- package/dist/{typeGuards-C9KXUly6.mjs → typeGuards-B0ryPo3I.mjs} +1 -0
- package/dist/types/index.d.mts +6 -5
- package/dist/types/index.mjs +1 -0
- package/dist/types/storage.d.mts +2 -1
- package/dist/types/storage.mjs +1 -0
- package/dist/{types-Dmw-6Qeo.d.mts → types-B7XeLEgK.d.mts} +127 -90
- package/dist/{types-Cc91nXuA.d.mts → types-ByHn9rEO.d.mts} +1 -0
- package/dist/{types-C_ZZRcD6.d.mts → types-C4QE8qnm.d.mts} +1 -0
- package/dist/{types-Cu6vVJmh.d.mts → types-CBgvkp8O.d.mts} +82 -12
- package/dist/{types-DjC-KUCz.d.mts → types-ChuShpCP.d.mts} +1 -0
- package/dist/{types-QFGc3Cjv.d.mts → types-CwcUQ610.d.mts} +2 -6
- package/dist/{types-CSyCxl2V.mjs → types-Cys0ko9Z.mjs} +4 -3
- package/dist/usage/index.d.mts +3 -2
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-Cg_y3fBz.mjs → userHelpers-ChYJ6CdK.mjs} +1 -0
- package/dist/utils/index.d.mts +16 -10
- package/dist/utils/index.mjs +10 -9
- package/dist/{utils-taUVD4p3.mjs → utils-vL8BrDE2.mjs} +3 -2
- package/dist/{validate-Bk44F2yT.mjs → validate-_KbifpHF.mjs} +2 -1
- package/dist/{versioning-gKWyryT3.mjs → versioning-CHDTor3P.mjs} +3 -2
- package/dist/{versioning-DXgY5BUm.d.mts → versioning-D_rhHfZm.d.mts} +5 -2
- package/dist/{websocket-_Pd0CgR0.d.mts → websocket-BOXVggMf.d.mts} +2 -1
- package/package.json +15 -7
- package/skills/arc/SKILL.md +22 -8
- package/skills/arc/references/api-reference.md +4 -0
- package/skills/arc/references/auth.md +3 -0
- package/skills/arc/references/integrations.md +33 -0
- package/skills/arc/references/mcp.md +6 -7
- package/skills/arc/references/production.md +24 -25
- package/skills/arc-code-review/references/anti-patterns.md +3 -3
- package/dist/index-CZY4EGga.d.mts +0 -107
- package/dist/module-_-M7C5ES.mjs +0 -29
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CUsjNX9R.mjs";
|
|
2
3
|
import { arcLog } from "./logger/index.mjs";
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { n as evaluateAndApplyPermission } from "./authorizationDecision-ChvUQGG1.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-ChYJ6CdK.mjs";
|
|
6
|
+
import { c as getOrgId } from "./types-Cys0ko9Z.mjs";
|
|
7
|
+
import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-DjQJ7FKA.mjs";
|
|
8
|
+
import { t as applyFieldReadPermissions } from "./fields-CB5Cuzk9.mjs";
|
|
9
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-PSZwi8JV.mjs";
|
|
10
|
+
import { t as openSseStream } from "./sseStream-B_5XcVVd.mjs";
|
|
9
11
|
import fp from "fastify-plugin";
|
|
10
12
|
//#region src/plugins/realtime.ts
|
|
11
13
|
var realtime_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
DEFAULT_MAX_CONNECTION_MS: () => DEFAULT_MAX_CONNECTION_MS,
|
|
12
15
|
buildChangeFrame: () => buildChangeFrame,
|
|
13
16
|
connectionDeadlineMs: () => connectionDeadlineMs,
|
|
14
17
|
default: () => realtime_default,
|
|
@@ -37,6 +40,15 @@ const MAX_MULTIPLEX_RESOURCES = 20;
|
|
|
37
40
|
/** Node's `setTimeout` ceiling (~24.8 days); larger delays fire immediately. */
|
|
38
41
|
const MAX_TIMER_MS = 2147483647;
|
|
39
42
|
/**
|
|
43
|
+
* Secure default lease when no other bound applies (session/cookie auth with no
|
|
44
|
+
* token `exp`, and no explicit `maxConnectionMs`). A change feed snapshots its
|
|
45
|
+
* permission filters at connect, so without ANY ceiling a revoked caller would
|
|
46
|
+
* keep their old view forever. 30 minutes bounds that staleness while not
|
|
47
|
+
* churning connections. A host that truly wants a longer-lived feed sets
|
|
48
|
+
* `maxConnectionMs` explicitly (up to `MAX_TIMER_MS`).
|
|
49
|
+
*/
|
|
50
|
+
const DEFAULT_MAX_CONNECTION_MS = 30 * 6e4;
|
|
51
|
+
/**
|
|
40
52
|
* Milliseconds from `now` until the feed should force-close to bound
|
|
41
53
|
* permission staleness — `min(auth-token exp, maxConnectionMs)`. Returns
|
|
42
54
|
* `undefined` when neither bound applies (no `exp` claim, no cap → the feed
|
|
@@ -146,7 +158,7 @@ function buildChangeFrame(event, resourceName, data) {
|
|
|
146
158
|
});
|
|
147
159
|
}
|
|
148
160
|
const realtimePlugin = async (fastify, opts = {}) => {
|
|
149
|
-
const { path = "/realtime/:resource", heartbeat = 3e4, resources: allowlist, operations = CHANGE_OPERATIONS, tokenQueryParam = "token", maxConnectionMs } = opts;
|
|
161
|
+
const { path = "/realtime/:resource", heartbeat = 3e4, resources: allowlist, operations = CHANGE_OPERATIONS, tokenQueryParam = "token", maxConnectionMs = DEFAULT_MAX_CONNECTION_MS } = opts;
|
|
150
162
|
if (!fastify.hasDecorator("events")) {
|
|
151
163
|
log.warn("Events plugin (arc-events) not registered. Realtime plugin will not function. Register eventPlugin before realtimePlugin.");
|
|
152
164
|
return;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { n as IdempotencyResult, r as IdempotencyStore } from "./interface-DEWNOMza.mjs";
|
|
2
3
|
//#region src/idempotency/stores/redis.d.ts
|
|
3
4
|
interface RedisClient {
|
|
4
5
|
get(key: string): Promise<string | null>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler } from "./EventTransport-2uVV34WU.mjs";
|
|
2
3
|
//#region src/events/transports/redis-stream.d.ts
|
|
3
4
|
interface RedisStreamLike {
|
|
4
5
|
xadd(key: string, id: string, ...fieldValues: string[]): Promise<string | null>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { n as evaluateAndApplyPermission } from "./
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evaluateAndApplyPermission } from "./authorizationDecision-ChvUQGG1.mjs";
|
|
3
|
+
import { f as createError } from "./errors-Cj42AntO.mjs";
|
|
4
|
+
import { u as getRequestScope } from "./types-Cys0ko9Z.mjs";
|
|
3
5
|
//#region src/core/middlewares/permissions.ts
|
|
4
6
|
/**
|
|
5
7
|
* Build a PermissionContext from a Fastify request. Extracted so the CRUD
|
|
@@ -11,6 +13,7 @@ function buildPermissionContext(req, opts) {
|
|
|
11
13
|
const params = req.params;
|
|
12
14
|
return {
|
|
13
15
|
user: reqWithExtras.user ?? null,
|
|
16
|
+
scope: getRequestScope(req),
|
|
14
17
|
request: req,
|
|
15
18
|
resource: opts.resource,
|
|
16
19
|
action: opts.action,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import "../
|
|
1
|
+
|
|
2
|
+
import { K as ResolvedTenantPurge, R as RegisterOptions, V as ResourceDefinition, X as CrudRouteKey, k as IntrospectionPluginOptions, p as RegistryEntry, z as ResourceRegistry } from "../index-CpzxqePp.mjs";
|
|
3
|
+
import "../fastify-augmentation-zh0_AYHa.mjs";
|
|
3
4
|
import { FastifyPluginAsync } from "fastify";
|
|
4
5
|
import { TenantPurgeProgress, TenantPurgeStrategy } from "@classytic/repo-core/repository";
|
|
5
6
|
//#region src/registry/assertNoTenantData.d.ts
|
package/dist/registry/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { t as
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-4213U4zb.mjs";
|
|
3
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-qq0mn2s9.mjs";
|
|
3
4
|
export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "./constants-D3Dv4LAV.mjs";
|
|
2
3
|
import fp from "fastify-plugin";
|
|
3
4
|
//#region src/registry/assertNoTenantData.ts
|
|
4
5
|
/**
|
|
@@ -440,7 +441,7 @@ var introspectionPlugin_default = fp(introspectionPlugin, { name: "arc-introspec
|
|
|
440
441
|
//#endregion
|
|
441
442
|
//#region src/registry/manifest.ts
|
|
442
443
|
/**
|
|
443
|
-
* Resource manifest for frontend code generators
|
|
444
|
+
* Resource manifest for frontend code generators.
|
|
444
445
|
*
|
|
445
446
|
* Every host that hand-rolls a `createCrudApi('foo')` helper on the frontend
|
|
446
447
|
* ends up rewriting the same shim for declarative actions: `postAction(id,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CUsjNX9R.mjs";
|
|
2
3
|
import { toCanonicalList } from "@classytic/repo-core/pagination";
|
|
3
4
|
import fp from "fastify-plugin";
|
|
4
5
|
//#region src/plugins/replyHelpers.ts
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { arcLog } from "./logger/index.mjs";
|
|
3
|
+
import { policyRecordToFilter } from "@classytic/repo-core/filter";
|
|
4
|
+
//#region src/core/repositoryFilter.ts
|
|
5
|
+
const log = arcLog("repository-filter");
|
|
6
|
+
let warnedUnconvertible = false;
|
|
7
|
+
/** True for a `{ $op: ... }` operator object (all keys `$`-prefixed). */
|
|
8
|
+
function isOperatorObject(value) {
|
|
9
|
+
if (value === null || typeof value !== "object") return false;
|
|
10
|
+
if (Array.isArray(value) || value instanceof Date) return false;
|
|
11
|
+
const keys = Object.keys(value);
|
|
12
|
+
return keys.length > 0 && keys.some((k) => k.startsWith("$"));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Does this compound filter contain any `$`-operator (top-level logical like
|
|
16
|
+
* `$and`/`$or`, or a field operator object like `{ $in: [...] }`)? If not, it is
|
|
17
|
+
* pure flat equality and portable as-is.
|
|
18
|
+
*/
|
|
19
|
+
function filterHasDollarOperator(record) {
|
|
20
|
+
for (const [key, value] of Object.entries(record)) {
|
|
21
|
+
if (key.startsWith("$")) return true;
|
|
22
|
+
if (isOperatorObject(value)) return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Normalize a compound query/policy filter for the repository layer. Flat
|
|
28
|
+
* equality records pass through unchanged; anything carrying `$`-operators is
|
|
29
|
+
* converted to the portable repo-core {@link Filter} IR so it compiles
|
|
30
|
+
* identically on Mongo, SQLite, Postgres, and custom adapters.
|
|
31
|
+
*/
|
|
32
|
+
function toRepositoryFilter(record) {
|
|
33
|
+
if (!filterHasDollarOperator(record)) return record;
|
|
34
|
+
try {
|
|
35
|
+
return policyRecordToFilter(record);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
if (!warnedUnconvertible) {
|
|
38
|
+
warnedUnconvertible = true;
|
|
39
|
+
log.warn(`A \`\$\`-operator filter could not be normalized to portable Filter IR (operator outside arc's policy dialect). Passing the raw record to the repository — MongoKit handles it; non-Mongo kits may not. (${err instanceof Error ? err.message : String(err)})`);
|
|
40
|
+
}
|
|
41
|
+
return record;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { toRepositoryFilter as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { t as
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CUsjNX9R.mjs";
|
|
3
|
+
import { t as startRenewingLease } from "./renewingLease-Dll8mGgc.mjs";
|
|
3
4
|
import fp from "fastify-plugin";
|
|
4
5
|
//#region src/plugins/schedules.ts
|
|
5
6
|
var schedules_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
1
2
|
import { arcLog } from "./logger/index.mjs";
|
|
2
3
|
//#region src/utils/schemaConverter.ts
|
|
3
4
|
/**
|
|
@@ -25,12 +26,53 @@ import { arcLog } from "./logger/index.mjs";
|
|
|
25
26
|
* Using `draft-7` fixes `.positive() / .negative() / .gt() / .lt()` out of the box.
|
|
26
27
|
* - **`openapi-3.0`** — for OpenAPI doc generation (arc emits OpenAPI 3.0.3). Keeps
|
|
27
28
|
* the boolean exclusive form that 3.0 tooling expects.
|
|
29
|
+
*
|
|
30
|
+
* ## Input vs output (`io`)
|
|
31
|
+
*
|
|
32
|
+
* A Zod schema has TWO shapes and `z.toJSONSchema()` emits one of them. Getting
|
|
33
|
+
* this wrong is not cosmetic — it rejects legal traffic:
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* z.object({ title: z.string(), status: z.string().default("draft") })
|
|
37
|
+
* // io: "output" → required: ["title", "status"] ← a client omitting `status` is REJECTED
|
|
38
|
+
* // io: "input" → required: ["title"] ← correct: the default fills it in
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* The same applies to `.transform()`: in output mode the node is unrepresentable
|
|
42
|
+
* and degrades to `{}` (no validation at all), while input mode emits the real
|
|
43
|
+
* input type. So arc converts by DIRECTION:
|
|
44
|
+
*
|
|
45
|
+
* - **request** (`body`, `querystring`, `params`, `headers`) → `io: "input"` —
|
|
46
|
+
* validates what the client SENDS, before defaults/transforms/coercion apply.
|
|
47
|
+
* - **response** (and the `entity` doc shape) → `io: "output"` — describes what
|
|
48
|
+
* the server RETURNS, after they apply.
|
|
49
|
+
*
|
|
50
|
+
* One deliberate consequence: a plain `z.object()` emits
|
|
51
|
+
* `additionalProperties: false` in output mode but NOT in input mode, because
|
|
52
|
+
* `z.object()` STRIPS unknown keys rather than rejecting them — so extra keys
|
|
53
|
+
* are legal input. Use `z.strictObject()` when the wire contract must reject
|
|
54
|
+
* them; it keeps `additionalProperties: false` in both modes.
|
|
28
55
|
*/
|
|
29
56
|
const log = arcLog("schema");
|
|
30
57
|
/** Default target for Fastify-consumed schemas (matches Fastify v5's default AJV draft). */
|
|
31
58
|
const DEFAULT_FASTIFY_TARGET = "draft-7";
|
|
32
59
|
/** Default target for OpenAPI document generation (matches arc's emitted OpenAPI version). */
|
|
33
60
|
const DEFAULT_OPENAPI_TARGET = "openapi-3.0";
|
|
61
|
+
/**
|
|
62
|
+
* Map arc's target onto one Zod actually branches on.
|
|
63
|
+
*
|
|
64
|
+
* Zod's `target` is typed `"draft-04" | "draft-07" | "draft-2020-12" |
|
|
65
|
+
* "openapi-3.0" | ({} & string)` — that last member accepts ANY string without
|
|
66
|
+
* narrowing, so an unrecognized value is not rejected, it just matches none of
|
|
67
|
+
* the internal `target === ...` branches and silently gets draft-2020-12
|
|
68
|
+
* behaviour. `"draft-7"` is safe (Zod normalizes the alias to `"draft-07"`),
|
|
69
|
+
* but `"openapi-3.1"` is neither official nor normalized. Mapping it explicitly
|
|
70
|
+
* keeps the fallback intentional rather than accidental — and it is the right
|
|
71
|
+
* dialect, since OpenAPI 3.1 aligned its Schema Object with JSON Schema 2020-12.
|
|
72
|
+
*/
|
|
73
|
+
function zodTarget(target) {
|
|
74
|
+
return target === "openapi-3.1" ? "draft-2020-12" : target;
|
|
75
|
+
}
|
|
34
76
|
let _toJSONSchema = null;
|
|
35
77
|
const zodReady = import("zod").then(({ z }) => {
|
|
36
78
|
if (typeof z?.toJSONSchema === "function") _toJSONSchema = (schema, opts) => z.toJSONSchema(schema, opts);
|
|
@@ -92,22 +134,33 @@ function unconvertible(mode, message, cause) {
|
|
|
92
134
|
* Pass `openapi-3.0`/`openapi-3.1` for OpenAPI document generation.
|
|
93
135
|
* @param mode Failure policy for unconvertible Zod schemas — see
|
|
94
136
|
* {@link UnconvertibleMode}. Defaults to `'warn'`.
|
|
137
|
+
* @param io Which shape to emit — see {@link SchemaIo} and the module
|
|
138
|
+
* docblock. Defaults to `'output'`, matching Zod's own default;
|
|
139
|
+
* arc's request-side call sites pass `'input'` explicitly.
|
|
95
140
|
*/
|
|
96
|
-
function toJsonSchema(input, target = DEFAULT_FASTIFY_TARGET, mode = "warn") {
|
|
141
|
+
function toJsonSchema(input, target = DEFAULT_FASTIFY_TARGET, mode = "warn", io = "output") {
|
|
97
142
|
if (input == null) return void 0;
|
|
98
143
|
if (typeof input !== "object") return void 0;
|
|
99
|
-
if (isJsonSchema(input))
|
|
144
|
+
if (isJsonSchema(input)) {
|
|
145
|
+
const plain = input;
|
|
146
|
+
if ("$schema" in plain) {
|
|
147
|
+
const { $schema: _dropped, ...rest } = plain;
|
|
148
|
+
return rest;
|
|
149
|
+
}
|
|
150
|
+
return plain;
|
|
151
|
+
}
|
|
100
152
|
if (isZodSchema(input)) {
|
|
101
153
|
if (!_toJSONSchema) return unconvertible(mode, "A Zod schema was passed but zod v4 is not installed (or not yet loaded). Install zod >=4 — arc converts via zod's native z.toJSONSchema().");
|
|
102
154
|
try {
|
|
103
155
|
const converted = _toJSONSchema(input, {
|
|
104
|
-
target,
|
|
156
|
+
target: zodTarget(target),
|
|
157
|
+
io,
|
|
105
158
|
unrepresentable: mode === "throw" ? "throw" : "any"
|
|
106
159
|
});
|
|
107
160
|
if ("$schema" in converted) delete converted.$schema;
|
|
108
161
|
return converted;
|
|
109
162
|
} catch (cause) {
|
|
110
|
-
return unconvertible(mode, `z.toJSONSchema() failed for a Zod schema (target: ${target}): ${cause instanceof Error ? cause.message : String(cause)}.
|
|
163
|
+
return unconvertible(mode, `z.toJSONSchema() failed for a Zod schema (target: ${target}, io: ${io}): ${cause instanceof Error ? cause.message : String(cause)}. Types with no JSON Schema equivalent cannot express wire validation. For \`z.date()\` / \`z.bigint()\` on a REQUEST schema, use the wire-shaped form (\`z.iso.datetime()\` / \`z.string()\`) and convert in a hook — JSON has no date or bigint. For \`.refine()\` / \`.transform()\` / custom checks, enforce them in the handler or a pipeline step.`, cause);
|
|
111
164
|
}
|
|
112
165
|
}
|
|
113
166
|
if (isZodV3Schema(input)) return unconvertible(mode, "A Zod v3 schema was passed (has `_def` but no v4 `_zod` marker). arc requires zod >=4 for schema conversion — upgrade zod, or pass plain JSON Schema.");
|
|
@@ -122,19 +175,19 @@ function toJsonSchema(input, target = DEFAULT_FASTIFY_TARGET, mode = "warn") {
|
|
|
122
175
|
*/
|
|
123
176
|
function convertOpenApiSchemas(schemas, target = DEFAULT_OPENAPI_TARGET) {
|
|
124
177
|
const result = {};
|
|
125
|
-
const schemaFields =
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
for (const field of schemaFields) {
|
|
178
|
+
const schemaFields = {
|
|
179
|
+
entity: "output",
|
|
180
|
+
createBody: "input",
|
|
181
|
+
updateBody: "input",
|
|
182
|
+
params: "input",
|
|
183
|
+
listQuery: "input",
|
|
184
|
+
response: "output"
|
|
185
|
+
};
|
|
186
|
+
for (const [field, io] of Object.entries(schemaFields)) {
|
|
134
187
|
const value = schemas[field];
|
|
135
|
-
if (value !== void 0) result[field] = toJsonSchema(value, target) ?? value;
|
|
188
|
+
if (value !== void 0) result[field] = toJsonSchema(value, target, "warn", io) ?? value;
|
|
136
189
|
}
|
|
137
|
-
for (const [key, value] of Object.entries(schemas)) if (!
|
|
190
|
+
for (const [key, value] of Object.entries(schemas)) if (!(key in schemaFields)) result[key] = value;
|
|
138
191
|
return result;
|
|
139
192
|
}
|
|
140
193
|
/**
|
|
@@ -158,11 +211,11 @@ function convertRouteSchema(schema, target = DEFAULT_FASTIFY_TARGET) {
|
|
|
158
211
|
"querystring",
|
|
159
212
|
"params",
|
|
160
213
|
"headers"
|
|
161
|
-
]) if (result[field] !== void 0) result[field] = toJsonSchema(result[field], target, mode) ?? result[field];
|
|
214
|
+
]) if (result[field] !== void 0) result[field] = toJsonSchema(result[field], target, mode, "input") ?? result[field];
|
|
162
215
|
if (result.response !== void 0 && typeof result.response === "object" && result.response !== null) {
|
|
163
216
|
const responseObj = result.response;
|
|
164
217
|
const convertedResponse = {};
|
|
165
|
-
for (const [statusCode, responseSchema] of Object.entries(responseObj)) convertedResponse[statusCode] = toJsonSchema(responseSchema, target, mode) ?? responseSchema;
|
|
218
|
+
for (const [statusCode, responseSchema] of Object.entries(responseObj)) convertedResponse[statusCode] = toJsonSchema(responseSchema, target, mode, "output") ?? responseSchema;
|
|
166
219
|
result.response = convertedResponse;
|
|
167
220
|
}
|
|
168
221
|
return result;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { o as toJsonSchema } from "./schemaConverter-D--wdJM-.mjs";
|
|
2
3
|
//#region src/core/schemaIR.ts
|
|
3
4
|
/**
|
|
4
5
|
* Schema IR — one canonical representation, two adapters.
|
package/dist/schemas/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import { ErrorContract, ErrorDetail } from "@classytic/repo-core/errors";
|
|
2
3
|
import { Static, TObject, TSchema, TSchema as TSchema$1, Type, Type as Type$1 } from "typebox";
|
|
3
4
|
import { FastifyPluginAsyncTypebox, FastifyPluginCallbackTypebox, TypeBoxTypeProvider } from "@fastify/type-provider-typebox";
|
package/dist/schemas/index.mjs
CHANGED
package/dist/scim/index.d.mts
CHANGED
package/dist/scim/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as parseJsonBody } from "../jsonBody-BYbLDi5D.mjs";
|
|
2
3
|
import fp from "fastify-plugin";
|
|
3
4
|
//#region src/scim/errors.ts
|
|
4
5
|
var ScimError = class extends Error {
|
package/dist/scope/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { i as
|
|
1
|
+
|
|
2
|
+
import { A as requireOrgId, C as hasOrgAccess, D as isOrgInScope, E as isMember, M as requireUserId, N as scopeFirstCtx, O as isService, S as getUserRoles, T as isElevated, _ as getScopeContextMap, a as ScopeFirstCtx, b as getTenantFromRequest, c as getAncestorOrgIds, d as getMandate, f as getOrgContext, g as getScopeContext, h as getRequestScope, i as RequestScope, j as requireTeamId, k as requireClientId, l as getClientId, m as getOrgRoles, n as Mandate, o as ScopeFirstCtxOptions, p as getOrgId, r as PUBLIC_SCOPE, s as ScopeFirstCtxRequest, t as AUTHENTICATED_SCOPE, u as getDPoPJkt, v as getServiceScopes, w as isAuthenticated, x as getUserId, y as getTeamId } from "../types-ChuShpCP.mjs";
|
|
3
|
+
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
|
|
3
4
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
4
5
|
//#region src/scope/rateLimitKey.d.ts
|
|
5
6
|
interface RateLimitKeyContext {
|
package/dist/scope/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-Cys0ko9Z.mjs";
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-D2l1mh4g.mjs";
|
|
4
|
+
import { t as createTenantKeyGenerator } from "../rateLimitKey-Dn5JNmkj.mjs";
|
|
5
|
+
import { t as resolveOrgFromHeader } from "../scope-DHx5Fous.mjs";
|
|
5
6
|
export { AUTHENTICATED_SCOPE, PUBLIC_SCOPE, createTenantKeyGenerator, elevation_default as elevationPlugin, elevationPlugin as elevationPluginFn, getAncestorOrgIds, getClientId, getDPoPJkt, getMandate, getOrgContext, getOrgId, getOrgRoles, getRequestScope, getScopeContext, getScopeContextMap, getServiceScopes, getTeamId, getTenantFromRequest, getUserId, getUserRoles, hasOrgAccess, isAuthenticated, isElevated, isMember, isOrgInScope, isService, requireClientId, requireOrgId, requireTeamId, requireUserId, resolveOrgFromHeader, scopeFirstCtx };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-Cj42AntO.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-3zvE0rM3.mjs";
|
|
4
|
+
import { n as getUserRoles } from "./userHelpers-ChYJ6CdK.mjs";
|
|
4
5
|
//#region src/scope/resolveOrgFromHeader.ts
|
|
5
6
|
/**
|
|
6
7
|
* Create a preHandler hook that resolves org scope from a header.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CUsjNX9R.mjs";
|
|
2
3
|
import { arcLog } from "./logger/index.mjs";
|
|
3
|
-
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-
|
|
4
|
-
import { a as promoteStreamTokenToHeader } from "./streaming-
|
|
5
|
-
import { t as openSseStream } from "./sseStream-
|
|
4
|
+
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-Cys0ko9Z.mjs";
|
|
5
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-PSZwi8JV.mjs";
|
|
6
|
+
import { t as openSseStream } from "./sseStream-B_5XcVVd.mjs";
|
|
6
7
|
import fp from "fastify-plugin";
|
|
7
8
|
//#region src/plugins/sse.ts
|
|
8
9
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @classytic/arc v2.31.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as forwardedStreamHeaders } from "./streaming-PSZwi8JV.mjs";
|
|
2
3
|
//#region src/utils/sseStream.ts
|
|
3
4
|
/**
|
|
4
5
|
* Take over the reply socket and open an SSE stream. Call ONLY after every
|