@classytic/arc 2.43.0 → 2.44.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-tzA7CAB4.mjs → EventTransport-DZWDsaPa.mjs} +2 -2
- package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-yjEgn7Cm.mjs} +2 -2
- package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-DJxHUpE4.mjs} +2 -2
- package/dist/acquire-BozJ-9yt.mjs +35 -0
- package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-5N04zBL4.mjs} +13 -17
- package/dist/audit/index.d.mts +6 -6
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.d.mts +8 -8
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +5 -5
- package/dist/auth/index.mjs +11 -8
- package/dist/auth/redis-session.d.mts +4 -5
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-wX3SA9w_.mjs} +4 -4
- package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DWiKW7lP.mjs} +1 -1
- package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-Bswu_vNb.mjs} +4 -4
- package/dist/cache/index.d.mts +9 -9
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-Cc2M1DwO.mjs → caching-Drp68DIS.mjs} +2 -2
- package/dist/{claimed-B10RTfkM.mjs → claimed-DYvQoZLv.mjs} +1 -1
- package/dist/cleanup/index.d.mts +14 -14
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +5 -5
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.d.mts +2 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.d.mts +2 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -3
- package/dist/cli/commands/init.mjs +2 -3
- package/dist/cli/commands/introspect.d.mts +2 -3
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-Cu7Mx7_U.mjs → constants-B2QHb6u6.mjs} +1 -1
- package/dist/context/index.d.mts +9 -9
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +8 -8
- package/dist/{core-Cb0LjccA.mjs → core-COcqo0Cp.mjs} +13 -4
- package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-zG13rpPJ.mjs} +18 -8
- package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-CWRz96Vr.mjs} +7 -7
- package/dist/{createApp-D-953ZAq.mjs → createApp-BGLYtErt.mjs} +34 -32
- package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
- package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation--3xguLkk.mjs} +1 -1
- package/dist/{defineResource-DIC7JZGU.mjs → defineResource-gUp9ug66.mjs} +7 -7
- package/dist/discovery/index.d.mts +6 -7
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +3 -3
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-DG8SrLN-.mjs → elevation-BG4gnMsJ.mjs} +5 -5
- package/dist/encryption/index.d.mts +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-COHw3N1b.mjs} +3 -3
- package/dist/{errors-CtrywMHP.mjs → errors-CW4anJBy.mjs} +1 -1
- package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-BweHAVws.mjs} +8 -8
- package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-N4-omQFR.mjs} +2 -2
- package/dist/events/index.d.mts +14 -14
- package/dist/events/index.mjs +7 -7
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.d.mts +4 -5
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +16 -16
- package/dist/factory/index.mjs +6 -6
- package/dist/{fastify-augmentation-DhUJ-mvo.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +2 -2
- package/dist/{fields-ToPYpMqS.mjs → fields-A5crhsJb.mjs} +1 -1
- package/dist/{filter-merge-IpGywvym.mjs → filter-merge-DGM-GQ1J.mjs} +1 -1
- package/dist/{generate-DRTkLlIl.mjs → generate-BXKo2Gc8.mjs} +2 -2
- package/dist/{headers-BbkIF6vA.mjs → headers-DKZQKL-Z.mjs} +2 -2
- package/dist/{health-D-Ft6JM6.mjs → health-BYAwA6YS.mjs} +1 -1
- package/dist/{health-DqbsG-_w.mjs → health-CrqUp3sz.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -3
- package/dist/idempotency/index.d.mts +8 -6
- package/dist/idempotency/index.mjs +108 -46
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +30 -2
- package/dist/{index-CRoPtISf.d.mts → index-Beg3aNnK.d.mts} +3 -31
- package/dist/{index-C8zVGYsk.d.mts → index-BkV55WlV.d.mts} +3 -3
- package/dist/{index-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
- package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/{init-B_oUYDXI.mjs → init-BPzK5Lnr.mjs} +1 -1
- package/dist/integrations/event-gateway.d.mts +3 -4
- 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 +36 -36
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +8 -9
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.d.mts +12 -13
- package/dist/integrations/streamline.mjs +18 -4
- package/dist/integrations/webhooks.d.mts +23 -23
- package/dist/integrations/webhooks.mjs +3 -3
- package/dist/integrations/websocket-pushref-redis.d.mts +4 -5
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.d.mts +4 -5
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/{interface-C0395yUN.d.mts → interface-JJzwH4Ro.d.mts} +22 -2
- package/dist/{jsonBody-B4YVGcql.mjs → jsonBody-YIq-vGLv.mjs} +2 -2
- package/dist/{keys-B2KtgMLJ.mjs → keys-CpoiZ8hU.mjs} +1 -1
- package/dist/{loadResources-Dn4lalw2.mjs → loadResources-6jO52-RR.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-MP8xEppu.mjs} +2 -2
- package/dist/logger/index.d.mts +9 -10
- package/dist/logger/index.mjs +2 -3
- package/dist/{logger-DXjfIqjV.mjs → logger-D4V1zGLI.mjs} +1 -1
- package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-srPc7ItN.mjs} +42 -29
- package/dist/{memory-9Cp7611C.mjs → memory-CTa5pOCW.mjs} +3 -3
- package/dist/{metrics-CWI11eRu.mjs → metrics-DsZrvnpB.mjs} +3 -3
- package/dist/middleware/index.d.mts +5 -5
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.d.mts +13 -13
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-BSvOQC7E.mjs → module--L0iBIZz.mjs} +1 -1
- package/dist/mongodb-memory-server-CHhYSq5y.mjs +35539 -0
- package/dist/mongoose-CYJCLyi-.mjs +67451 -0
- package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
- package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-Cc7eZ9cq.mjs} +1 -1
- package/dist/node-D8UZv_8c.mjs +41236 -0
- package/dist/{openapi-DT_G4VhY.mjs → openapi-CMegfsm8.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +5 -5
- package/dist/{outbox-module-Bjgzl6tg.mjs → outbox-module-Ryk270jd.mjs} +9 -9
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-Cm0uYHvd.mjs → permissions-C5ijIz5Q.mjs} +9 -9
- package/dist/{pipe-BqeGT6UO.mjs → pipe-D81zMtWs.mjs} +2 -2
- package/dist/pipeline/index.d.mts +7 -7
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-FVR6LP59.mjs → plan-CJGMKoui.mjs} +1 -1
- package/dist/{plugin-BccET1tL.mjs → plugin-DALd9dcF.mjs} +39 -27
- package/dist/plugins/index.d.mts +7 -7
- package/dist/plugins/index.mjs +17 -17
- package/dist/plugins/response-cache.d.mts +5 -6
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-CVIOcgMF.mjs → pluralize-COUNYo3d.mjs} +1 -1
- package/dist/presets/filesUpload.d.mts +7 -7
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +14 -14
- 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 +8 -9
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-Cpvj6fGO.mjs → presets-CONf2Qem.mjs} +4 -4
- package/dist/{projection-Ce4aQhQk.mjs → projection-wFoLqdss.mjs} +2 -2
- package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-BATECpyh.mjs} +6 -6
- package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-DVEZ_UpV.mjs} +1 -1
- package/dist/{realtime-DmPE9S54.mjs → realtime-xyubMKSB.mjs} +11 -11
- package/dist/{redis-vLvtcGy_.d.mts → redis-BDgv9Glw.d.mts} +5 -1
- package/dist/registry/index.d.mts +9 -9
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-Bcz9G1bh.mjs → registry-Bdzg-hdm.mjs} +5 -4
- package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-BFJxGPuh.mjs} +1 -1
- package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-Bnc6lJyy.mjs} +2 -2
- package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-C10UeFe5.mjs} +1 -1
- package/dist/{requirement-KDdoRcOP.mjs → requirement-Bu50QALH.mjs} +1 -1
- package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-urWPJxrt.mjs} +2 -2
- package/dist/rolldown-runtime-MYrLNGnq.mjs +45 -0
- package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-DHtpzrzk.mjs} +1 -1
- package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-DIMKMV2G.mjs} +1 -1
- package/dist/{schedules-C-OpmHBq.mjs → schedules-CKTs5ys8.mjs} +5 -5
- package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-BVjkQ5DD.mjs} +2 -2
- package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-BA0Hb21Y.mjs} +2 -2
- package/dist/schemas/index.d.mts +10 -10
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.d.mts +13 -13
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +3 -3
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-DQthe88b.mjs → scope-DINaj7Ax.mjs} +4 -4
- package/dist/{shutdown-MqA81z_P.mjs → shutdown-LpLMH8T1.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-DbwIM1f1.mjs} +1 -1
- package/dist/{sse-CYzQBVFe.mjs → sse-BzJFPX_1.mjs} +7 -7
- package/dist/{sseStream-B5_Afiqn.mjs → sseStream-DQChzGTs.mjs} +2 -2
- package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Coj9RhOZ.mjs} +1 -1
- package/dist/{streaming-DjTQhZrN.mjs → streaming-JzB5CAga.mjs} +1 -1
- package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-DeyppIif.mjs} +1 -1
- package/dist/{tenancy--ed9eH_z.mjs → tenancy-DxV8OuX2.mjs} +2 -2
- package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-CBvvAcAj.mjs} +4 -4
- package/dist/testing/cleanupStoreContract.d.mts +4 -5
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +35 -35
- package/dist/testing/index.mjs +16 -15
- package/dist/testing/outboxStoreContract.d.mts +4 -5
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.d.mts +4 -5
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.d.mts +4 -5
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-qczZ0YC-.mjs → timing-CntavTlR.mjs} +1 -1
- package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-orvnGu4F.mjs} +1 -1
- package/dist/{typeGuards-CySF12G-.mjs → typeGuards-kEaP_WmO.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-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
- package/dist/{types-Bk9NOgOC.mjs → types-fvO6Ovzx.mjs} +4 -4
- package/dist/usage/index.d.mts +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-aklawRaK.mjs → userHelpers-C76zD5pa.mjs} +1 -1
- package/dist/utils/index.d.mts +47 -47
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-ec1oTo1n.mjs → utils-BpkVZ8rB.mjs} +4 -4
- package/dist/{validate-9yzHC1e2.mjs → validate-CWp-lsrm.mjs} +3 -3
- package/dist/{versioning-fhhWHV74.mjs → versioning-CHhL9P3o.mjs} +3 -3
- package/dist/{workScope-zpPyge4t.mjs → workScope-n9a7d_lZ.mjs} +2 -2
- package/package.json +45 -51
- package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-CJGMKoui.mjs";
|
|
3
3
|
//#region src/testing/requiredPorts.ts
|
|
4
4
|
/**
|
|
5
5
|
* Assert a module declares EXACTLY `ports` as required, and that composing it without any one of
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as Storage } from "../storage-Cx9Sz3Ou.mjs";
|
|
3
3
|
//#region src/testing/storageContract.d.ts
|
|
4
|
-
interface StorageContractSetupResult {
|
|
4
|
+
export interface StorageContractSetupResult {
|
|
5
5
|
storage: Storage;
|
|
6
6
|
teardown: () => Promise<void>;
|
|
7
7
|
}
|
|
8
|
-
type StorageContractSetup = () => Promise<StorageContractSetupResult>;
|
|
8
|
+
export type StorageContractSetup = () => Promise<StorageContractSetupResult>;
|
|
9
9
|
/**
|
|
10
10
|
* Register the storage contract suite under the caller's name.
|
|
11
11
|
*
|
|
@@ -21,6 +21,5 @@ type StorageContractSetup = () => Promise<StorageContractSetupResult>;
|
|
|
21
21
|
* 9. Both `kind: "stream"` and `kind: "buffer"` read results deliver correct bytes
|
|
22
22
|
* 10. Ranged reads (if adapter supports them) slice correctly
|
|
23
23
|
*/
|
|
24
|
-
declare function runStorageContract(name: string, setup: StorageContractSetup): void;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { StorageContractSetup, StorageContractSetupResult, runStorageContract };
|
|
24
|
+
export declare function runStorageContract(name: string, setup: StorageContractSetup): void;
|
|
25
|
+
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region src/utils/operationIdentity.ts
|
|
4
4
|
/** Security context included in idempotency identities across transports. */
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { a as UserLike, c as DataPolicy, d as UserBase, i as ObjectId, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "../base-CZyixEQR.mjs";
|
|
4
|
-
import { $ as ResourceHookContext, A as RequestWithExtras,
|
|
4
|
+
import { $ as ResourceHookContext, A as RequestWithExtras, At as AuthHelpers, B as OnTenantDeleteConfig, Bn as IController, C as RequestIdOptions, Ct as ActionEntry, D as FastifyWithAuth, Dt as RouteMcpConfig, E as FastifyRequestExtras, En as BaseControllerOptions, Et as RouteDefinition, Fn as WriteContext, Ft as TokenPair, G as CrudRouteKey, H as PresetFunction, Hn as IRequestContext, I as CrudController, In as WriteVerbKey, J as MiddlewareConfig, K as CrudSchemas, L as ResourceConfig, Ln as ControllerHandler, Mt as Authenticator, Nn as MutationWriteContext, Nt as AuthenticatorContext, O as FastifyWithDecorators, Ot as RouteMethod, Pn as ResourceWrites, Pt as JwtContext, Q as FieldRule, R as ResourceIdempotencyConfig, Rn as ControllerLike, S as IntrospectionPluginOptions, St as ActionDefinition, T as EventsDecorator, Tt as ActionsMap, U as PresetHook, Un as RawRouteHandler, V as ResolvedTenantPurge, Vn as IControllerResponse, W as PresetResult, Wn as RouteHandler, X as RouteSchemaOptions, Y as OpenApiSchemas, Z as ArcFieldRule, _ as ServiceContext, a as IntrospectionData, b as HealthCheck, c as ResourceMetadata, d as LookupOption, et as ResourceHooks, f as OwnershipCheck, g as RequestContext, h as QueryParserInterface, i as PaginationResult, jt as AuthPluginOptions, k as MiddlewareHandler, kt as RateLimitConfig, l as ArcInternalMetadata, m as PopulateOption, n as InferDocType, nt as EventDefinition, o as RegistryEntry, p as ParsedQuery, q as LookupPolicy, r as InferResourceDoc, s as RegistryStats, t as InferAdapterDoc, tt as ResourceExtensions, u as ControllerQueryOptions, v as CrudRouterOptions, w as ArcDecorator, wt as ActionHandlerFn, x as HealthOptions, xt as ResourceCacheConfig, y as GracefulShutdownOptions, z as ResourcePermissions, zn as FastifyHandler } from "../index-WH7xgvxS.mjs";
|
|
5
5
|
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BW2J3tNj.mjs";
|
|
6
6
|
export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ControllerHandler, ControllerLike, ControllerQueryOptions, CrudController, CrudRouteKey, CrudRouterOptions, CrudSchemas, DataPolicy, ElevationEvent, ElevationOptions, EventDefinition, EventsDecorator, FastifyHandler, FastifyRequestExtras, FastifyWithAuth, FastifyWithDecorators, FieldRule, GracefulShutdownOptions, HealthCheck, HealthOptions, IController, IControllerResponse, IRequestContext, InferAdapterDoc, InferDocType, InferResourceDoc, IntrospectionData, IntrospectionPluginOptions, JWTPayload, JwtContext, LookupOption, LookupPolicy, MiddlewareConfig, MiddlewareHandler, MutationWriteContext, ObjectId, OnTenantDeleteConfig, OpenApiSchemas, OwnershipCheck, PaginationResult, ParsedQuery, PermissionCheck, PermissionContext, PopulateOption, PresetFunction, PresetHook, PresetResult, QueryParserInterface, RateLimitConfig, RawRouteHandler, RegistryEntry, RegistryStats, RequestContext, RequestIdOptions, RequestScope, RequestWithExtras, ResolvedTenantPurge, ResourceCacheConfig, ResourceConfig, ResourceExtensions, ResourceHookContext, ResourceHooks, ResourceIdempotencyConfig, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, UserBase, UserLike, UserOrganization, WriteContext, WriteVerbKey };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
package/dist/types/storage.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { F as ResourceDefinition } from "./index-
|
|
2
|
+
import { F as ResourceDefinition } from "./index-WH7xgvxS.mjs";
|
|
3
3
|
import { i as ResourceRateLimiter } from "./resourceRateLimit-Wf6d6FL9.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/integrations/mcp/types.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-
|
|
3
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
4
|
-
import { t as getUserId$1 } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-CW4anJBy.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-DKZQKL-Z.mjs";
|
|
4
|
+
import { t as getUserId$1 } from "./userHelpers-C76zD5pa.mjs";
|
|
5
5
|
//#region src/scope/types.ts
|
|
6
6
|
/**
|
|
7
7
|
* Request Scope — The One Standard
|
package/dist/usage/index.d.mts
CHANGED
|
@@ -28,10 +28,10 @@ interface QuotaOptions {
|
|
|
28
28
|
/** Memoize summary reads per (actor, kind) for this many ms. Default 0. */
|
|
29
29
|
cacheTtlMs?: number;
|
|
30
30
|
}
|
|
31
|
-
declare function requireQuota(options: QuotaOptions): PermissionCheck;
|
|
31
|
+
export declare function requireQuota(options: QuotaOptions): PermissionCheck;
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/usage/stores/memory.d.ts
|
|
34
|
-
declare class MemoryUsageStore implements UsageStore {
|
|
34
|
+
export declare class MemoryUsageStore implements UsageStore {
|
|
35
35
|
#private;
|
|
36
36
|
readonly name = "memory";
|
|
37
37
|
increment(bucket: UsageBucket, amount: number): void;
|
|
@@ -88,7 +88,7 @@ interface RedisUsageStoreOptions {
|
|
|
88
88
|
retentionSeconds?: number;
|
|
89
89
|
}
|
|
90
90
|
/** Period-bucketed usage counters in Redis hashes. See the module header. */
|
|
91
|
-
declare class RedisUsageStore implements UsageStore {
|
|
91
|
+
export declare class RedisUsageStore implements UsageStore {
|
|
92
92
|
#private;
|
|
93
93
|
readonly name = "redis";
|
|
94
94
|
constructor(options: RedisUsageStoreOptions);
|
|
@@ -146,4 +146,4 @@ declare module "fastify" {
|
|
|
146
146
|
}
|
|
147
147
|
declare const _default: FastifyPluginAsync<UsagePluginOptions>;
|
|
148
148
|
//#endregion
|
|
149
|
-
export {
|
|
149
|
+
export { type QuotaOptions, type RedisUsageStoreOptions, type UsageBucket, type UsageMeter, type UsagePluginOptions, type UsageRedisLike, type UsageStore, type UsageTrackOptions, _default as default, _default as usagePlugin, usagePeriod };
|
package/dist/usage/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as ArcError } from "../errors-
|
|
3
|
-
import { c as getOrgId, g as getUserId, i as getClientId } from "../types-
|
|
4
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as ArcError } from "../errors-CW4anJBy.mjs";
|
|
3
|
+
import { c as getOrgId, g as getUserId, i as getClientId } from "../types-fvO6Ovzx.mjs";
|
|
4
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DIMKMV2G.mjs";
|
|
5
5
|
import { usagePeriod } from "@classytic/repo-core/usage";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
7
7
|
//#region src/usage/requireQuota.ts
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-CZyixEQR.mjs";
|
|
4
|
-
import { Y as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-
|
|
4
|
+
import { Y as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-WH7xgvxS.mjs";
|
|
5
5
|
import { n as ErrorMapper } from "../errorHandler--4rSMMvq.mjs";
|
|
6
6
|
import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-JYc9vwqE.mjs";
|
|
7
7
|
import { errorContractSchema } from "@classytic/repo-core/errors";
|
|
8
8
|
import { FilterClause } from "@classytic/repo-core/query-parser";
|
|
9
9
|
import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
|
|
10
10
|
//#region src/utils/circuitBreaker.d.ts
|
|
11
|
-
declare const CircuitState: {
|
|
11
|
+
export declare const CircuitState: {
|
|
12
12
|
readonly CLOSED: "CLOSED";
|
|
13
13
|
readonly OPEN: "OPEN";
|
|
14
14
|
readonly HALF_OPEN: "HALF_OPEN";
|
|
15
15
|
};
|
|
16
|
-
type CircuitState = (typeof CircuitState)[keyof typeof CircuitState];
|
|
16
|
+
export type CircuitState = (typeof CircuitState)[keyof typeof CircuitState];
|
|
17
17
|
/**
|
|
18
18
|
* Generic constraint for "any async function" that survives strict TS.
|
|
19
19
|
*
|
|
@@ -174,13 +174,13 @@ interface CircuitBreakerStats {
|
|
|
174
174
|
* error handler sends it as `Retry-After`, so well-behaved clients back off
|
|
175
175
|
* for as long as the breaker is actually going to refuse them.
|
|
176
176
|
*/
|
|
177
|
-
declare class CircuitBreakerError extends ArcError {
|
|
177
|
+
export declare class CircuitBreakerError extends ArcError {
|
|
178
178
|
readonly state: CircuitState;
|
|
179
179
|
/** Seconds until the circuit next probes, when known. */
|
|
180
180
|
readonly retryAfter?: number;
|
|
181
181
|
constructor(message: string, state: CircuitState, retryAfter?: number);
|
|
182
182
|
}
|
|
183
|
-
declare class CircuitBreaker<T extends AnyAsyncFn> {
|
|
183
|
+
export declare class CircuitBreaker<T extends AnyAsyncFn> {
|
|
184
184
|
private state;
|
|
185
185
|
private failures;
|
|
186
186
|
private successes;
|
|
@@ -267,11 +267,11 @@ declare class CircuitBreaker<T extends AnyAsyncFn> {
|
|
|
267
267
|
* { name: 'email-service' }
|
|
268
268
|
* );
|
|
269
269
|
*/
|
|
270
|
-
declare function createCircuitBreaker<T extends AnyAsyncFn>(fn: T, options?: CircuitBreakerOptions): CircuitBreaker<T>;
|
|
270
|
+
export declare function createCircuitBreaker<T extends AnyAsyncFn>(fn: T, options?: CircuitBreakerOptions): CircuitBreaker<T>;
|
|
271
271
|
/**
|
|
272
272
|
* Circuit breaker registry for managing multiple breakers
|
|
273
273
|
*/
|
|
274
|
-
declare class CircuitBreakerRegistry {
|
|
274
|
+
export declare class CircuitBreakerRegistry {
|
|
275
275
|
private breakers;
|
|
276
276
|
/**
|
|
277
277
|
* Register a circuit breaker
|
|
@@ -306,7 +306,7 @@ declare class CircuitBreakerRegistry {
|
|
|
306
306
|
* Create a new CircuitBreakerRegistry instance.
|
|
307
307
|
* Use this instead of a global singleton — attach to fastify.arc or pass explicitly.
|
|
308
308
|
*/
|
|
309
|
-
declare function createCircuitBreakerRegistry(): CircuitBreakerRegistry;
|
|
309
|
+
export declare function createCircuitBreakerRegistry(): CircuitBreakerRegistry;
|
|
310
310
|
//#endregion
|
|
311
311
|
//#region src/utils/circuitBreakerRedis.d.ts
|
|
312
312
|
/**
|
|
@@ -336,7 +336,7 @@ interface RedisCircuitBreakerStateOptions {
|
|
|
336
336
|
windowMs?: number;
|
|
337
337
|
}
|
|
338
338
|
/** Fixed-window cluster failure counter. See the module header. */
|
|
339
|
-
declare class RedisCircuitBreakerState implements CircuitBreakerSharedState {
|
|
339
|
+
export declare class RedisCircuitBreakerState implements CircuitBreakerSharedState {
|
|
340
340
|
#private;
|
|
341
341
|
readonly name = "redis";
|
|
342
342
|
constructor(options: RedisCircuitBreakerStateOptions);
|
|
@@ -446,12 +446,12 @@ type CompensationResult = {
|
|
|
446
446
|
*
|
|
447
447
|
* @typeParam TCtx - Context type shared across steps (defaults to Record<string, unknown>)
|
|
448
448
|
*/
|
|
449
|
-
declare function withCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(_name: string, steps: readonly CompensationStep<TCtx>[], initialContext?: TCtx, hooks?: CompensationHooks): Promise<CompensationResult>;
|
|
449
|
+
export declare function withCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(_name: string, steps: readonly CompensationStep<TCtx>[], initialContext?: TCtx, hooks?: CompensationHooks): Promise<CompensationResult>;
|
|
450
450
|
interface CompensationDefinition<TCtx extends Record<string, unknown> = Record<string, unknown>> {
|
|
451
451
|
readonly name: string;
|
|
452
452
|
readonly execute: (initialContext?: TCtx, hooks?: CompensationHooks) => Promise<CompensationResult>;
|
|
453
453
|
}
|
|
454
|
-
declare function defineCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(name: string, steps: readonly CompensationStep<TCtx>[]): CompensationDefinition<TCtx>;
|
|
454
|
+
export declare function defineCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(name: string, steps: readonly CompensationStep<TCtx>[]): CompensationDefinition<TCtx>;
|
|
455
455
|
//#endregion
|
|
456
456
|
//#region src/utils/defineErrorMapper.d.ts
|
|
457
457
|
/**
|
|
@@ -467,7 +467,7 @@ declare function defineCompensation<TCtx extends Record<string, unknown> = Recor
|
|
|
467
467
|
* called with a non-`T` error at runtime. This helper codifies that invariant
|
|
468
468
|
* in one place.
|
|
469
469
|
*/
|
|
470
|
-
declare function defineErrorMapper<T extends Error>(mapper: ErrorMapper<T>): ErrorMapper;
|
|
470
|
+
export declare function defineErrorMapper<T extends Error>(mapper: ErrorMapper<T>): ErrorMapper;
|
|
471
471
|
//#endregion
|
|
472
472
|
//#region src/utils/defineGuard.d.ts
|
|
473
473
|
interface GuardConfig<T> {
|
|
@@ -494,7 +494,7 @@ interface Guard<T> {
|
|
|
494
494
|
/**
|
|
495
495
|
* Create a typed guard. See module JSDoc for usage.
|
|
496
496
|
*/
|
|
497
|
-
declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
|
|
497
|
+
export declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region src/utils/filter-dialect.d.ts
|
|
500
500
|
interface FilterDialect {
|
|
@@ -503,12 +503,12 @@ interface FilterDialect {
|
|
|
503
503
|
/** The operator tokens this dialect can emit — for audits and docs. */
|
|
504
504
|
readonly tokens: readonly string[];
|
|
505
505
|
}
|
|
506
|
-
declare const MONGO_DIALECT: FilterDialect;
|
|
506
|
+
export declare const MONGO_DIALECT: FilterDialect;
|
|
507
507
|
/**
|
|
508
508
|
* Store-neutral: `{ field: { <op>: value } }` with the grammar's own operator names, for a host
|
|
509
509
|
* that compiles the canonical clauses itself.
|
|
510
510
|
*/
|
|
511
|
-
declare const NEUTRAL_DIALECT: FilterDialect;
|
|
511
|
+
export declare const NEUTRAL_DIALECT: FilterDialect;
|
|
512
512
|
//#endregion
|
|
513
513
|
//#region src/utils/handleRaw.d.ts
|
|
514
514
|
/**
|
|
@@ -521,7 +521,7 @@ declare const NEUTRAL_DIALECT: FilterDialect;
|
|
|
521
521
|
* @returns The reply, so Fastify waits for it: resolving `undefined` after `reply.send()` while an
|
|
522
522
|
* async `preSerialization` hook (idempotency, encryption) is pending re-sends an empty body.
|
|
523
523
|
*/
|
|
524
|
-
declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<FastifyReply>;
|
|
524
|
+
export declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<FastifyReply>;
|
|
525
525
|
//#endregion
|
|
526
526
|
//#region src/utils/queryParser.d.ts
|
|
527
527
|
interface ArcQueryParserOptions {
|
|
@@ -555,7 +555,7 @@ interface ArcQueryParserOptions {
|
|
|
555
555
|
* avoids collisions with reserved keys (`page`, `sort`, ...)
|
|
556
556
|
* - Search `?search=`, populate `?populate=a,b`, select `?select=a,-b`
|
|
557
557
|
*/
|
|
558
|
-
declare class ArcQueryParser implements QueryParserInterface {
|
|
558
|
+
export declare class ArcQueryParser implements QueryParserInterface {
|
|
559
559
|
/**
|
|
560
560
|
* Public so `QueryResolver` reuses this cap instead of stacking its own
|
|
561
561
|
* (independent caps silently truncate to the lowest).
|
|
@@ -597,7 +597,7 @@ declare class ArcQueryParser implements QueryParserInterface {
|
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
599
|
/** Create a new ArcQueryParser instance. */
|
|
600
|
-
declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
|
|
600
|
+
export declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
|
|
601
601
|
//#endregion
|
|
602
602
|
//#region src/utils/responseSchemas.d.ts
|
|
603
603
|
interface JsonSchema {
|
|
@@ -624,7 +624,7 @@ interface JsonSchema {
|
|
|
624
624
|
* Runtime format (flat fields):
|
|
625
625
|
* { page, limit, total, pages, hasNext, hasPrev }
|
|
626
626
|
*/
|
|
627
|
-
declare const paginationSchema: JsonSchema;
|
|
627
|
+
export declare const paginationSchema: JsonSchema;
|
|
628
628
|
/**
|
|
629
629
|
* List response schema — accepts every wire shape `toCanonicalList` can
|
|
630
630
|
* emit. Hosts who know their endpoint only ever produces one variant can
|
|
@@ -646,18 +646,18 @@ declare const paginationSchema: JsonSchema;
|
|
|
646
646
|
* per-response branch validation. The list route also serves count, exists
|
|
647
647
|
* and distinct dispatch verbs, so no field is common to every valid shape.
|
|
648
648
|
*/
|
|
649
|
-
declare function listResponse(itemSchema: JsonSchema): JsonSchema;
|
|
649
|
+
export declare function listResponse(itemSchema: JsonSchema): JsonSchema;
|
|
650
650
|
/** Offset variant — `{ method: 'offset', data, page, limit, total, pages, hasNext, hasPrev }`. */
|
|
651
|
-
declare function offsetListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
651
|
+
export declare function offsetListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
652
652
|
/** Keyset variant — `{ method: 'keyset', data, limit, hasMore, next: string | null }`. */
|
|
653
|
-
declare function keysetListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
653
|
+
export declare function keysetListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
654
654
|
/** Aggregate variant — same shape as offset, discriminated by `method: 'aggregate'`. */
|
|
655
|
-
declare function aggregateListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
655
|
+
export declare function aggregateListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
656
656
|
/** Bare variant — `{ data }`, no `method` discriminant. */
|
|
657
|
-
declare function bareListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
657
|
+
export declare function bareListResponse(itemSchema: JsonSchema): JsonSchema;
|
|
658
658
|
/** Delete response — flat shape mirroring the canonical delete envelope. */
|
|
659
|
-
declare function deleteResponse(): JsonSchema;
|
|
660
|
-
declare const responses: {
|
|
659
|
+
export declare function deleteResponse(): JsonSchema;
|
|
660
|
+
export declare const responses: {
|
|
661
661
|
200: (schema: JsonSchema) => {
|
|
662
662
|
description: string;
|
|
663
663
|
content: {
|
|
@@ -1033,7 +1033,7 @@ declare const responses: {
|
|
|
1033
1033
|
};
|
|
1034
1034
|
};
|
|
1035
1035
|
};
|
|
1036
|
-
declare const queryParams: {
|
|
1036
|
+
export declare const queryParams: {
|
|
1037
1037
|
pagination: {
|
|
1038
1038
|
page: {
|
|
1039
1039
|
type: string;
|
|
@@ -1070,7 +1070,7 @@ declare const queryParams: {
|
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Get standard list query parameters schema
|
|
1072
1072
|
*/
|
|
1073
|
-
declare function getListQueryParams(): AnyRecord;
|
|
1073
|
+
export declare function getListQueryParams(): AnyRecord;
|
|
1074
1074
|
/**
|
|
1075
1075
|
* Get default response schemas for all CRUD operations.
|
|
1076
1076
|
*
|
|
@@ -1082,7 +1082,7 @@ declare function getListQueryParams(): AnyRecord;
|
|
|
1082
1082
|
* Note: `example` properties are stripped from defaults so they work with
|
|
1083
1083
|
* any Fastify instance (not just createApp which adds `keywords: ['example']`).
|
|
1084
1084
|
*/
|
|
1085
|
-
declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
|
|
1085
|
+
export declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
|
|
1086
1086
|
//#endregion
|
|
1087
1087
|
//#region src/utils/runtimeCapabilities.d.ts
|
|
1088
1088
|
/** What a subsystem declares about the state it holds. */
|
|
@@ -1106,7 +1106,7 @@ interface RuntimeCapabilityDeclaration {
|
|
|
1106
1106
|
* and encapsulated children of any of them — which is the point: the audit
|
|
1107
1107
|
* sees what the constructor-time guard cannot.
|
|
1108
1108
|
*/
|
|
1109
|
-
declare function declareRuntimeCapability(fastify: FastifyInstance, decl: RuntimeCapabilityDeclaration): void;
|
|
1109
|
+
export declare function declareRuntimeCapability(fastify: FastifyInstance, decl: RuntimeCapabilityDeclaration): void;
|
|
1110
1110
|
//#endregion
|
|
1111
1111
|
//#region src/utils/schemaConverter.d.ts
|
|
1112
1112
|
/**
|
|
@@ -1127,11 +1127,11 @@ type SchemaIo = "input" | "output";
|
|
|
1127
1127
|
* Returns true if it has JSON Schema markers (`type`, `properties`, `$ref`,
|
|
1128
1128
|
* `allOf`, `anyOf`, `oneOf`, `items`, `enum`) and does NOT have Zod markers.
|
|
1129
1129
|
*/
|
|
1130
|
-
declare function isJsonSchema(input: unknown): input is Record<string, unknown>;
|
|
1130
|
+
export declare function isJsonSchema(input: unknown): input is Record<string, unknown>;
|
|
1131
1131
|
/**
|
|
1132
1132
|
* Check if an object is a Zod schema (has `_zod` marker from Zod v4).
|
|
1133
1133
|
*/
|
|
1134
|
-
declare function isZodSchema(input: unknown): boolean;
|
|
1134
|
+
export declare function isZodSchema(input: unknown): boolean;
|
|
1135
1135
|
/**
|
|
1136
1136
|
* How `toJsonSchema` reacts when a Zod schema CANNOT be converted (zod not
|
|
1137
1137
|
* installed/loaded, zod v3, or `z.toJSONSchema()` threw):
|
|
@@ -1165,7 +1165,7 @@ type UnconvertibleMode = "warn" | "throw";
|
|
|
1165
1165
|
* docblock. Defaults to `'output'`, matching Zod's own default;
|
|
1166
1166
|
* arc's request-side call sites pass `'input'` explicitly.
|
|
1167
1167
|
*/
|
|
1168
|
-
declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?: UnconvertibleMode, io?: SchemaIo): Record<string, unknown> | undefined;
|
|
1168
|
+
export declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?: UnconvertibleMode, io?: SchemaIo): Record<string, unknown> | undefined;
|
|
1169
1169
|
/**
|
|
1170
1170
|
* Convert all schema fields in an OpenApiSchemas object.
|
|
1171
1171
|
* JSON Schema values pass through unchanged. Only Zod schemas are converted.
|
|
@@ -1173,7 +1173,7 @@ declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?:
|
|
|
1173
1173
|
* Defaults to the `openapi-3.0` target since this function feeds OpenAPI doc
|
|
1174
1174
|
* generation, not Fastify route validation.
|
|
1175
1175
|
*/
|
|
1176
|
-
declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSchemaTarget): OpenApiSchemas;
|
|
1176
|
+
export declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSchemaTarget): OpenApiSchemas;
|
|
1177
1177
|
/**
|
|
1178
1178
|
* Convert schema values in a Fastify route schema record.
|
|
1179
1179
|
*
|
|
@@ -1187,7 +1187,7 @@ declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSch
|
|
|
1187
1187
|
* Defaults to `draft-7` so Fastify v5's bundled AJV 8 accepts the output.
|
|
1188
1188
|
* Pass `openapi-3.0` (or `openapi-3.1`) when generating OpenAPI documents.
|
|
1189
1189
|
*/
|
|
1190
|
-
declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
|
|
1190
|
+
export declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
|
|
1191
1191
|
//#endregion
|
|
1192
1192
|
//#region src/utils/shutdown.d.ts
|
|
1193
1193
|
interface ShutdownParticipant {
|
|
@@ -1197,9 +1197,9 @@ interface ShutdownParticipant {
|
|
|
1197
1197
|
drain?(): void | Promise<void>;
|
|
1198
1198
|
}
|
|
1199
1199
|
/** Descendants of admitted work may finish their causal publications during shutdown. */
|
|
1200
|
-
declare function runAdmittedWork<T>(work: () => T | Promise<T>): Promise<T>;
|
|
1200
|
+
export declare function runAdmittedWork<T>(work: () => T | Promise<T>): Promise<T>;
|
|
1201
1201
|
/** A participant's stop must prevent new work; drain waits for work already admitted. */
|
|
1202
|
-
declare function registerShutdownParticipant(fastify: FastifyInstance, participant: ShutdownParticipant): void;
|
|
1202
|
+
export declare function registerShutdownParticipant(fastify: FastifyInstance, participant: ShutdownParticipant): void;
|
|
1203
1203
|
//#endregion
|
|
1204
1204
|
//#region src/utils/simpleEqualityMatcher.d.ts
|
|
1205
1205
|
/**
|
|
@@ -1226,7 +1226,7 @@ declare function registerShutdownParticipant(fastify: FastifyInstance, participa
|
|
|
1226
1226
|
* matchesFilter: simpleEqualityMatcher };
|
|
1227
1227
|
* ```
|
|
1228
1228
|
*/
|
|
1229
|
-
declare function simpleEqualityMatcher(item: unknown, filters: Record<string, unknown>): boolean;
|
|
1229
|
+
export declare function simpleEqualityMatcher(item: unknown, filters: Record<string, unknown>): boolean;
|
|
1230
1230
|
//#endregion
|
|
1231
1231
|
//#region src/utils/sseStream.d.ts
|
|
1232
1232
|
interface SseStreamOptions {
|
|
@@ -1258,7 +1258,7 @@ interface SseStream {
|
|
|
1258
1258
|
* gate (auth, permissions, validation) has passed — after `hijack()` no
|
|
1259
1259
|
* JSON error can be sent.
|
|
1260
1260
|
*/
|
|
1261
|
-
declare function openSseStream(request: FastifyRequest, reply: FastifyReply, options?: SseStreamOptions): SseStream;
|
|
1261
|
+
export declare function openSseStream(request: FastifyRequest, reply: FastifyReply, options?: SseStreamOptions): SseStream;
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region src/utils/stateMachine.d.ts
|
|
1264
1264
|
/**
|
|
@@ -1369,7 +1369,7 @@ type TransitionConfig = Record<string, string[] | {
|
|
|
1369
1369
|
* },
|
|
1370
1370
|
* }, { trackHistory: true });
|
|
1371
1371
|
*/
|
|
1372
|
-
declare function createStateMachine(name: string, transitions?: TransitionConfig, options?: {
|
|
1372
|
+
export declare function createStateMachine(name: string, transitions?: TransitionConfig, options?: {
|
|
1373
1373
|
trackHistory?: boolean;
|
|
1374
1374
|
}): StateMachine;
|
|
1375
1375
|
//#endregion
|
|
@@ -1381,7 +1381,7 @@ declare function createStateMachine(name: string, transitions?: TransitionConfig
|
|
|
1381
1381
|
* client uses to detect the v1 UI message stream protocol (vs the older
|
|
1382
1382
|
* data stream protocol). Surfaced as a constant so hosts don't memorise it.
|
|
1383
1383
|
*/
|
|
1384
|
-
declare const UI_MESSAGE_STREAM_HEADERS: {
|
|
1384
|
+
export declare const UI_MESSAGE_STREAM_HEADERS: {
|
|
1385
1385
|
readonly "content-type": "text/event-stream";
|
|
1386
1386
|
readonly "cache-control": "no-cache";
|
|
1387
1387
|
readonly connection: "keep-alive";
|
|
@@ -1438,7 +1438,7 @@ interface PipeUIMessageStreamOptions {
|
|
|
1438
1438
|
* });
|
|
1439
1439
|
* ```
|
|
1440
1440
|
*/
|
|
1441
|
-
declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: ReadableStream<unknown>, options?: PipeUIMessageStreamOptions): Promise<void>;
|
|
1441
|
+
export declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: ReadableStream<unknown>, options?: PipeUIMessageStreamOptions): Promise<void>;
|
|
1442
1442
|
/**
|
|
1443
1443
|
* Promote a stream auth token from the query string into the `Authorization`
|
|
1444
1444
|
* header, in place, so the standard `fastify.authenticate` decorator can read it.
|
|
@@ -1462,7 +1462,7 @@ declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: Readabl
|
|
|
1462
1462
|
*
|
|
1463
1463
|
* @param queryParam name of the query parameter carrying the token (default `token`).
|
|
1464
1464
|
*/
|
|
1465
|
-
declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?: string): void;
|
|
1465
|
+
export declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?: string): void;
|
|
1466
1466
|
/**
|
|
1467
1467
|
* Collect the CORS / `Vary` headers a plugin (e.g. `@fastify/cors`, whose default
|
|
1468
1468
|
* `onRequest` hook runs BEFORE the route handler) has already set on the reply, so
|
|
@@ -1476,7 +1476,7 @@ declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?
|
|
|
1476
1476
|
* honors the host's configured policy (origin allowlist, credentials) rather than
|
|
1477
1477
|
* re-deriving it. Returns lowercased header names suitable for `writeHead`.
|
|
1478
1478
|
*/
|
|
1479
|
-
declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, string>;
|
|
1479
|
+
export declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, string>;
|
|
1480
1480
|
/**
|
|
1481
1481
|
* Heuristic — does this value look like a Web `ReadableStream`?
|
|
1482
1482
|
*
|
|
@@ -1486,7 +1486,7 @@ declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, str
|
|
|
1486
1486
|
* the Streams spec mandates: `getReader`, `cancel`, and the `locked`
|
|
1487
1487
|
* getter.
|
|
1488
1488
|
*/
|
|
1489
|
-
declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
|
|
1489
|
+
export declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
|
|
1490
1490
|
//#endregion
|
|
1491
1491
|
//#region src/utils/typeGuards.d.ts
|
|
1492
1492
|
interface EventsDecorator {
|
|
@@ -1499,8 +1499,8 @@ interface EventsDecorator {
|
|
|
1499
1499
|
transportName: string;
|
|
1500
1500
|
}
|
|
1501
1501
|
/** Check if fastify has the events plugin registered */
|
|
1502
|
-
declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
|
|
1502
|
+
export declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
|
|
1503
1503
|
events: EventsDecorator;
|
|
1504
1504
|
};
|
|
1505
1505
|
//#endregion
|
|
1506
|
-
export { type AnyAsyncFn, ArcError, type ArcHeaders,
|
|
1506
|
+
export { type AnyAsyncFn, ArcError, type ArcHeaders, type ArcQueryParserOptions, type CircuitBreakerOptions, type CircuitBreakerRedisLike, type CircuitBreakerSharedState, type CircuitBreakerStats, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, type RedisCircuitBreakerStateOptions, type RuntimeCapabilityDeclaration, type SchemaIo, ServiceUnavailableError, type ShutdownParticipant, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UnauthorizedError, type UnconvertibleMode, ValidationError, createDomainError, createError, errorContractSchema, getHeader, getUserId, getUserRoles, isArcError, normalizeRoles, requireSingleHeaderValue };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-
|
|
3
|
-
import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-
|
|
4
|
-
import { n as requireSingleHeaderValue, t as getHeader } from "../headers-
|
|
5
|
-
import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-
|
|
6
|
-
import { C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorContractSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreaker, d as CircuitState, f as createCircuitBreaker, g as deleteResponse, h as bareListResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerError, m as aggregateListResponse, n as handleRaw, o as withCompensation, p as createCircuitBreakerRegistry, r as defineGuard, s as RedisCircuitBreakerState, t as createStateMachine, u as CircuitBreakerRegistry, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-
|
|
7
|
-
import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-
|
|
8
|
-
import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-
|
|
9
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
10
|
-
import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-
|
|
11
|
-
import { t as openSseStream } from "../sseStream-
|
|
12
|
-
import { t as hasEvents } from "../typeGuards-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-CW4anJBy.mjs";
|
|
3
|
+
import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-DbwIM1f1.mjs";
|
|
4
|
+
import { n as requireSingleHeaderValue, t as getHeader } from "../headers-DKZQKL-Z.mjs";
|
|
5
|
+
import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-C76zD5pa.mjs";
|
|
6
|
+
import { C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorContractSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreaker, d as CircuitState, f as createCircuitBreaker, g as deleteResponse, h as bareListResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerError, m as aggregateListResponse, n as handleRaw, o as withCompensation, p as createCircuitBreakerRegistry, r as defineGuard, s as RedisCircuitBreakerState, t as createStateMachine, u as CircuitBreakerRegistry, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-BpkVZ8rB.mjs";
|
|
7
|
+
import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-BVjkQ5DD.mjs";
|
|
8
|
+
import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-JzB5CAga.mjs";
|
|
9
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DIMKMV2G.mjs";
|
|
10
|
+
import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-LpLMH8T1.mjs";
|
|
11
|
+
import { t as openSseStream } from "../sseStream-DQChzGTs.mjs";
|
|
12
|
+
import { t as hasEvents } from "../typeGuards-kEaP_WmO.mjs";
|
|
13
13
|
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, RedisCircuitBreakerState, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, registerShutdownParticipant, requireSingleHeaderValue, responses, runAdmittedWork, simpleEqualityMatcher, toJsonSchema, withCompensation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { h as RESERVED_QUERY_PARAMS } from "./constants-
|
|
3
|
-
import { t as arcLog } from "./logger-
|
|
4
|
-
import { t as ArcError, u as ValidationError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { h as RESERVED_QUERY_PARAMS } from "./constants-B2QHb6u6.mjs";
|
|
3
|
+
import { t as arcLog } from "./logger-D4V1zGLI.mjs";
|
|
4
|
+
import { t as ArcError, u as ValidationError } from "./errors-CW4anJBy.mjs";
|
|
5
5
|
import { errorContractSchema as errorContractSchema$1 } from "@classytic/repo-core/errors";
|
|
6
6
|
import { readEnv } from "@classytic/primitives/environment";
|
|
7
7
|
import { OPERATOR_DESCRIPTIONS, URL_OPERATORS, escapeRegex, isQueryGrammarError, readFilterClauses, readPageRequest, readSearch, readSelect, readSort } from "@classytic/repo-core/query-parser";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import { _ as pathTouchesBlocked } from "./plugin-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.mjs";
|
|
3
|
+
import { _ as pathTouchesBlocked } from "./plugin-DALd9dcF.mjs";
|
|
4
4
|
//#region src/core/aggregation/normalize.ts
|
|
5
5
|
/**
|
|
6
6
|
* Framework cap on URL-driven aggregation limits when the host opts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import { d as createDomainError } from "./errors-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as __exportAll } from "./rolldown-runtime-MYrLNGnq.mjs";
|
|
3
|
+
import { d as createDomainError } from "./errors-CW4anJBy.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/versioning.ts
|
|
6
6
|
var versioning_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as requestContext } from "./requestContext-
|
|
1
|
+
/*! @classytic/arc v2.44.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as requestContext } from "./requestContext-C10UeFe5.mjs";
|
|
3
3
|
//#region src/context/workScope.ts
|
|
4
4
|
/** Enter a scope for `fn`, or run it inside the active one. */
|
|
5
5
|
function runWorkScope(seed, fn) {
|