@classytic/arc 2.46.0 → 2.47.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-DNgD9NP4.mjs → EventTransport-BHKy4_Bi.mjs} +4 -4
- package/dist/{HookSystem-DRbPzEcP.mjs → HookSystem-CAIDVoKC.mjs} +2 -2
- package/dist/{ResourceRegistry-Douk51fa.mjs → ResourceRegistry-23Ml6FNe.mjs} +2 -2
- package/dist/{acquire-RbtvDg9s.mjs → acquire-DoFX06fm.mjs} +1 -1
- package/dist/{actionPermissions-De0AJ7hm.mjs → actionPermissions-DXrlWHHK.mjs} +13 -13
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +7 -7
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DeZMrHcm.mjs → authorizationDecision-DYiubkYw.mjs} +4 -4
- package/dist/{boundedMap-2WBh3gM9.mjs → boundedMap-CtdzpJ3X.mjs} +1 -1
- package/dist/{buildHandler-DxVOOBpw.mjs → buildHandler-CARdmPNo.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-BYRwYrUo.mjs → caching-QRiryDLs.mjs} +2 -2
- package/dist/{claimed-DYlELdnm.mjs → claimed-BLecr1j3.mjs} +1 -1
- package/dist/cleanup/index.d.mts +1 -1
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- 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-CHZMUwBW.mjs → constants-Cx7BcnHT.mjs} +1 -1
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -7
- package/dist/{core-D9rS2BxO.mjs → core-0WyMuo0f.mjs} +3 -3
- package/dist/{createActionRouter-0qkCRzTL.mjs → createActionRouter-mLAGbpDV.mjs} +6 -6
- package/dist/{createAggregationRouter-CUf5Esd9.mjs → createAggregationRouter-BEAjn3dA.mjs} +7 -7
- package/dist/{createApp-DZIXfDKD.mjs → createApp-QDP4vYWH.mjs} +29 -29
- package/dist/{createMcpServer-DeVpqQF-.d.mts → createMcpServer-DzXHX0SO.d.mts} +1 -1
- package/dist/{defineAggregation-bmKQ4NmC.mjs → defineAggregation-CFNfvz-C.mjs} +1 -1
- package/dist/{defineResource-CGmdmGwh.mjs → defineResource-BROJmhzJ.mjs} +10 -8
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-CzhqAyVN.mjs → elevation-DrXeEWWk.mjs} +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-dFyGOEoB.mjs → errorHandler-BiBXtxj4.mjs} +3 -3
- package/dist/{errors-BY8vzlP4.mjs → errors-DnrUChAy.mjs} +1 -1
- package/dist/{eventPlugin-eMhAPtQA.mjs → eventPlugin-BhKLUe7H.mjs} +8 -8
- package/dist/{eventTypes-Do2KYeJx.mjs → eventTypes-CCIRGakw.mjs} +2 -2
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +8 -7
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +3 -3
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-Dtn0IIRn.d.mts → fastify-augmentation-bzkWPt1f.d.mts} +2 -2
- package/dist/{fields-LnbCcvsw.mjs → fields-CYdpcV73.mjs} +1 -1
- package/dist/{filter-merge-BAWi019Q.mjs → filter-merge-6kasezRH.mjs} +1 -1
- package/dist/{generate-oXoDnpJf.mjs → generate-DUkcbc4r.mjs} +2 -2
- package/dist/{headers-DBd3Qheo.mjs → headers-KxhrKevA.mjs} +2 -2
- package/dist/{health-BlJu9GXS.mjs → health-CRJg3IIq.mjs} +1 -1
- package/dist/{health-Dp-3EC9o.mjs → health-jkYNdobJ.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.d.mts +211 -0
- package/dist/http-cache/index.mjs +605 -0
- package/dist/http-cache/purgers/cloudflare.d.mts +13 -0
- package/dist/http-cache/purgers/cloudflare.mjs +46 -0
- package/dist/http-cache/purgers/fastly.d.mts +12 -0
- package/dist/http-cache/purgers/fastly.mjs +47 -0
- package/dist/http-cache/testing/index.d.mts +68 -0
- package/dist/http-cache/testing/index.mjs +168 -0
- package/dist/idempotency/index.mjs +8 -8
- package/dist/idempotency/redis.mjs +2 -2
- package/dist/{index-BTxzJ_MN.d.mts → index-BxZS-8So.d.mts} +2 -2
- package/dist/{index-DyJFTJLA.d.mts → index-Cy2-QffW.d.mts} +9 -0
- package/dist/{index-CUdaoCYt.d.mts → index-D1X_C_qz.d.mts} +2 -2
- package/dist/{index-Bqfo8hLz.d.mts → index-DFCCQ9AE.d.mts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +11 -11
- package/dist/{init-BOaNkLYb.mjs → init-CACwpktI.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.mjs +3 -3
- package/dist/integrations/mcp/index.d.mts +3 -3
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +2 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +4 -3
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{jsonBody-DpRpKR_K.mjs → jsonBody-CzDBkCme.mjs} +2 -2
- package/dist/{keys-FBz6Ull-.mjs → keys-Cbwf6r1B.mjs} +1 -1
- package/dist/{loadResources-Bx1sKPnF.mjs → loadResources-Kr6vuljv.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-b_jcqbxh.mjs → loadResourcesFromEntry-D2e0qoDR.mjs} +2 -2
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-CbFcIEBZ.mjs → logger-C110X5Yz.mjs} +1 -1
- package/dist/{mcpPlugin-yix548XX.mjs → mcpPlugin-4lIPr9OJ.mjs} +22 -22
- package/dist/{memory-Bgw5dn8N.mjs → memory-D9qkhXiB.mjs} +3 -3
- package/dist/{metrics-CZDQWVjS.mjs → metrics-B-qrrWfI.mjs} +3 -3
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-Dsc_nKL5.mjs → module-BD8xHgrz.mjs} +1 -1
- package/dist/{multiTenant-XCxAUlru.d.mts → multiTenant-KZj8j1uJ.d.mts} +1 -1
- package/dist/{multipartBody-B85ek8Kj.mjs → multipartBody-qU7KCn1l.mjs} +1 -1
- package/dist/{observeSend-BK-JN1jK.mjs → observeSend-BnPtTotW.mjs} +1 -1
- package/dist/{openapi-Co7hl073.mjs → openapi-DoVa5SVP.mjs} +6 -6
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-XvUThpqn.d.mts → outbox-module-5Mnwcycy.d.mts} +1 -1
- package/dist/outbox-module-DyITEIop.mjs +297 -0
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-A1oKtpiC.mjs → permissions-BBy4bOGi.mjs} +9 -9
- package/dist/{pipe-Czpw9U2n.mjs → pipe-BOm2o4UA.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-KVseuBCL.mjs → plan-DDIGwuxr.mjs} +1 -1
- package/dist/{plugin-DTWt_8C3.mjs → plugin-Bn4D_0XK.mjs} +48 -24
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.mjs +17 -17
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-msB9X3yw.mjs → pluralize-ClEjcKlG.mjs} +1 -1
- package/dist/policy.types-DPqToKG1.d.mts +50 -0
- package/dist/presets/filesUpload.d.mts +1 -1
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +5 -5
- package/dist/presets/search.d.mts +1 -1
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-qKCehiJM.mjs → presets-DK2jh5YR.mjs} +4 -4
- package/dist/{projection-ClBqtsIw.mjs → projection-BHH-sXyS.mjs} +2 -2
- package/dist/purger.types-2wNJK_89.mjs +24 -0
- package/dist/purger.types-DvPp4-yd.d.mts +26 -0
- package/dist/{queryCachePlugin-3gJj5Rbz.mjs → queryCachePlugin-Ckqe98AM.mjs} +6 -6
- package/dist/{rateLimitKey-Kro---xl.mjs → rateLimitKey-CWAjlqcN.mjs} +1 -1
- package/dist/{realtime-Ber8uJN2.mjs → realtime-BIJi9USY.mjs} +11 -11
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-BA-_vFYk.mjs → registry-y9ZA-R_J.mjs} +2 -2
- package/dist/{outbox-module-mg9kDYkd.mjs → relay-BNrC1CEP.mjs} +5 -299
- package/dist/{renewingLease-CMY8YOcc.mjs → renewingLease-CS43br5E.mjs} +1 -1
- package/dist/{replyHelpers-DK9P_XSz.mjs → replyHelpers-oZDzakGb.mjs} +2 -2
- package/dist/{requestContext-GYO_0gEw.mjs → requestContext-fWb_YaV2.mjs} +1 -1
- package/dist/{requirement-DeNjZIH3.mjs → requirement--2hWyyHi.mjs} +1 -1
- package/dist/{resourceRateLimit-tHLbrtWc.mjs → resourceRateLimit-1WbcyMZY.mjs} +2 -2
- package/dist/{rolldown-runtime-Kv1fZdLg.mjs → rolldown-runtime-yH2lHMo_.mjs} +1 -1
- package/dist/{routeValidator-C_H5NanI.mjs → routeValidator-BSlRIA5c.mjs} +1 -1
- package/dist/{runtimeCapabilities-DWqbxkyw.mjs → runtimeCapabilities-CYCEtU1W.mjs} +1 -1
- package/dist/{schedules-eO_RzhCU.mjs → schedules-B5WGlYIT.mjs} +5 -5
- package/dist/{schemaConverter-DBJrPZN4.mjs → schemaConverter-DtNvts-6.mjs} +2 -2
- package/dist/{schemaIR-CEScKT2v.mjs → schemaIR-uS_RHqa3.mjs} +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-B-Sm9m_E.mjs → scope-BwVLSyNG.mjs} +4 -4
- package/dist/{shutdown-DzLFbe27.mjs → shutdown-BJiJN7FT.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-DOJhwQ8g.mjs → simpleEqualityMatcher-DGRLq-1k.mjs} +1 -1
- package/dist/{sse-2972pVwV.mjs → sse-B_50llZu.mjs} +7 -7
- package/dist/{sseStream-AWLEeNV-.mjs → sseStream-BjSo9Ult.mjs} +2 -2
- package/dist/{store-helpers-VzjgVTkM.mjs → store-helpers-D-n5cwy5.mjs} +1 -1
- package/dist/{streaming-DvraWW6x.mjs → streaming-Dcgqa-hH.mjs} +1 -1
- package/dist/{subscriberIdentity-Bya56jsg.mjs → subscriberIdentity-C9KhIXTF.mjs} +1 -1
- package/dist/{tenancy-DSa_0hhw.mjs → tenancy-COrhjPRZ.mjs} +2 -2
- package/dist/{tenantPreparation-BrpkQre3.mjs → tenantPreparation-BElWHytd.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +3 -3
- package/dist/testing/index.mjs +11 -11
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-6rQTuCwg.mjs → timing-CaxKbRk_.mjs} +1 -1
- package/dist/{transactionContext-DaxYUEgH.mjs → transactionContext-8qKON0Nk.mjs} +1 -1
- package/dist/{typeGuards-UKnX8wPX.mjs → typeGuards-DVjVSsXO.mjs} +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-CuGjhn83.mjs → types-DZHqOuJE.mjs} +4 -4
- package/dist/{types-BYEb_dLW.d.mts → types-DeLiuaNv.d.mts} +1 -1
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-oX5_mOVs.mjs → userHelpers-_eGj6kf0.mjs} +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-CjjGOT4E.mjs → utils-Dd6MWpye.mjs} +5 -5
- package/dist/{validate-4RlTKOJb.mjs → validate-BaF5wd0x.mjs} +3 -3
- package/dist/{versioning-Dk2-19La.mjs → versioning-DyV7mwtK.mjs} +3 -3
- package/dist/{workScope-DoBsoVo4.mjs → workScope-CmCBUmPR.mjs} +2 -2
- package/package.json +48 -20
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { m as MUTATION_OPERATIONS, t as CRUD_OPERATIONS } from "./constants-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { C as isWriteVerbCapable, S as detectOverriddenWriteSlots, f as BaseController, i as resolveOpenApiSchemas, l as autoInjectTenantFieldRules, t as buildResourcePlugin } from "./plugin-
|
|
5
|
-
import { a as isZodSchema, i as isJsonSchema } from "./schemaConverter-
|
|
6
|
-
import { B as requireAuth } from "./permissions-
|
|
7
|
-
import { n as getAvailablePresets, t as applyPresets } from "./presets-
|
|
8
|
-
import { t as pluralize } from "./pluralize-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { m as MUTATION_OPERATIONS, t as CRUD_OPERATIONS } from "./constants-Cx7BcnHT.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-C110X5Yz.mjs";
|
|
4
|
+
import { C as isWriteVerbCapable, S as detectOverriddenWriteSlots, f as BaseController, i as resolveOpenApiSchemas, l as autoInjectTenantFieldRules, t as buildResourcePlugin } from "./plugin-Bn4D_0XK.mjs";
|
|
5
|
+
import { a as isZodSchema, i as isJsonSchema } from "./schemaConverter-DtNvts-6.mjs";
|
|
6
|
+
import { B as requireAuth } from "./permissions-BBy4bOGi.mjs";
|
|
7
|
+
import { n as getAvailablePresets, t as applyPresets } from "./presets-DK2jh5YR.mjs";
|
|
8
|
+
import { t as pluralize } from "./pluralize-ClEjcKlG.mjs";
|
|
9
9
|
import { isReadOnlyRepo } from "@classytic/repo-core/repository";
|
|
10
10
|
import { readEnv } from "@classytic/primitives/environment";
|
|
11
11
|
// src/core/defineResource/writeVerbs.ts
|
|
@@ -678,6 +678,7 @@ var ResourceDefinition = class {
|
|
|
678
678
|
events;
|
|
679
679
|
rateLimit;
|
|
680
680
|
idempotency;
|
|
681
|
+
httpCache;
|
|
681
682
|
lookupFields;
|
|
682
683
|
audit;
|
|
683
684
|
updateMethod;
|
|
@@ -807,6 +808,7 @@ var ResourceDefinition = class {
|
|
|
807
808
|
this.aggregations = config.aggregations;
|
|
808
809
|
this.rateLimit = config.rateLimit;
|
|
809
810
|
this.idempotency = config.idempotency;
|
|
811
|
+
this.httpCache = config.httpCache;
|
|
810
812
|
this.lookupFields = config.lookupFields;
|
|
811
813
|
this.audit = config.audit;
|
|
812
814
|
this.updateMethod = config.updateMethod;
|
package/dist/discovery/index.mjs
CHANGED
package/dist/docs/index.d.mts
CHANGED
package/dist/docs/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as getUserRoles } from "../userHelpers-
|
|
3
|
-
import { n as openapi_default, t as buildOpenApiSpec } from "../openapi-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles } from "../userHelpers-_eGj6kf0.mjs";
|
|
3
|
+
import { n as openapi_default, t as buildOpenApiSpec } from "../openapi-DoVa5SVP.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
// src/docs/scalar.ts
|
|
6
6
|
const scalarPlugin = async (fastify, opts = {}) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
5
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-C110X5Yz.mjs";
|
|
4
|
+
import { n as requireSingleHeaderValue } from "./headers-KxhrKevA.mjs";
|
|
5
|
+
import { n as getUserRoles } from "./userHelpers-_eGj6kf0.mjs";
|
|
6
6
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
// src/scope/elevation.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as ArcError } from "../errors-
|
|
3
|
-
import { t as parseJsonBody } from "../jsonBody-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as ArcError } from "../errors-DnrUChAy.mjs";
|
|
3
|
+
import { t as parseJsonBody } from "../jsonBody-CzDBkCme.mjs";
|
|
4
4
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
5
5
|
import fp from "fastify-plugin";
|
|
6
6
|
// src/encryption/fieldCipher.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { m as statusToArcCode, p as isArcError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
|
|
3
|
+
import { m as statusToArcCode, p as isArcError } from "./errors-DnrUChAy.mjs";
|
|
4
4
|
import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
|
|
5
5
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { d as createDomainError } from "./errors-
|
|
5
|
-
import { n as requestContext } from "./requestContext-
|
|
6
|
-
import { i as runAdmittedWork, n as isAdmittedWork, r as registerShutdownParticipant } from "./shutdown-
|
|
7
|
-
import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-
|
|
8
|
-
import { n as preserveSubscriberIdentity } from "./subscriberIdentity-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-yH2lHMo_.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-C110X5Yz.mjs";
|
|
4
|
+
import { d as createDomainError } from "./errors-DnrUChAy.mjs";
|
|
5
|
+
import { n as requestContext } from "./requestContext-fWb_YaV2.mjs";
|
|
6
|
+
import { i as runAdmittedWork, n as isAdmittedWork, r as registerShutdownParticipant } from "./shutdown-BJiJN7FT.mjs";
|
|
7
|
+
import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-BHKy4_Bi.mjs";
|
|
8
|
+
import { n as preserveSubscriberIdentity } from "./subscriberIdentity-C9KhIXTF.mjs";
|
|
9
9
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
10
10
|
import fp from "fastify-plugin";
|
|
11
11
|
import { NonDurablePublishError } from "@classytic/primitives/durable-events";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as createEvent } from "./EventTransport-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as createEvent } from "./EventTransport-BHKy4_Bi.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { durableEventMeta } from "@classytic/primitives/durable-events";
|
|
5
5
|
// src/events/defineEvent.ts
|
package/dist/events/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-CYEoCJGe.mjs";
|
|
3
3
|
import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-BY38F6yK.mjs";
|
|
4
|
-
import { a as MemoryOutboxStore, c as OutboxRelayErrorHandler, d as DEFAULT_RELAY_LAG_UNHEALTHY_MS, f as OutboxHealth, i as createOutboxModule, l as OutboxRelayErrorKind, m as readOutboxHealth, n as OutboxModuleExports, o as EventOutbox, p as OutboxHealthStore, r as OutboxModuleOptions, s as EventOutboxOptions, t as OutboxDrainResult, u as RelayResult } from "../outbox-module-
|
|
4
|
+
import { a as MemoryOutboxStore, c as OutboxRelayErrorHandler, d as DEFAULT_RELAY_LAG_UNHEALTHY_MS, f as OutboxHealth, i as createOutboxModule, l as OutboxRelayErrorKind, m as readOutboxHealth, n as OutboxModuleExports, o as EventOutbox, p as OutboxHealthStore, r as OutboxModuleOptions, s as EventOutboxOptions, t as OutboxDrainResult, u as RelayResult } from "../outbox-module-5Mnwcycy.mjs";
|
|
5
5
|
import { RedisEventTransportOptions, RedisLike } from "./transports/redis.mjs";
|
|
6
6
|
import { r as RedisStreamTransportOptions, t as RedisStreamLike } from "../redis-stream-CS1N9dwM.mjs";
|
|
7
|
-
import { IdempotencyClaimStore } from "@classytic/repo-core/idempotency";
|
|
8
7
|
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
8
|
+
import { IdempotencyClaimStore } from "@classytic/repo-core/idempotency";
|
|
9
9
|
import { RepositoryLike } from "@classytic/repo-core/adapter";
|
|
10
10
|
/**
|
|
11
11
|
* Event Type Constants and Helpers
|
package/dist/events/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as MemoryEventTransport } from "../EventTransport-
|
|
3
|
-
import { a as crudEventType, d as createEventRegistry, f as defineEvent, i as CRUD_EVENT_SUFFIXES, l as wrapWithBoundary, n as CACHE_EVENTS, o as subscribeWithBoundary, s as subscribeWithSchema, t as ARC_LIFECYCLE_EVENTS, u as wrapWithSchema } from "../eventTypes-
|
|
4
|
-
import { r as withSubscriberId } from "../subscriberIdentity-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as MemoryEventTransport } from "../EventTransport-BHKy4_Bi.mjs";
|
|
3
|
+
import { a as crudEventType, d as createEventRegistry, f as defineEvent, i as CRUD_EVENT_SUFFIXES, l as wrapWithBoundary, n as CACHE_EVENTS, o as subscribeWithBoundary, s as subscribeWithSchema, t as ARC_LIFECYCLE_EVENTS, u as wrapWithSchema } from "../eventTypes-CCIRGakw.mjs";
|
|
4
|
+
import { r as withSubscriberId } from "../subscriberIdentity-C9KhIXTF.mjs";
|
|
5
|
+
import { n as repositoryAsOutboxStore, r as exponentialBackoff, t as EventOutbox } from "../relay-BNrC1CEP.mjs";
|
|
6
|
+
import { a as withRetry, i as createDeadLetterPublisher, n as eventPlugin } from "../eventPlugin-BhKLUe7H.mjs";
|
|
7
|
+
import { r as readOutboxHealth, t as DEFAULT_RELAY_LAG_UNHEALTHY_MS } from "../health-CRJg3IIq.mjs";
|
|
8
|
+
import { t as createOutboxModule } from "../outbox-module-DyITEIop.mjs";
|
|
8
9
|
import { fingerprintRequest, runIdempotent } from "@classytic/repo-core/idempotency";
|
|
9
10
|
import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
|
|
10
11
|
// src/events/inbox.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as evictToSize } from "../../boundedMap-
|
|
3
|
-
import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-
|
|
4
|
-
import { t as getSubscriberId } from "../../subscriberIdentity-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as evictToSize } from "../../boundedMap-CtdzpJ3X.mjs";
|
|
3
|
+
import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CmCBUmPR.mjs";
|
|
4
|
+
import { t as getSubscriberId } from "../../subscriberIdentity-C9KhIXTF.mjs";
|
|
5
5
|
import sjson from "secure-json-parse";
|
|
6
6
|
import { createEventRouter } from "@classytic/primitives/events";
|
|
7
7
|
// src/events/transports/redis-stream.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CmCBUmPR.mjs";
|
|
3
3
|
import sjson from "secure-json-parse";
|
|
4
4
|
// src/events/transports/redis.ts
|
|
5
5
|
/**
|
package/dist/factory/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { F as HealthCheck, _ as ResourceLike, a as ArcPortRegistry, c as LazyBridge, d as ModulePorts, f as ModuleRequirements, g as LoadResourcesOptions, h as ModuleSetupContext, i as ArcModuleRegistry, l as ModuleContribution, m as ModuleDisposer, n as ArcModule, o as ArcPorts, p as PortName, r as ArcModuleInput, s as EventHandlerDefinition, t as ArcCompositionConfig, u as ModuleName, v as ResourceModule, y as loadResources } from "../types-BeEJm-DV.mjs";
|
|
3
|
-
import { $ as verifyModuleGraph, A as AsyncApiCatalogEntry, B as ModuleGraphMode, C as planModules, D as ModuleExtension, E as subscribeModuleEventHandlers, F as DurabilityFacts, G as activateBridges, H as ModuleGraphOptions, I as HandlerDurabilityFact, J as crudEventsOf, K as analyzeModuleGraph, L as ModuleGraph, M as toAsyncApi, N as CrudSurface, O as extendModule, P as DerivedPublishes, Q as verifyEventDurability, R as ModuleGraphAnalysis, S as compositionProblems, T as orderModules, U as ModuleKind, V as ModuleGraphNode, W as SkippedBridge, X as eventTopology, Y as dependentsOf, Z as renderModuleGraph, _ as ClosureNode, a as lazyModuleExports, b as PlanModulesOptions, c as getModuleResources, d as resolveContribution, f as resolveModule, g as withRelayNudge, h as createRelayNudge, i as hasModuleExports, j as AsyncApiInfo, k as collectModuleWorkflows, l as getModuleState, m as RelayOption, n as getModuleExports, o as lazyRequiredModuleExports, p as RelayNudge, q as buildModuleGraph, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as hasModule, v as CompositionProblem, w as resolveModuleClosure, x as assertComposable, y as ModulePlan, z as ModuleGraphIssue } from "../index-
|
|
4
|
-
import { a as ResolvedModuleDescriptor, o as ResolvedModuleLifecycle, s as ResolvedResourceDescriptor } from "../fastify-augmentation-
|
|
5
|
-
import { a as UnderPressureOptions, c as CustomAuthenticatorOption, i as RawBodyOptions, l as CustomPluginAuthOption, n as CreateAppOptions, o as AuthOption, r as MultipartOptions, s as BetterAuthOption, t as BootDisposer, u as JwtAuthOption } from "../index-
|
|
3
|
+
import { $ as verifyModuleGraph, A as AsyncApiCatalogEntry, B as ModuleGraphMode, C as planModules, D as ModuleExtension, E as subscribeModuleEventHandlers, F as DurabilityFacts, G as activateBridges, H as ModuleGraphOptions, I as HandlerDurabilityFact, J as crudEventsOf, K as analyzeModuleGraph, L as ModuleGraph, M as toAsyncApi, N as CrudSurface, O as extendModule, P as DerivedPublishes, Q as verifyEventDurability, R as ModuleGraphAnalysis, S as compositionProblems, T as orderModules, U as ModuleKind, V as ModuleGraphNode, W as SkippedBridge, X as eventTopology, Y as dependentsOf, Z as renderModuleGraph, _ as ClosureNode, a as lazyModuleExports, b as PlanModulesOptions, c as getModuleResources, d as resolveContribution, f as resolveModule, g as withRelayNudge, h as createRelayNudge, i as hasModuleExports, j as AsyncApiInfo, k as collectModuleWorkflows, l as getModuleState, m as RelayOption, n as getModuleExports, o as lazyRequiredModuleExports, p as RelayNudge, q as buildModuleGraph, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as hasModule, v as CompositionProblem, w as resolveModuleClosure, x as assertComposable, y as ModulePlan, z as ModuleGraphIssue } from "../index-DFCCQ9AE.mjs";
|
|
4
|
+
import { a as ResolvedModuleDescriptor, o as ResolvedModuleLifecycle, s as ResolvedResourceDescriptor } from "../fastify-augmentation-bzkWPt1f.mjs";
|
|
5
|
+
import { a as UnderPressureOptions, c as CustomAuthenticatorOption, i as RawBodyOptions, l as CustomPluginAuthOption, n as CreateAppOptions, o as AuthOption, r as MultipartOptions, s as BetterAuthOption, t as BootDisposer, u as JwtAuthOption } from "../index-D1X_C_qz.mjs";
|
|
6
6
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
7
7
|
/**
|
|
8
8
|
* Default pino redact paths (auth/cookie/API-key headers, nested
|
package/dist/factory/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as mergeHealthChecks, t as healthPlugin } from "../health-
|
|
3
|
-
import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-
|
|
4
|
-
import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-
|
|
5
|
-
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-
|
|
6
|
-
import { t as loadResources } from "../loadResources-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as mergeHealthChecks, t as healthPlugin } from "../health-jkYNdobJ.mjs";
|
|
3
|
+
import { a as developmentPreset, c as productionPreset, d as getModuleResources, f as getModuleState, g as collectModuleWorkflows, l as testingPreset, m as subscribeModuleEventHandlers, n as DEFAULT_LOGGER_REDACT_PATHS, o as edgePreset, p as hasModule, r as createApp, s as getPreset, t as ArcFactory, u as workerPreset } from "../createApp-QDP4vYWH.mjs";
|
|
4
|
+
import { _ as dependentsOf, b as verifyEventDurability, d as resolveModule, g as crudEventsOf, h as buildModuleGraph, i as planModules, m as analyzeModuleGraph, o as resolveModuleClosure, p as activateBridges, r as compositionProblems, s as orderModules, t as assertComposable, u as resolveContribution, v as eventTopology, x as verifyModuleGraph, y as renderModuleGraph } from "../plan-DDIGwuxr.mjs";
|
|
5
|
+
import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-BD8xHgrz.mjs";
|
|
6
|
+
import { t as loadResources } from "../loadResources-Kr6vuljv.mjs";
|
|
7
7
|
// src/factory/module/asyncapi.ts
|
|
8
8
|
/**
|
|
9
9
|
* The module graph as an AsyncAPI 3.0 document — one channel per event (addressed by the event
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { M as ResourceRegistry, dn as HookSystem } from "./index-
|
|
2
|
+
import { M as ResourceRegistry, dn as HookSystem } from "./index-Cy2-QffW.mjs";
|
|
3
3
|
import { t as ExternalOpenApiPaths } from "./externalPaths-BOqdq5wr.mjs";
|
|
4
4
|
import { F as HealthCheck, i as ArcModuleRegistry, n as ArcModule, x as ScheduleDefinition } from "./types-BeEJm-DV.mjs";
|
|
5
|
-
import { L as ModuleGraph, s as ModuleState } from "./index-
|
|
5
|
+
import { L as ModuleGraph, s as ModuleState } from "./index-DFCCQ9AE.mjs";
|
|
6
6
|
import { FastifyPluginAsync } from "fastify";
|
|
7
7
|
/**
|
|
8
8
|
* Resolved module introspection — what a module ACTUALLY composed to.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as pluralize } from "./pluralize-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as pluralize } from "./pluralize-ClEjcKlG.mjs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
// src/cli/commands/generate/name-helpers.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { u as ValidationError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
import { u as ValidationError } from "./errors-DnrUChAy.mjs";
|
|
3
3
|
// src/utils/headers.ts
|
|
4
4
|
/**
|
|
5
5
|
* Canonical header typing + accessor.
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { _n as beforeDelete, an as DefineHookOptions, bn as defineHook, cn as HookOperation, dn as HookSystem, fn as HookSystemOptions, gn as beforeCreate, hn as afterUpdate, in as AroundHookHandler, ln as HookPhase, mn as afterDelete, on as HookContext, pn as afterCreate, sn as HookHandler, un as HookRegistration, vn as beforeUpdate, yn as createHookSystem } from "../index-
|
|
2
|
+
import { _n as beforeDelete, an as DefineHookOptions, bn as defineHook, cn as HookOperation, dn as HookSystem, fn as HookSystemOptions, gn as beforeCreate, hn as afterUpdate, in as AroundHookHandler, ln as HookPhase, mn as afterDelete, on as HookContext, pn as afterCreate, sn as HookHandler, un as HookRegistration, vn as beforeUpdate, yn as createHookSystem } from "../index-Cy2-QffW.mjs";
|
|
3
3
|
export { type AroundHookHandler, type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-
|
|
1
|
+
/*! @classytic/arc v2.47.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as HookSystem, n as afterCreate, r as afterDelete, i as afterUpdate, a as beforeCreate, o as beforeDelete, s as beforeUpdate, c as createHookSystem, l as defineHook } from "../HookSystem-CAIDVoKC.mjs";
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as PrivacyDecision, c as RouteHttpCacheConfig, i as NonCacheableReason, l as TagSpec, n as HttpCachePolicy, o as PrivacyReason, r as HttpCacheRule, s as ResourceHttpCacheConfig, t as DocumentTags } from "../policy.types-DPqToKG1.mjs";
|
|
3
|
+
import { n as DomainEvent } from "../EventTransport-CYEoCJGe.mjs";
|
|
4
|
+
import { i as PurgerCapabilities, n as CachePurger, r as PurgeMode, t as CachePurgeError } from "../purger.types-DvPp4-yd.mjs";
|
|
5
|
+
import { FastifyInstance, FastifyPluginAsync, FastifyRequest } from "fastify";
|
|
6
|
+
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
7
|
+
interface InvalidationBatch {
|
|
8
|
+
tags: readonly string[];
|
|
9
|
+
mode: PurgeMode;
|
|
10
|
+
}
|
|
11
|
+
interface DeliveryContext {
|
|
12
|
+
purger: CachePurger;
|
|
13
|
+
/** Report the outcome of a purge the delivery performed itself (durable relay). */
|
|
14
|
+
report(batch: InvalidationBatch, outcome: "sent" | "failed", durationMs: number, error?: unknown): void;
|
|
15
|
+
log: {
|
|
16
|
+
warn(obj: unknown, msg: string): void;
|
|
17
|
+
error(obj: unknown, msg: string): void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How a batch reaches the purger. `batched` calls it in-process; `durable` persists the batch and a relay
|
|
22
|
+
* delivers it with retry, so a CDN outage or a crash after the write does not leave content stale.
|
|
23
|
+
*/
|
|
24
|
+
interface InvalidationDelivery {
|
|
25
|
+
readonly kind: "batched" | "durable";
|
|
26
|
+
start(ctx: DeliveryContext): void | Promise<void>;
|
|
27
|
+
/** Resolve once the batch is delivered (batched) or safely persisted (durable). Reject on failure. */
|
|
28
|
+
deliver(batch: InvalidationBatch): Promise<void>;
|
|
29
|
+
/** Drain whatever can be drained now (tests, shutdown). */
|
|
30
|
+
drain(): Promise<void>;
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** In-process delivery: one purger call per batch. A failure is reported and the batch is dropped. */
|
|
34
|
+
export declare function batchedDelivery(): InvalidationDelivery;
|
|
35
|
+
/** Event pattern -> tags (purged hard), or `{ tags, mode }` to choose the mode. */
|
|
36
|
+
type PurgeOn = Readonly<Record<string, (event: DomainEvent<unknown>) => readonly string[] | {
|
|
37
|
+
tags: readonly string[];
|
|
38
|
+
mode: PurgeMode;
|
|
39
|
+
} | undefined>>;
|
|
40
|
+
/**
|
|
41
|
+
* The tags a CRUD event invalidates for a cached resource: `<resource>` (its lists) and `<resource>:<id>`,
|
|
42
|
+
* plus the resource's extra tags for the document. Updates and creates purge soft (stale copy served while
|
|
43
|
+
* one request refreshes); deletes purge hard.
|
|
44
|
+
*/
|
|
45
|
+
export declare function tagsForCrudEvent(event: DomainEvent<unknown>, resources: ReadonlyMap<string, {
|
|
46
|
+
extra?: DocumentTags;
|
|
47
|
+
}>): {
|
|
48
|
+
tags: string[];
|
|
49
|
+
mode: PurgeMode;
|
|
50
|
+
} | undefined;
|
|
51
|
+
/** Bounded reason kinds: a metric label never carries a cookie name or header value. */
|
|
52
|
+
type ReasonKind = "header" | "cookie" | "scope" | "classifier" | "status" | "set-cookie";
|
|
53
|
+
interface PurgeEvent {
|
|
54
|
+
tags: readonly string[];
|
|
55
|
+
mode: PurgeMode;
|
|
56
|
+
delivery: "batched" | "durable";
|
|
57
|
+
/** `enqueued`: written to the durable store; `sent`: the purger accepted it; `failed`: it threw. */
|
|
58
|
+
outcome: "enqueued" | "sent" | "failed";
|
|
59
|
+
durationMs: number;
|
|
60
|
+
error?: unknown;
|
|
61
|
+
}
|
|
62
|
+
/** Hooks for metrics/tracing. Called synchronously; never throw from them. */
|
|
63
|
+
interface HttpCacheObserver {
|
|
64
|
+
onDecision?(event: {
|
|
65
|
+
url: string;
|
|
66
|
+
cacheable: boolean;
|
|
67
|
+
reason?: NonCacheableReason;
|
|
68
|
+
}): void;
|
|
69
|
+
onPurge?(event: PurgeEvent): void;
|
|
70
|
+
}
|
|
71
|
+
interface HttpCacheStats {
|
|
72
|
+
responses: {
|
|
73
|
+
public: number;
|
|
74
|
+
private: Record<ReasonKind, number>;
|
|
75
|
+
};
|
|
76
|
+
purges: {
|
|
77
|
+
enqueued: number;
|
|
78
|
+
sent: number;
|
|
79
|
+
failed: number;
|
|
80
|
+
tags: number;
|
|
81
|
+
};
|
|
82
|
+
pending: number;
|
|
83
|
+
}
|
|
84
|
+
/** Query parameters that never change a response: marketing and click identifiers. */
|
|
85
|
+
export declare const DEFAULT_IGNORED_QUERY: readonly ["utm_*", "fbclid", "gclid", "msclkid", "mc_cid", "mc_eid", "_ga"];
|
|
86
|
+
interface CanonicalQueryOptions {
|
|
87
|
+
/** Parameter names to drop; a trailing `*` matches a prefix. Default {@link DEFAULT_IGNORED_QUERY}. */
|
|
88
|
+
ignore?: readonly string[];
|
|
89
|
+
/** Sort the remaining parameters by name (stable for repeats). Default true. */
|
|
90
|
+
sort?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The one URL a response is cached under: tracking parameters dropped, the rest sorted. Equal content,
|
|
94
|
+
* equal key, so a CDN stores one copy instead of one per campaign link.
|
|
95
|
+
*/
|
|
96
|
+
export declare function canonicalUrl(url: string, opts?: CanonicalQueryOptions): string;
|
|
97
|
+
interface DirectiveOptions {
|
|
98
|
+
/** Emit RFC 9213 `CDN-Cache-Control`: the CDN TTL no browser or proxy sees. Default true. */
|
|
99
|
+
cdnCacheControl?: boolean;
|
|
100
|
+
/** Also put `s-maxage` in `Cache-Control`, for CDNs that do not read RFC 9213. Default true. */
|
|
101
|
+
sMaxAge?: boolean;
|
|
102
|
+
}
|
|
103
|
+
type CacheHeaders = Readonly<Record<string, string>>;
|
|
104
|
+
/** Headers for a reply a shared cache may store. One function, so every tier reads one decision. */
|
|
105
|
+
export declare function publicHeaders(policy: HttpCachePolicy, opts?: DirectiveOptions): CacheHeaders;
|
|
106
|
+
/** Headers for a reply no shared cache may store. */
|
|
107
|
+
export declare function privateHeaders(reason: NonCacheableReason): CacheHeaders;
|
|
108
|
+
export declare const DEFAULT_PRIVATE_HEADERS: readonly ["authorization", "x-api-key", "x-organization-id"];
|
|
109
|
+
interface PrivacyOptions {
|
|
110
|
+
/** Request headers that make a request private. Default {@link DEFAULT_PRIVATE_HEADERS}. */
|
|
111
|
+
privateHeaders?: readonly string[];
|
|
112
|
+
/** Cookie names that do NOT make a request private (analytics, consent). Any other cookie does. */
|
|
113
|
+
publicCookies?: readonly string[];
|
|
114
|
+
/** Extra check, AND-ed with the built-in one: return false to make a request private. Never makes one public. */
|
|
115
|
+
classify?: (request: FastifyRequest) => boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Private when ANY signal of a caller is present: a credential header, a cookie outside the allowlist, a
|
|
119
|
+
* non-public arc scope, or the host's classifier. Reasons name the signal, never its value.
|
|
120
|
+
*/
|
|
121
|
+
export declare function classifyPrivacy(request: FastifyRequest, opts?: PrivacyOptions): PrivacyDecision;
|
|
122
|
+
interface HttpCacheOptions {
|
|
123
|
+
/** Where invalidations go. Default: a no-op. Combine tiers with `composePurgers`. */
|
|
124
|
+
purger?: CachePurger;
|
|
125
|
+
/** `batchedDelivery()` (default) or `durableDelivery({ store })` for production. */
|
|
126
|
+
delivery?: InvalidationDelivery;
|
|
127
|
+
/** Collect invalidations this long before one delivery. Default 100 ms. */
|
|
128
|
+
batchWindowMs?: number;
|
|
129
|
+
/** Who counts as a caller. A host `classify` can only add privacy. */
|
|
130
|
+
privacy?: PrivacyOptions;
|
|
131
|
+
/** Path-prefix policies, for routes that cannot carry `config`. A route's own policy wins. */
|
|
132
|
+
rules?: readonly HttpCacheRule[];
|
|
133
|
+
/** Tag header. Default `{ name: 'Cache-Tag', separator: ',' }`; Fastly: `{ name: 'Surrogate-Key', separator: ' ' }`. */
|
|
134
|
+
tagHeader?: {
|
|
135
|
+
name: string;
|
|
136
|
+
separator: string;
|
|
137
|
+
};
|
|
138
|
+
/** Which TTL headers to emit. Default: both `CDN-Cache-Control` and `s-maxage`. */
|
|
139
|
+
headers?: DirectiveOptions;
|
|
140
|
+
/** CDNs that ignore `Vary: Origin` need one fixed allowed origin on cacheable replies, and no credentials header. */
|
|
141
|
+
cors?: {
|
|
142
|
+
origin: string;
|
|
143
|
+
};
|
|
144
|
+
/** Redirect (301) an opted-in GET whose query is not canonical (tracking params, unsorted). Off by default. */
|
|
145
|
+
canonicalQuery?: CanonicalQueryOptions & {
|
|
146
|
+
redirect: true;
|
|
147
|
+
};
|
|
148
|
+
/** Purge resources automatically from their CRUD events. Default true. */
|
|
149
|
+
autoPurge?: boolean;
|
|
150
|
+
/** Explicit event pattern -> tags. Requires the events plugin. */
|
|
151
|
+
purgeOn?: PurgeOn;
|
|
152
|
+
observer?: HttpCacheObserver;
|
|
153
|
+
}
|
|
154
|
+
interface HttpCacheDecorator {
|
|
155
|
+
/** Queue tags. Never throws, never waits for the CDN. Soft falls back to hard where unsupported. */
|
|
156
|
+
invalidate(tags: readonly string[] | string, options?: {
|
|
157
|
+
mode?: PurgeMode;
|
|
158
|
+
}): void;
|
|
159
|
+
/** Deliver the queued batch now (scripts, shutdown, tests). */
|
|
160
|
+
flush(): Promise<void>;
|
|
161
|
+
/** Tags queued and not yet delivered. */
|
|
162
|
+
pending(): readonly string[];
|
|
163
|
+
stats(): HttpCacheStats;
|
|
164
|
+
}
|
|
165
|
+
declare module "fastify" {
|
|
166
|
+
interface FastifyInstance {
|
|
167
|
+
httpCache: HttpCacheDecorator;
|
|
168
|
+
}
|
|
169
|
+
interface FastifyContextConfig {
|
|
170
|
+
httpCache?: RouteHttpCacheConfig;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export declare const httpCachePlugin: FastifyPluginAsync<HttpCacheOptions>;
|
|
174
|
+
export declare const INVALIDATE_EVENT = "arc.http-cache.invalidate";
|
|
175
|
+
interface DurableDeliveryOptions {
|
|
176
|
+
/** Where batches wait for delivery. A repository-backed store on the app database in production. */
|
|
177
|
+
store: OutboxStore;
|
|
178
|
+
/** Relay interval. Default 1,000 ms. */
|
|
179
|
+
pollMs?: number;
|
|
180
|
+
/** Attempts before a batch is dead-lettered. Default 8. */
|
|
181
|
+
maxAttempts?: number;
|
|
182
|
+
/** Delay before retry `attempt` (1-based). Default: arc's exponential backoff with jitter. */
|
|
183
|
+
retryDelayMs?: (attempt: number) => number;
|
|
184
|
+
/** Batches per relay pass. Default 50. */
|
|
185
|
+
batchSize?: number;
|
|
186
|
+
/** Lease per claimed batch. Default 30,000 ms. */
|
|
187
|
+
leaseMs?: number;
|
|
188
|
+
/** Identifies this replica's relay. Default `arc-http-cache`. */
|
|
189
|
+
consumerId?: string;
|
|
190
|
+
}
|
|
191
|
+
export declare function durableDelivery(options: DurableDeliveryOptions): InvalidationDelivery;
|
|
192
|
+
/** A tag every major CDN accepts: printable ASCII, no space or comma, at most 1,024 characters; de-duplicated. */
|
|
193
|
+
export declare function normalizeTags(tags: readonly unknown[] | undefined): string[];
|
|
194
|
+
/** `<resource>` and `<resource>:<id>`: the convention responses carry and purges target. */
|
|
195
|
+
export declare function resourceTags(resource: string, id?: unknown): string[];
|
|
196
|
+
/** Purges nothing: the default for development and tests. */
|
|
197
|
+
export declare const noopPurger: CachePurger;
|
|
198
|
+
/** Records every call: assert purges in tests without a CDN. */
|
|
199
|
+
export declare function createMemoryPurger(capabilities?: CachePurger["capabilities"]): {
|
|
200
|
+
purger: CachePurger;
|
|
201
|
+
calls: {
|
|
202
|
+
tags: string[];
|
|
203
|
+
mode: PurgeMode;
|
|
204
|
+
}[];
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Purge several tiers at once (CDN + in-process + a second CDN). Each child gets its own chunking and
|
|
208
|
+
* soft-purge support; all are attempted, and any failure rejects with every error.
|
|
209
|
+
*/
|
|
210
|
+
export declare function composePurgers(...purgers: readonly CachePurger[]): CachePurger;
|
|
211
|
+
export { type CacheHeaders, CachePurgeError, type CachePurger, type CanonicalQueryOptions, type DirectiveOptions, type DocumentTags, type DurableDeliveryOptions, type HttpCacheDecorator, type HttpCacheObserver, type HttpCacheOptions, type HttpCachePolicy, type HttpCacheRule, type HttpCacheStats, type InvalidationBatch, type InvalidationDelivery, type NonCacheableReason, type PrivacyDecision, type PrivacyOptions, type PrivacyReason, type PurgeEvent, type PurgeMode, type PurgeOn, type PurgerCapabilities, type ReasonKind, type ResourceHttpCacheConfig, type RouteHttpCacheConfig, type TagSpec };
|