@classytic/arc 2.41.0 → 2.43.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/dist/{EventTransport-CbUKDzZZ.d.mts → EventTransport-CiicKz2Z.d.mts} +1 -1
- package/dist/{EventTransport-n7qO5Cz3.mjs → EventTransport-tzA7CAB4.mjs} +22 -17
- package/dist/{HookSystem-CxvZBo77.mjs → HookSystem-B6UaKRbF.mjs} +2 -2
- package/dist/{QueryCache-DFA-QrU9.d.mts → QueryCache--5uAuYPW.d.mts} +7 -3
- package/dist/{ResourceRegistry-Cu7uTJp9.mjs → ResourceRegistry-CuCARu2B.mjs} +44 -13
- package/dist/actionPermissions-BotX1YOa.mjs +776 -0
- package/dist/audit/index.d.mts +43 -5
- package/dist/audit/index.mjs +48 -26
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +43 -13
- package/dist/auth/index.mjs +130 -155
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-2YY_Kaj1.mjs → authorizationDecision-DQYrkl5f.mjs} +7 -102
- package/dist/{base-CxrV1LmG.d.mts → base-CZyixEQR.d.mts} +27 -5
- package/dist/boundedMap-BULzfXYU.mjs +57 -0
- package/dist/{buildHandler-CUhjGHGZ.mjs → buildHandler-CRQ8EcX5.mjs} +4 -4
- package/dist/cache/index.d.mts +22 -34
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-DsWDjIxx.mjs → caching-Cc2M1DwO.mjs} +3 -3
- package/dist/claimed-B10RTfkM.mjs +8 -0
- package/dist/cleanup/index.d.mts +6 -10
- package/dist/cleanup/index.mjs +27 -73
- package/dist/cli/commands/describe.d.mts +4 -2
- package/dist/cli/commands/describe.mjs +7 -4
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-BxLgNFF7.mjs → constants-Cu7Mx7_U.mjs} +4 -2
- package/dist/context/index.d.mts +2 -5
- package/dist/context/index.mjs +18 -38
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-iNGqYerO.mjs → core-Cb0LjccA.mjs} +5 -4
- package/dist/{createActionRouter-BBlbPs3k.mjs → createActionRouter-xjqonMRO.mjs} +87 -39
- package/dist/{createAggregationRouter-Dv5SuK2x.mjs → createAggregationRouter-zRYWw_5D.mjs} +11 -8
- package/dist/{preloadResources-Bbp4QJ8V.mjs → createApp-D-953ZAq.mjs} +299 -390
- package/dist/{createMcpServer-CbDWkZ1T.d.mts → createMcpServer-C9cxS8zt.d.mts} +1 -1
- package/dist/{defineAggregation-UyeurGkp.mjs → defineAggregation-Bm8RjMbq.mjs} +1 -1
- package/dist/{defineResource-DzGT-2LP.mjs → defineResource-DIC7JZGU.mjs} +118 -1024
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +10 -4
- package/dist/docs/index.mjs +4 -4
- package/dist/{elevation-BXCfVcNG.d.mts → elevation-BW2J3tNj.d.mts} +1 -2
- package/dist/{elevation-BF-vhGxY.mjs → elevation-DG8SrLN-.mjs} +41 -12
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-CIMkCOWm.mjs → errorHandler-BnfDviL1.mjs} +26 -5
- package/dist/{errors-C_YhELhe.mjs → errors-CtrywMHP.mjs} +58 -23
- package/dist/{errors-BGdVwP25.d.mts → errors-JYc9vwqE.d.mts} +9 -0
- package/dist/{eventPlugin-B52abJ8W.d.mts → eventPlugin-BtmA4-3P.d.mts} +65 -9
- package/dist/{eventPlugin-CmXaPWLv.mjs → eventPlugin-Q6BhzHzs.mjs} +82 -21
- package/dist/{subscribe-helpers-AVYPgqTl.mjs → eventTypes-Cdhm6ZlV.mjs} +151 -17
- package/dist/events/index.d.mts +33 -8
- package/dist/events/index.mjs +49 -53
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +139 -157
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +32 -17
- package/dist/factory/index.mjs +213 -32
- package/dist/{fastify-augmentation-Cq2nHVaW.d.mts → fastify-augmentation-DhUJ-mvo.d.mts} +11 -25
- package/dist/{fields-I_EeRWND.d.mts → fields-BBSpf8pS.d.mts} +1 -1
- package/dist/{fields-BTyPLHK0.mjs → fields-ToPYpMqS.mjs} +1 -1
- package/dist/filter-merge-IpGywvym.mjs +99 -0
- package/dist/{generate-D_YmiCNf.mjs → generate-DRTkLlIl.mjs} +2 -2
- package/dist/{headers-CNECDE6q.mjs → headers-BbkIF6vA.mjs} +2 -2
- package/dist/health-D-Ft6JM6.mjs +22 -0
- package/dist/{health-CxQzbJmr.mjs → health-DqbsG-_w.mjs} +115 -55
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.d.mts +31 -7
- package/dist/idempotency/index.mjs +155 -98
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +48 -11
- package/dist/{index-BHdZD8zK.d.mts → index-Bxriq3so.d.mts} +84 -21
- package/dist/{preloadResources-CjS2OfpU.d.mts → index-C8zVGYsk.d.mts} +37 -38
- package/dist/{index-D4u76eQW.d.mts → index-CRoPtISf.d.mts} +23 -73
- package/dist/{index-CbJiYrfv.d.mts → index-Chgz3d0i.d.mts} +1 -1
- package/dist/index-JdbZAIsm.d.mts +510 -0
- package/dist/{index-DHbyPo5j.d.mts → index-mqaqZNpe.d.mts} +253 -254
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +11 -11
- package/dist/{init-Y2MlSN9n.mjs → init-B_oUYDXI.mjs} +1 -1
- package/dist/integrations/event-gateway.d.mts +8 -3
- package/dist/integrations/event-gateway.mjs +4 -4
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +18 -5
- package/dist/integrations/mcp/index.d.mts +72 -59
- package/dist/integrations/mcp/index.mjs +19 -4
- package/dist/integrations/mcp/testing.d.mts +2 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.d.mts +78 -136
- package/dist/integrations/streamline.mjs +116 -54
- package/dist/integrations/webhooks.d.mts +60 -120
- package/dist/integrations/webhooks.mjs +36 -80
- package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.d.mts +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.d.mts +3 -3
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{interface-DEWNOMza.d.mts → interface-C0395yUN.d.mts} +13 -1
- package/dist/{jsonBody-Cq9KYl2Z.mjs → jsonBody-B4YVGcql.mjs} +2 -2
- package/dist/{keys-Cmv4cBRa.mjs → keys-B2KtgMLJ.mjs} +7 -18
- package/dist/{loadResources-CblF7xt2.mjs → loadResources-Dn4lalw2.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-99fIMC3p.mjs → loadResourcesFromEntry-3sLYbuse.mjs} +2 -2
- package/dist/logger/index.d.mts +1 -8
- package/dist/logger/index.mjs +3 -153
- package/dist/logger-DXjfIqjV.mjs +160 -0
- package/dist/{mcpPlugin-xF3Gw-HW.mjs → mcpPlugin-C08HalN5.mjs} +433 -170
- package/dist/{memory-CpDZ9NPw.mjs → memory-9Cp7611C.mjs} +36 -34
- package/dist/{metrics-BaKnq8ag.mjs → metrics-CWI11eRu.mjs} +39 -72
- package/dist/middleware/index.d.mts +2 -2
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BkQEesNQ.mjs → module-BSvOQC7E.mjs} +8 -8
- package/dist/multiTenant-cY0FkDiA.d.mts +104 -0
- package/dist/{multipartBody-C92aJ8am.mjs → multipartBody-CXM2a-Dy.mjs} +46 -7
- package/dist/{openapi-C3LFRzPq.mjs → openapi-DT_G4VhY.mjs} +48 -10
- package/dist/outbox-admin/index.d.mts +3 -3
- package/dist/outbox-admin/index.mjs +6 -18
- package/dist/{outbox-module-dsCyLxXH.mjs → outbox-module-Bjgzl6tg.mjs} +203 -33
- package/dist/{outbox-module-BHdUnuuK.d.mts → outbox-module-gZCHoE4H.d.mts} +79 -6
- package/dist/permissions/index.d.mts +5 -4
- package/dist/permissions/index.mjs +8 -6
- package/dist/{permissions-DiHXy8Ck.mjs → permissions-Cm0uYHvd.mjs} +149 -33
- package/dist/{pipe-CBVmUJ-j.mjs → pipe-BqeGT6UO.mjs} +2 -2
- package/dist/pipeline/index.d.mts +2 -2
- package/dist/pipeline/index.mjs +2 -2
- package/dist/plan-FVR6LP59.mjs +565 -0
- package/dist/{BaseController-DYJRZ0EJ.mjs → plugin-BccET1tL.mjs} +1256 -344
- package/dist/plugins/index.d.mts +14 -11
- package/dist/plugins/index.mjs +44 -22
- package/dist/plugins/response-cache.mjs +8 -14
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-2_U6QZQg.mjs → pluralize-CVIOcgMF.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +2 -2
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +26 -31
- package/dist/presets/index.mjs +4 -4
- package/dist/presets/multiTenant.d.mts +2 -107
- package/dist/presets/multiTenant.mjs +22 -162
- package/dist/presets/search.d.mts +2 -2
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-BdlugYTc.mjs → presets-Cpvj6fGO.mjs} +99 -107
- package/dist/{projection-Uvgp-EEj.mjs → projection-Ce4aQhQk.mjs} +2 -2
- package/dist/{pushref-registry-Dov9l4qE.d.mts → pushref-registry-UxCkoA4C.d.mts} +1 -1
- package/dist/{queryCachePlugin-BzqxconG.d.mts → queryCachePlugin-C2lZjTxk.d.mts} +1 -1
- package/dist/{queryCachePlugin-B5F09bYr.mjs → queryCachePlugin-CFWNH8aT.mjs} +12 -14
- package/dist/{rateLimitKey-CK-EU2L8.mjs → rateLimitKey-C4O-kPm0.mjs} +1 -1
- package/dist/{realtime-FnnD0n3Z.mjs → realtime-DmPE9S54.mjs} +25 -21
- package/dist/redis-stream-BMk-bpQS.d.mts +219 -0
- package/dist/{redis-Bzi1y3F9.d.mts → redis-vLvtcGy_.d.mts} +13 -24
- package/dist/redisShapes-CQksY67q.d.mts +55 -0
- package/dist/registry/index.d.mts +9 -4
- package/dist/registry/index.mjs +4 -4
- package/dist/{registry-D3y8VEJ1.mjs → registry-Bcz9G1bh.mjs} +10 -8
- package/dist/{renewingLease-B3VYh5aU.mjs → renewingLease-qODa7KJQ.mjs} +1 -1
- package/dist/{replyHelpers-DPHsdw-5.mjs → replyHelpers-CG_VtVgS.mjs} +2 -2
- package/dist/{requestContext-cSVKnYPk.mjs → requestContext-Dsu9P1bV.mjs} +1 -1
- package/dist/requirement-CbiLdQ1n.d.mts +22 -0
- package/dist/requirement-KDdoRcOP.mjs +35 -0
- package/dist/resourceRateLimit-Wf6d6FL9.d.mts +30 -0
- package/dist/resourceRateLimit-dSjVr1pk.mjs +180 -0
- package/dist/{rolldown-runtime-DjDuyglE.mjs → rolldown-runtime-D1w9Y1VJ.mjs} +1 -1
- package/dist/routeValidator-D36SW8qt.mjs +70 -0
- package/dist/{runtimeCapabilities-DSA_dH1_.mjs → runtimeCapabilities-0tccjRlj.mjs} +1 -1
- package/dist/{schedules-BktJb3Y3.mjs → schedules-C-OpmHBq.mjs} +46 -37
- package/dist/{schemaConverter-BLCSmNbr.mjs → schemaConverter-BORek3O-.mjs} +2 -2
- package/dist/{schemaIR-K16Bb5BX.mjs → schemaIR-C7Vbp71I.mjs} +2 -2
- package/dist/schemas/index.d.mts +10 -0
- package/dist/schemas/index.mjs +8 -3
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +6 -6
- package/dist/{scope-jSxuBTFM.mjs → scope-DQthe88b.mjs} +4 -4
- package/dist/shutdown-MqA81z_P.mjs +59 -0
- package/dist/{simpleEqualityMatcher-BiOnyflP.mjs → simpleEqualityMatcher-auW8QjXN.mjs} +1 -1
- package/dist/{sse-CH7Slxc1.mjs → sse-CYzQBVFe.mjs} +11 -15
- package/dist/{sseStream-CN-Lh1Tu.mjs → sseStream-B5_Afiqn.mjs} +2 -2
- package/dist/{store-helpers-9DX9-1j_.mjs → store-helpers-BOzk-CuX.mjs} +1 -1
- package/dist/{streaming-dvppnxsr.mjs → streaming-DjTQhZrN.mjs} +1 -1
- package/dist/subscriberIdentity-CW39uA8G.mjs +28 -0
- package/dist/tenancy--ed9eH_z.mjs +43 -0
- package/dist/tenantPreparation-BKon6Yox.mjs +67 -0
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +193 -175
- package/dist/testing/index.mjs +286 -212
- package/dist/testing/outboxStoreContract.mjs +137 -2
- package/dist/testing/requiredPorts.d.mts +17 -0
- package/dist/testing/requiredPorts.mjs +65 -0
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/timing-qczZ0YC-.mjs +46 -0
- package/dist/{transactionContext-DCWMI6hV.mjs → transactionContext-DjFkrNG6.mjs} +1 -1
- package/dist/{typeGuards-D7tHFdH6.mjs → typeGuards-CySF12G-.mjs} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-CWQn9-IC.d.mts → types-B4Aq4Sdj.d.mts} +22 -9
- package/dist/{types-DfVDvkdP.d.mts → types-BJ-2XqVF.d.mts} +189 -204
- package/dist/{types-CDy3-zw1.mjs → types-Bk9NOgOC.mjs} +4 -4
- package/dist/usage/index.d.mts +2 -3
- package/dist/usage/index.mjs +5 -5
- package/dist/{userHelpers-DDMOZ_Pm.mjs → userHelpers-aklawRaK.mjs} +1 -1
- package/dist/utils/index.d.mts +84 -223
- package/dist/utils/index.mjs +13 -12
- package/dist/{utils-B-zj_b__.mjs → utils-ec1oTo1n.mjs} +315 -404
- package/dist/{validate-R0G_JrnK.mjs → validate-9yzHC1e2.mjs} +6 -14
- package/dist/{versioning-D6JIK8Tk.d.mts → versioning-Bsb51gGT.d.mts} +28 -13
- package/dist/{versioning-DuVWcu-F.mjs → versioning-fhhWHV74.mjs} +4 -4
- package/dist/{websocket-BOXVggMf.d.mts → websocket-Cs4awVyD.d.mts} +1 -1
- package/dist/{workScope-BhsWde4k.mjs → workScope-zpPyge4t.mjs} +2 -2
- package/package.json +578 -574
- package/skills/arc/SKILL.md +13 -4
- package/skills/arc/references/auth.md +8 -5
- package/skills/arc/references/integrations.md +1 -1
- package/skills/arc/references/mcp.md +8 -6
- package/skills/arc/references/multi-tenancy.md +19 -14
- package/skills/arc/references/production.md +27 -10
- package/dist/actionPermissions-DPwPWPOV.mjs +0 -350
- package/dist/index-CFfLKMH4.d.mts +0 -290
- package/dist/interface-BIpgzbZl.mjs +0 -17
- package/dist/redis-stream-BPKscsTB.d.mts +0 -260
- package/dist/registerRoute-DRsSHPSM.mjs +0 -364
- package/dist/sync/changelog.d.mts +0 -3
- package/dist/sync/changelog.mjs +0 -3
package/dist/cache/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { n as CacheStats, r as CacheStore, t as CacheLogger } from "../interface-BOk3YnTz.mjs";
|
|
3
|
-
import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache
|
|
4
|
-
import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-
|
|
3
|
+
import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache--5uAuYPW.mjs";
|
|
4
|
+
import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-C2lZjTxk.mjs";
|
|
5
|
+
import { n as UpstashKeyValueCommands, t as IoredisKeyValueCommands } from "../redisShapes-CQksY67q.mjs";
|
|
5
6
|
//#region src/cache/keys.d.ts
|
|
6
7
|
/**
|
|
7
8
|
* Cache Key Utilities
|
|
@@ -17,9 +18,10 @@ declare function versionKey(resource: string): string;
|
|
|
17
18
|
/** Tag version key — stored in CacheStore, bumped on cross-resource invalidation */
|
|
18
19
|
declare function tagVersionKey(tag: string): string;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Digest of the query params for a cache key — repo-core's canonical serialiser (escaped,
|
|
22
|
+
* type-preserving, key-order-free) under SHA-256. Two different queries never share a key: a
|
|
23
|
+
* delimiter inside a value, `1` vs `"1"`, two dates or two regexes all stay distinct, and a
|
|
24
|
+
* cryptographic digest leaves no crafted collision onto another caller's cached result.
|
|
23
25
|
*/
|
|
24
26
|
declare function hashParams(params: Record<string, unknown>): string;
|
|
25
27
|
//#endregion
|
|
@@ -37,9 +39,11 @@ interface MemoryCacheStoreOptions {
|
|
|
37
39
|
*/
|
|
38
40
|
maxEntryBytes?: number;
|
|
39
41
|
/**
|
|
40
|
-
* Total
|
|
41
|
-
*
|
|
42
|
-
*
|
|
42
|
+
* Total budget in bytes (default: 50 MiB), counted as serialized value
|
|
43
|
+
* bytes plus key bytes — an estimate of payload, NOT a heap limit (Map
|
|
44
|
+
* and object overhead are not counted). When exceeded, LRU entries are
|
|
45
|
+
* evicted until usage drops to the watermark. Set to 0 to disable (rely
|
|
46
|
+
* on maxEntries only).
|
|
43
47
|
*/
|
|
44
48
|
maxMemoryBytes?: number;
|
|
45
49
|
/**
|
|
@@ -91,8 +95,8 @@ declare class MemoryCacheStore<TValue = unknown> implements CacheStore<TValue> {
|
|
|
91
95
|
close(): Promise<void>;
|
|
92
96
|
stats(): CacheStats;
|
|
93
97
|
private removeEntry;
|
|
94
|
-
|
|
95
|
-
private
|
|
98
|
+
/** Every write path ends here, so no path can skip a limit. */
|
|
99
|
+
private enforceLimits;
|
|
96
100
|
private cleanupExpired;
|
|
97
101
|
private estimateSize;
|
|
98
102
|
}
|
|
@@ -179,22 +183,16 @@ declare class RedisCacheStore<TValue = unknown> implements CacheStore<TValue> {
|
|
|
179
183
|
private withPrefix;
|
|
180
184
|
}
|
|
181
185
|
/**
|
|
182
|
-
* Minimal ioredis shape
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* assignable — see the same note on the idempotency `IoredisLike`.
|
|
186
|
+
* Minimal ioredis shape the cache depends on — the shared key/value commands
|
|
187
|
+
* (`utils/redisShapes.ts`, where the `unknown[]`-tail rule is explained) plus
|
|
188
|
+
* the cache's own extras. Not importing ioredis keeps the subpath peer-dep-free.
|
|
186
189
|
*/
|
|
187
|
-
interface IoredisLike {
|
|
188
|
-
get(key: string): Promise<string | null>;
|
|
189
|
-
set(...args: unknown[]): Promise<string | null>;
|
|
190
|
-
del(...keys: string[]): Promise<number>;
|
|
191
|
-
scan(cursor: string | number, ...args: unknown[]): Promise<[string, string[]]>;
|
|
190
|
+
interface IoredisLike extends IoredisKeyValueCommands {
|
|
192
191
|
pipeline?(): {
|
|
193
192
|
del(key: string): unknown;
|
|
194
193
|
exec(): Promise<unknown>;
|
|
195
194
|
};
|
|
196
195
|
incrby?(key: string, by: number): Promise<number>;
|
|
197
|
-
eval?(script: string, numKeys: number, ...args: (string | number)[]): Promise<unknown>;
|
|
198
196
|
}
|
|
199
197
|
/**
|
|
200
198
|
* Wrap an ioredis instance as a `RedisCacheClient`.
|
|
@@ -218,22 +216,12 @@ interface IoredisLike {
|
|
|
218
216
|
*/
|
|
219
217
|
declare function ioredisAsCacheClient(client: IoredisLike): RedisCacheClient;
|
|
220
218
|
/**
|
|
221
|
-
* Minimal `@upstash/redis` REST SDK shape
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* Workers, Vercel Edge, Deno Deploy) where TCP connections — and thus
|
|
225
|
-
* ioredis — are unavailable.
|
|
219
|
+
* Minimal `@upstash/redis` REST SDK shape the cache depends on — the shared
|
|
220
|
+
* key/value commands (`utils/redisShapes.ts`) plus `incrby`. HTTP-based, so it
|
|
221
|
+
* works on edge runtimes where ioredis cannot.
|
|
226
222
|
*/
|
|
227
|
-
interface UpstashRedisLike {
|
|
228
|
-
get(key: string): Promise<string | null | unknown>;
|
|
229
|
-
set(key: string, value: unknown, opts?: Record<string, unknown>): Promise<unknown>;
|
|
230
|
-
del(...keys: string[]): Promise<number>;
|
|
231
|
-
scan(cursor: number | string, opts?: {
|
|
232
|
-
match?: string;
|
|
233
|
-
count?: number;
|
|
234
|
-
}): Promise<[number, string[]] | [string, string[]]>;
|
|
223
|
+
interface UpstashRedisLike extends UpstashKeyValueCommands {
|
|
235
224
|
incrby?(key: string, by: number): Promise<number>;
|
|
236
|
-
eval?(script: string, keys: string[], args: (string | number)[]): Promise<unknown>;
|
|
237
225
|
}
|
|
238
226
|
/**
|
|
239
227
|
* Wrap an `@upstash/redis` REST client as a `RedisCacheClient`.
|
package/dist/cache/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-
|
|
3
|
-
import { t as MemoryCacheStore } from "../memory-
|
|
4
|
-
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-B2KtgMLJ.mjs";
|
|
3
|
+
import { t as MemoryCacheStore } from "../memory-9Cp7611C.mjs";
|
|
4
|
+
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-CFWNH8aT.mjs";
|
|
5
5
|
//#region src/cache/redis.ts
|
|
6
6
|
/**
|
|
7
7
|
* Redis-backed cache store.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-D1w9Y1VJ.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/plugins/caching.ts
|
|
5
5
|
var caching_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -74,4 +74,4 @@ var caching_default = fp(cachingPlugin, {
|
|
|
74
74
|
fastify: "5.x"
|
|
75
75
|
});
|
|
76
76
|
//#endregion
|
|
77
|
-
export {
|
|
77
|
+
export { caching_exports as n, caching_default as t };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
//#region src/events/outbox/claimed.ts
|
|
3
|
+
function claimedAttempts(claimed) {
|
|
4
|
+
const value = claimed.attempts;
|
|
5
|
+
return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : void 0;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { claimedAttempts as t };
|
package/dist/cleanup/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { A as RequestWithExtras } from "../index-mqaqZNpe.mjs";
|
|
3
3
|
import { A as CleanupStepResult, B as VerificationResult, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeEvidence, I as PurgeResourceResult, L as PurgeStrategyKind, M as CleanupWriteFence, N as DEFAULT_CLEANUP_LIMITS, O as CleanupRunTransitionPatch, P as PurgeActor, R as PurgeVerificationSummary, S as CleanupRecipe, T as CleanupRunCreateResult, _ as CleanupPermissions, a as CleanupEvidenceStore, b as CleanupPlanItem, c as CleanupInput, d as CleanupLease, f as CleanupLimits, g as CleanupPermissionCheck, h as CleanupOutcomeStatus, i as CleanupContext, j as CleanupStepRunStatus, k as CleanupStepProgress, l as CleanupJob, m as CleanupManifest, n as CLEANUP_TERMINAL_STATUSES, o as CleanupExecutionContext, p as CleanupLogger, r as CleanupCancelRequest, s as CleanupFinalizationPayload, t as Availability, u as CleanupJobQueue, v as CleanupPlan, w as CleanupRun, x as CleanupProgressSummary, y as CleanupPlanDraft, z as VerificationCheck } from "../types-DVLddu2q.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { n as ArcModule } from "../types-BJ-2XqVF.mjs";
|
|
5
5
|
import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
|
|
6
|
-
import { canonicalJson } from "@classytic/primitives/canonical";
|
|
7
6
|
import { CleanupStep } from "@classytic/repo-core/cleanup";
|
|
8
7
|
//#region src/cleanup/compose.d.ts
|
|
9
8
|
/** Metadata + steps for {@link recipeFromSteps}. */
|
|
@@ -203,12 +202,11 @@ interface CleanupServiceDeps {
|
|
|
203
202
|
registry: CleanupRegistry;
|
|
204
203
|
runStore: CleanupRunStore;
|
|
205
204
|
evidenceStore: CleanupEvidenceStore;
|
|
206
|
-
/** Optional write fence
|
|
205
|
+
/** Optional write fence. No-op when absent. */
|
|
207
206
|
writeFence?: CleanupWriteFence | undefined;
|
|
208
207
|
/**
|
|
209
|
-
* Durable job queue
|
|
210
|
-
*
|
|
211
|
-
* BullMQ / SQS / repo-backed for cross-process durability + restart recovery.
|
|
208
|
+
* Durable job queue. Default: an in-process microtask queue (single-process,
|
|
209
|
+
* no restart recovery) — inject BullMQ / SQS / repo-backed for durability.
|
|
212
210
|
*/
|
|
213
211
|
jobQueue?: CleanupJobQueue | undefined;
|
|
214
212
|
/** Framework size caps. Defaults to {@link DEFAULT_CLEANUP_LIMITS}. */
|
|
@@ -261,8 +259,6 @@ interface CleanupService {
|
|
|
261
259
|
cancel(id: string, input?: CancelInput): Promise<CleanupRun>;
|
|
262
260
|
retry(id: string): Promise<CleanupRun>;
|
|
263
261
|
}
|
|
264
|
-
/** Admission key serializing every destructive run behind one slot. */
|
|
265
|
-
declare const GLOBAL_DESTRUCTIVE_KEY = "global-destructive";
|
|
266
262
|
declare function createCleanupService(deps: CleanupServiceDeps): CleanupService;
|
|
267
263
|
//#endregion
|
|
268
264
|
//#region src/cleanup/module.d.ts
|
|
@@ -345,4 +341,4 @@ declare function computePlanDigest(plan: Omit<CleanupPlan, "digest">): string;
|
|
|
345
341
|
*/
|
|
346
342
|
declare function computeManifestDigest(manifest: Record<string, unknown>): string;
|
|
347
343
|
//#endregion
|
|
348
|
-
export { type Availability, CLEANUP_TERMINAL_STATUSES, type CancelInput, type CleanupCancelRequest, CleanupCancelled, type CleanupContext, CleanupError, type CleanupErrorCode, CleanupErrors, type CleanupEvidenceStore, type CleanupExecutionContext, type CleanupFinalizationPayload, type CleanupInput, type CleanupJob, type CleanupJobQueue, type CleanupLease, type CleanupLimits, type CleanupLogger, type CleanupManifest, type CleanupOutcomeStatus, type CleanupPermissionCheck, type CleanupPermissions, type CleanupPlan, type CleanupPlanDraft, type CleanupPlanItem, type CleanupProgressSummary, type CleanupRecipe, type CleanupRecipeInfo, type CleanupRegistry, type CleanupResult, type CleanupRun, type CleanupRunCreateResult, type CleanupRunStatus, type CleanupRunStore, type CleanupRunTransitionPatch, type CleanupService, type CleanupServiceDeps, type CleanupStepProgress, type CleanupStepResult, type CleanupStepRunStatus, type CleanupWriteFence, DEFAULT_CLEANUP_LIMITS, type DataCleanupModuleDeps, type ExecuteInput,
|
|
344
|
+
export { type Availability, CLEANUP_TERMINAL_STATUSES, type CancelInput, type CleanupCancelRequest, CleanupCancelled, type CleanupContext, CleanupError, type CleanupErrorCode, CleanupErrors, type CleanupEvidenceStore, type CleanupExecutionContext, type CleanupFinalizationPayload, type CleanupInput, type CleanupJob, type CleanupJobQueue, type CleanupLease, type CleanupLimits, type CleanupLogger, type CleanupManifest, type CleanupOutcomeStatus, type CleanupPermissionCheck, type CleanupPermissions, type CleanupPlan, type CleanupPlanDraft, type CleanupPlanItem, type CleanupProgressSummary, type CleanupRecipe, type CleanupRecipeInfo, type CleanupRegistry, type CleanupResult, type CleanupRun, type CleanupRunCreateResult, type CleanupRunStatus, type CleanupRunStore, type CleanupRunTransitionPatch, type CleanupService, type CleanupServiceDeps, type CleanupStepProgress, type CleanupStepResult, type CleanupStepRunStatus, type CleanupWriteFence, DEFAULT_CLEANUP_LIMITS, type DataCleanupModuleDeps, type ExecuteInput, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, type PreviewInput, type PurgeActor, type PurgeEvidence, type PurgeResourceResult, type PurgeStrategyKind, type PurgeVerificationSummary, type RecipeFromStepsInput, type VerificationCheck, type VerificationResult, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
|
package/dist/cleanup/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { g as getUserId } from "../types-
|
|
3
|
-
import { t as defineResource } from "../defineResource-
|
|
4
|
-
import { t as defineModule } from "../module-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { g as getUserId } from "../types-Bk9NOgOC.mjs";
|
|
3
|
+
import { t as defineResource } from "../defineResource-DIC7JZGU.mjs";
|
|
4
|
+
import { t as defineModule } from "../module-BSvOQC7E.mjs";
|
|
5
5
|
import { createPurgeEvidence } from "@classytic/primitives/retention";
|
|
6
6
|
import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
|
|
7
7
|
//#region src/cleanup/errors.ts
|
|
@@ -612,8 +612,8 @@ function createCleanupRegistry(recipes) {
|
|
|
612
612
|
* implementation (`Date`-explicit, strict-reject of `undefined`/`NaN`/`BigInt`/
|
|
613
613
|
* `function`/`symbol`/`Map`/`Set`/cyclic). Two domains consume it — cleanup
|
|
614
614
|
* manifests here + financial-close evidence manifests in arc-accounting — so it
|
|
615
|
-
* lives in primitives, not duplicated per package
|
|
616
|
-
*
|
|
615
|
+
* lives in primitives, not duplicated per package — import `canonicalJson` from
|
|
616
|
+
* there; peer floor `@classytic/primitives >= 0.17.0`.
|
|
617
617
|
*/
|
|
618
618
|
/**
|
|
619
619
|
* The material content of a plan — everything an operator is consenting to.
|
|
@@ -656,33 +656,22 @@ function computeManifestDigest(manifest) {
|
|
|
656
656
|
/**
|
|
657
657
|
* Cleanup orchestration service — the framework's use-case core.
|
|
658
658
|
*
|
|
659
|
-
*
|
|
660
|
-
* ports promise actually hold:
|
|
659
|
+
* REQUEST path vs WORKER path:
|
|
661
660
|
*
|
|
662
|
-
* preview()
|
|
663
|
-
* execute()
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
* the finalization payload, and finalizes idempotently.
|
|
674
|
-
* cancel() → durable cancel request (+ actor/reason audit) + CAS a
|
|
675
|
-
* not-yet-running run straight to `cancelled` WITH evidence.
|
|
676
|
-
* A running run stops cooperatively and leaves evidence of
|
|
677
|
-
* the committed chunks.
|
|
678
|
-
* retry() → reload the SAME sealed operation, re-check availability +
|
|
679
|
-
* recipe version + digest against a fresh plan (refuse if the
|
|
680
|
-
* world changed), re-arm ATOMICALLY under the same admission
|
|
681
|
-
* guard as creation, re-enqueue.
|
|
661
|
+
* preview() → re-plan and seal a digest.
|
|
662
|
+
* execute() → validate, ATOMICALLY create the run (admission guard by
|
|
663
|
+
* concurrencyKey), ENQUEUE `{ runId }`, return. Never runs the recipe.
|
|
664
|
+
* processRun() → worker entrypoint. Takes an EXCLUSIVE lease; a `finalizing`
|
|
665
|
+
* run only replays finalization from the persisted payload
|
|
666
|
+
* (never re-executes); a `queued` or lease-expired `running`
|
|
667
|
+
* run executes, verifies, persists the payload, finalizes.
|
|
668
|
+
* cancel() → durable, audited request; a not-yet-running run goes straight
|
|
669
|
+
* to `cancelled` WITH evidence, a running one stops cooperatively.
|
|
670
|
+
* retry() → re-validate the SAME sealed operation against a fresh plan
|
|
671
|
+
* (refuse if it changed), re-arm atomically under the same guard.
|
|
682
672
|
*
|
|
683
|
-
* Every status change
|
|
684
|
-
*
|
|
685
|
-
* never clobber the new owner's `cancelled`/`running` state.
|
|
673
|
+
* Every status change is a CAS carrying the lease token, so a stalled ex-owner's
|
|
674
|
+
* late write can never clobber the new owner's state.
|
|
686
675
|
*/
|
|
687
676
|
const EMPTY_PROGRESS = {
|
|
688
677
|
processed: 0,
|
|
@@ -724,20 +713,9 @@ function createCleanupService(deps) {
|
|
|
724
713
|
const generateId = deps.generateId ?? (() => globalThis.crypto.randomUUID());
|
|
725
714
|
const now = deps.now ?? (() => /* @__PURE__ */ new Date());
|
|
726
715
|
/**
|
|
727
|
-
* Undefined-valued keys are DROPPED, not spread
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
* — and a plain spread lets that overwrite the default rather than fall back
|
|
731
|
-
* to it. Every limit is then read in a comparison, and `n > undefined` is
|
|
732
|
-
* always `false`, so `{ limits: { maxPlanItems: undefined } }` did not raise
|
|
733
|
-
* the cap: it silently REMOVED it, on a framework whose whole job is deleting
|
|
734
|
-
* data. Same for `maxReasonLength` / `maxParamDepth`, and `maxResults` turned
|
|
735
|
-
* `slice(0, undefined)` into "keep everything".
|
|
736
|
-
*
|
|
737
|
-
* A host reaches this by forwarding an optional config through
|
|
738
|
-
* (`limits: { maxPlanItems: cfg.planCap }`) — no cast, no obvious mistake.
|
|
739
|
-
* `permissions/presets.ts` already filters for exactly this reason; this is
|
|
740
|
-
* the same rule applied to the destructive path.
|
|
716
|
+
* Undefined-valued keys are DROPPED, not spread: an explicit `undefined`
|
|
717
|
+
* would overwrite the default, and `n > undefined` is always false — so the
|
|
718
|
+
* cap would silently disappear on the path that deletes data.
|
|
741
719
|
*/
|
|
742
720
|
const limits = {
|
|
743
721
|
...DEFAULT_CLEANUP_LIMITS,
|
|
@@ -772,14 +750,6 @@ function createCleanupService(deps) {
|
|
|
772
750
|
}, ctx);
|
|
773
751
|
const items = draft.items;
|
|
774
752
|
if (items.length > limits.maxPlanItems) throw CleanupErrors.planTooLarge(`${items.length} items > maxPlanItems ${limits.maxPlanItems}`);
|
|
775
|
-
/**
|
|
776
|
-
* Partition by DISPOSITION — a protective guard's count is not damage.
|
|
777
|
-
*
|
|
778
|
-
* This was one `reduce` over every item, so a guard reporting the 173 posted
|
|
779
|
-
* journal entries it defends pushed the "records to remove" headline to 540
|
|
780
|
-
* on a plan that removes 367. Absent disposition means `'remove'`, so every
|
|
781
|
-
* pre-existing recipe is unchanged.
|
|
782
|
-
*/
|
|
783
753
|
const estimatedTotal = items.reduce((sum, i) => sum + ((i.disposition ?? "remove") === "remove" ? i.estimated : 0), 0);
|
|
784
754
|
const protectedTotal = items.reduce((sum, i) => sum + (i.disposition === "protect" ? i.estimated : 0), 0);
|
|
785
755
|
const blockers = new Set(draft.blockers ?? []);
|
|
@@ -907,13 +877,6 @@ function createCleanupService(deps) {
|
|
|
907
877
|
let processed = 0;
|
|
908
878
|
let steps = 0;
|
|
909
879
|
let failed = 0;
|
|
910
|
-
/**
|
|
911
|
-
* Per-step lifecycle, keyed by `stepId` and ordered by first sight.
|
|
912
|
-
*
|
|
913
|
-
* Seeded from the run's existing progress so a RESUMED run (crash recovery,
|
|
914
|
-
* retry) keeps the states it already recorded instead of presenting an
|
|
915
|
-
* operator with a blank pipeline for work that demonstrably happened.
|
|
916
|
-
*/
|
|
917
880
|
const stepStates = new Map((run.progress?.stepProgress ?? []).map((s) => [s.stepId, s]));
|
|
918
881
|
let cancelled = false;
|
|
919
882
|
let lastSummary = run.progress ?? EMPTY_PROGRESS;
|
|
@@ -960,18 +923,9 @@ function createCleanupService(deps) {
|
|
|
960
923
|
}
|
|
961
924
|
},
|
|
962
925
|
/**
|
|
963
|
-
* Upsert
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
* step transitioning running → completed updates its entry rather than
|
|
967
|
-
* appending, so the array length is the step count and never the
|
|
968
|
-
* transition count. Insertion order is the execution order, which is what
|
|
969
|
-
* an operator reads down the list.
|
|
970
|
-
*
|
|
971
|
-
* Persisted on the NEXT `onStep` (or the terminal write) rather than
|
|
972
|
-
* immediately — a lifecycle transition is not itself a committed chunk,
|
|
973
|
-
* and writing on every one would defeat the progress throttle that exists
|
|
974
|
-
* to keep a long run from hammering the store.
|
|
926
|
+
* Upsert a step's state (bounded: one entry per step, first-seen order).
|
|
927
|
+
* Persisted with the NEXT `onStep` or terminal write, so transitions
|
|
928
|
+
* don't bypass the progress throttle.
|
|
975
929
|
*/
|
|
976
930
|
async onStepState(state) {
|
|
977
931
|
stepStates.set(state.stepId, state);
|
|
@@ -1525,4 +1479,4 @@ function createDataCleanupModule(deps) {
|
|
|
1525
1479
|
});
|
|
1526
1480
|
}
|
|
1527
1481
|
//#endregion
|
|
1528
|
-
export { CLEANUP_TERMINAL_STATUSES, CleanupCancelled, CleanupError, CleanupErrors, DEFAULT_CLEANUP_LIMITS,
|
|
1482
|
+
export { CLEANUP_TERMINAL_STATUSES, CleanupCancelled, CleanupError, CleanupErrors, DEFAULT_CLEANUP_LIMITS, MemoryCleanupEvidenceStore, MemoryCleanupJobQueue, MemoryCleanupRunStore, computeManifestDigest, computePlanDigest, createCleanupRegistry, createCleanupService, createDataCleanupModule, recipeFromSteps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { F as ResourceDefinition, X as RouteSchemaOptions, kt as RateLimitConfig } from "../../index-mqaqZNpe.mjs";
|
|
3
3
|
//#region src/cli/commands/describe.d.ts
|
|
4
4
|
interface DescribedResource {
|
|
5
5
|
name: string;
|
|
@@ -86,6 +86,8 @@ interface AggregationDescription {
|
|
|
86
86
|
interface PermissionDescription {
|
|
87
87
|
type: "public" | "requireAuth" | "requireRoles" | "custom";
|
|
88
88
|
roles?: readonly string[];
|
|
89
|
+
/** `allowPublic({ policy })`: public, but a row policy narrows what anyone sees. */
|
|
90
|
+
rowFiltered?: true;
|
|
89
91
|
}
|
|
90
92
|
interface FieldDescription {
|
|
91
93
|
type: string;
|
|
@@ -125,4 +127,4 @@ interface EventDescription {
|
|
|
125
127
|
declare function describeResource(resource: ResourceDefinition<unknown>, module?: string): DescribedResource;
|
|
126
128
|
declare function describe(args: string[]): Promise<void>;
|
|
127
129
|
//#endregion
|
|
128
|
-
export { describe, describeResource };
|
|
130
|
+
export { DescribedResource, describe, describeResource };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../../constants-
|
|
3
|
-
import { n as stringifyMeasureMap } from "../../ResourceRegistry-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../../constants-Cu7Mx7_U.mjs";
|
|
3
|
+
import { n as stringifyMeasureMap } from "../../ResourceRegistry-CuCARu2B.mjs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
//#region src/cli/commands/describe.ts
|
|
@@ -21,7 +21,10 @@ import { pathToFileURL } from "node:url";
|
|
|
21
21
|
function describePermission(check) {
|
|
22
22
|
if (!check || typeof check !== "function") return { type: "custom" };
|
|
23
23
|
const fn = check;
|
|
24
|
-
if (fn._isPublic === true) return
|
|
24
|
+
if (fn._isPublic === true) return fn._rowPolicy ? {
|
|
25
|
+
type: "public",
|
|
26
|
+
rowFiltered: true
|
|
27
|
+
} : { type: "public" };
|
|
25
28
|
if (Array.isArray(fn._roles)) return {
|
|
26
29
|
type: "requireRoles",
|
|
27
30
|
roles: fn._roles
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as buildOpenApiSpec } from "../../openapi-
|
|
3
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as buildOpenApiSpec } from "../../openapi-DT_G4VhY.mjs";
|
|
3
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-3sLYbuse.mjs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
//#region src/cli/commands/docs.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
2
|
import { dirname, join, parse, resolve } from "node:path";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/cli/commands/doctor.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as generate } from "../../generate-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as generate } from "../../generate-DRTkLlIl.mjs";
|
|
3
3
|
export { generate };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as init } from "../../init-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as init } from "../../init-B_oUYDXI.mjs";
|
|
3
3
|
export { init };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-3sLYbuse.mjs";
|
|
3
3
|
//#region src/cli/commands/introspect.ts
|
|
4
4
|
function describePermission(value) {
|
|
5
5
|
if (!value) return "none";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
2
|
import { describe } from "./commands/describe.mjs";
|
|
3
3
|
import { exportDocs } from "./commands/docs.mjs";
|
|
4
4
|
import { doctor } from "./commands/doctor.mjs";
|
|
5
|
-
import { t as generate } from "../generate-
|
|
6
|
-
import { t as init } from "../init-
|
|
5
|
+
import { t as generate } from "../generate-DRTkLlIl.mjs";
|
|
6
|
+
import { t as init } from "../init-B_oUYDXI.mjs";
|
|
7
7
|
import { introspect } from "./commands/introspect.mjs";
|
|
8
8
|
export { describe, doctor, exportDocs, generate, init, introspect };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
2
|
//#region src/constants.ts
|
|
3
3
|
/**
|
|
4
4
|
* Arc Framework Constants — Single Source of Truth
|
|
@@ -50,6 +50,8 @@ const DEFAULT_ID_FIELD = "_id";
|
|
|
50
50
|
const DEFAULT_TENANT_FIELD = "organizationId";
|
|
51
51
|
/** Default HTTP method for update routes */
|
|
52
52
|
const DEFAULT_UPDATE_METHOD = "PATCH";
|
|
53
|
+
/** Default version field under `concurrency: {}` (optimistic concurrency) */
|
|
54
|
+
const DEFAULT_VERSION_FIELD = "__v";
|
|
53
55
|
/** System-managed fields that cannot be set via request body */
|
|
54
56
|
const SYSTEM_FIELDS = Object.freeze([
|
|
55
57
|
"_id",
|
|
@@ -88,4 +90,4 @@ const RESERVED_QUERY_PARAMS = Object.freeze(/* @__PURE__ */ new Set([
|
|
|
88
90
|
"_policyFilters"
|
|
89
91
|
]));
|
|
90
92
|
//#endregion
|
|
91
|
-
export { DEFAULT_SORT as a,
|
|
93
|
+
export { DEFAULT_SORT as a, DEFAULT_VERSION_FIELD as c, MAX_FILTER_DEPTH as d, MAX_REGEX_LENGTH as f, SYSTEM_FIELDS as g, RESERVED_QUERY_PARAMS as h, DEFAULT_MAX_LIMIT as i, HOOK_OPERATIONS as l, MUTATION_OPERATIONS as m, DEFAULT_ID_FIELD as n, DEFAULT_TENANT_FIELD as o, MAX_SEARCH_LENGTH as p, DEFAULT_LIMIT as r, DEFAULT_UPDATE_METHOD as s, CRUD_OPERATIONS as t, HOOK_PHASES as u };
|
package/dist/context/index.d.mts
CHANGED
|
@@ -94,11 +94,8 @@ declare function getTraceHeaders(): Record<string, string> | undefined;
|
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/context/requestScopedCache.d.ts
|
|
96
96
|
/**
|
|
97
|
-
* The cache for the CURRENT unit of work
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* Lazily created on first use, so a scope that never touches a cached
|
|
101
|
-
* repository allocates nothing.
|
|
97
|
+
* The cache for the CURRENT unit of work (see `runWorkScope`), or `undefined`
|
|
98
|
+
* outside one. Lazily created on first use.
|
|
102
99
|
*/
|
|
103
100
|
declare function requestScopedCache(): CacheAdapter | undefined;
|
|
104
101
|
/**
|
package/dist/context/index.mjs
CHANGED
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as transactionContext } from "../transactionContext-
|
|
3
|
-
import { n as requestContext, t as getTraceHeaders } from "../requestContext-
|
|
4
|
-
import { n as
|
|
1
|
+
/*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as transactionContext } from "../transactionContext-DjFkrNG6.mjs";
|
|
3
|
+
import { n as requestContext, t as getTraceHeaders } from "../requestContext-Dsu9P1bV.mjs";
|
|
4
|
+
import { n as evictToSize, r as touch } from "../boundedMap-BULzfXYU.mjs";
|
|
5
|
+
import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-zpPyge4t.mjs";
|
|
5
6
|
//#region src/context/requestScopedCache.ts
|
|
6
7
|
/** The memo slot the per-scope store hangs off. */
|
|
7
8
|
const SLOT = Symbol.for("arc.requestScopedCache");
|
|
8
|
-
/**
|
|
9
|
-
* Entry cap for one scope's cache. A request touching this many distinct keys
|
|
10
|
-
* is already pathological; a JOB RUN reaching it is ordinary, and that is the
|
|
11
|
-
* case this exists for (see the eviction note below).
|
|
12
|
-
*/
|
|
9
|
+
/** Entry cap for one scope's cache — sized for long job runs, not requests. */
|
|
13
10
|
const MAX_ENTRIES = 1e4;
|
|
14
11
|
/**
|
|
15
12
|
* A `Map`-backed `CacheAdapter` with NO TTL and LRU eviction above
|
|
16
13
|
* {@link MAX_ENTRIES}.
|
|
17
14
|
*
|
|
18
|
-
* TTL is
|
|
19
|
-
*
|
|
20
|
-
* on one question.
|
|
15
|
+
* TTL is ignored: repo-core stamps freshness INTO the envelope and re-checks
|
|
16
|
+
* on read, so honouring it here would put two clocks on one question.
|
|
21
17
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* milliseconds and bounded by what one request touched, and an LRU would have
|
|
26
|
-
* guarded a lifetime that could not occur. 2.40 extended scopes to job runs
|
|
27
|
-
* and event dispatches — and `schedulesPlugin` wraps the WHOLE handler in one
|
|
28
|
-
* scope, so a nightly job sweeping a million rows holds a single cache for the
|
|
29
|
-
* duration. That is now a lifetime that occurs, and the old premise no longer
|
|
30
|
-
* holds. Evicting is always safe here: this is a cache, so the worst a miss
|
|
31
|
-
* costs is the re-read it was avoiding.
|
|
18
|
+
* The cap matters because `schedulesPlugin` wraps a WHOLE job handler in one
|
|
19
|
+
* scope, so a long sweep holds a single cache throughout. Evicting is always
|
|
20
|
+
* safe — a miss costs only the re-read it was avoiding.
|
|
32
21
|
*/
|
|
33
22
|
function createRequestCacheAdapter() {
|
|
34
23
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -36,25 +25,19 @@ function createRequestCacheAdapter() {
|
|
|
36
25
|
async get(key) {
|
|
37
26
|
if (!map.has(key)) return void 0;
|
|
38
27
|
const value = map.get(key);
|
|
39
|
-
map
|
|
40
|
-
map.set(key, value);
|
|
28
|
+
touch(map, key, value);
|
|
41
29
|
return value;
|
|
42
30
|
},
|
|
43
31
|
async set(key, value, _ttlSeconds) {
|
|
44
|
-
map
|
|
45
|
-
map
|
|
46
|
-
if (map.size > MAX_ENTRIES) {
|
|
47
|
-
const oldest = map.keys().next();
|
|
48
|
-
if (!oldest.done) map.delete(oldest.value);
|
|
49
|
-
}
|
|
32
|
+
touch(map, key, value);
|
|
33
|
+
evictToSize(map, MAX_ENTRIES);
|
|
50
34
|
},
|
|
51
35
|
async delete(key) {
|
|
52
36
|
map.delete(key);
|
|
53
37
|
},
|
|
54
38
|
/**
|
|
55
|
-
* Ignores the pattern and wipes the whole store
|
|
56
|
-
*
|
|
57
|
-
* store that dies in milliseconds does not earn.
|
|
39
|
+
* Ignores the pattern and wipes the whole store — over-invalidating a
|
|
40
|
+
* short-lived store costs at most a re-read.
|
|
58
41
|
*/
|
|
59
42
|
async clear(_pattern) {
|
|
60
43
|
map.clear();
|
|
@@ -62,11 +45,8 @@ function createRequestCacheAdapter() {
|
|
|
62
45
|
};
|
|
63
46
|
}
|
|
64
47
|
/**
|
|
65
|
-
* The cache for the CURRENT unit of work
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* Lazily created on first use, so a scope that never touches a cached
|
|
69
|
-
* repository allocates nothing.
|
|
48
|
+
* The cache for the CURRENT unit of work (see `runWorkScope`), or `undefined`
|
|
49
|
+
* outside one. Lazily created on first use.
|
|
70
50
|
*/
|
|
71
51
|
function requestScopedCache() {
|
|
72
52
|
return scopedValue(SLOT, createRequestCacheAdapter);
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
export { AccessControl, type AccessControlConfig, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, assertValidConfig, collectReadBlockedFields,
|
|
2
|
+
import { Bt as TreeMixin, Cn as ControllerConstructionOptions, Dn as BodySanitizerConfig, En as BodySanitizer, F as ResourceDefinition, Gt as BaseCrudController, Ht as SlugMixin, It as BaseController, Jt as AccessControl, Kt as QueryResolver, Lt as SoftDeleteExt, P as defineResource, Qt as FetchResult, Rt as SoftDeleteMixin, Sn as ControllerConfigurableOptions, Tn as MixinConstructor, Ut as BulkExt, Vt as SlugExt, Wt as BulkMixin, Xt as AccessControlRepository, Yt as AccessControlConfig, Zt as FetchDenialReason, at as AggregationCacheConfig, ct as AggregationIndexHint, dt as AggregationRateLimit, ft as AggregationsMap, it as AggMeasureShorthand, lt as AggregationMaterializedContext, ot as AggregationConfig, qt as QueryResolverConfig, rt as AggMeasureInput, st as AggregationDateRangeRequirement, ut as AggregationMaterializedResult, wn as ListResult, xn as BaseControllerOptions, zt as TreeExt } from "../index-mqaqZNpe.mjs";
|
|
3
|
+
import { A as createPermissionMiddleware, B as DEFAULT_VERSION_FIELD, C as AdapterLike, D as DefineActionConfig, E as mergeResourceConfig, F as DEFAULT_LIMIT, G as MAX_FILTER_DEPTH, H as HOOK_PHASES, I as DEFAULT_MAX_LIMIT, J as MUTATION_OPERATIONS, K as MAX_REGEX_LENGTH, L as DEFAULT_SORT, M as CRUD_OPERATIONS, N as CrudOperation, O as defineAction, P as DEFAULT_ID_FIELD, R as DEFAULT_TENANT_FIELD, S as defineResourceVariants, T as SeamedResourceConfig, U as HookOperation, V as HOOK_OPERATIONS, W as HookPhase, X as RESERVED_QUERY_PARAMS, Y as MutationOperation, Z as SYSTEM_FIELDS, _ as getEntityIdField, a as formatValidationErrors, b as VariantsMap, c as nativePolicyFilter, d as createFastifyHandler, f as createRequestContext, g as getEntityId, h as sendControllerResponse, i as assertValidConfig, j as defineAggregation, k as createCrudRouter, l as collectReadBlockedFields, m as getControllerScope, n as ValidateOptions, o as validateResourceConfig, p as getControllerContext, q as MAX_SEARCH_LENGTH, r as ValidationResult, s as NativePolicyFilter, t as ConfigError, u as isFieldReadable, v as getEntityQuery, w as ResourceSeams, x as VariantsResult, y as VariantOverride, z as DEFAULT_UPDATE_METHOD } from "../index-CRoPtISf.mjs";
|
|
4
|
+
export { AccessControl, type AccessControlConfig, type AccessControlRepository, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, sendControllerResponse, validateResourceConfig };
|