@classytic/arc 2.43.0 → 2.45.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-Ci6hGO1Y.mjs} +2 -2
- package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-CtnnYHME.mjs} +2 -2
- package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-BNoHOx-D.mjs} +2 -2
- package/dist/acquire-BW_2Dt60.mjs +35 -0
- package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-TAc_6LCw.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 +14 -12
- package/dist/auth/redis-session.d.mts +4 -5
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-BixzgirP.mjs} +4 -4
- package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DQfXgxMo.mjs} +1 -1
- package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-mEUmO2_u.mjs} +4 -4
- package/dist/cache/index.d.mts +9 -9
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-Cc2M1DwO.mjs → caching-TQfW2QX7.mjs} +2 -2
- package/dist/{claimed-B10RTfkM.mjs → claimed-CnEEOHuL.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-B90SnSQn.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-DV9PSXtr.mjs} +13 -4
- package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-BgPCYU2U.mjs} +18 -8
- package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-lNCkDwKe.mjs} +7 -7
- package/dist/{createApp-D-953ZAq.mjs → createApp-BSBPntOQ.mjs} +34 -32
- package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
- package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation-CwD8_XNd.mjs} +1 -1
- package/dist/{defineResource-DIC7JZGU.mjs → defineResource-CRkhRRSj.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-BAfsnnO0.mjs} +5 -5
- package/dist/encryption/index.d.mts +5 -5
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-DbHGwrQM.mjs} +3 -3
- package/dist/{errors-CtrywMHP.mjs → errors-C9G4A8cN.mjs} +1 -1
- package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-Dghr7iL5.mjs} +8 -8
- package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-DDy7BMAn.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-Da--1DNS.mjs} +1 -1
- package/dist/{filter-merge-IpGywvym.mjs → filter-merge-BYKBa9b2.mjs} +1 -1
- package/dist/{generate-DRTkLlIl.mjs → generate-Cm5Ct81v.mjs} +2 -2
- package/dist/{headers-BbkIF6vA.mjs → headers-B6DRXXzT.mjs} +2 -2
- package/dist/{health-D-Ft6JM6.mjs → health-hRGgxnOC.mjs} +1 -1
- package/dist/{health-DqbsG-_w.mjs → health-pLbfckGB.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-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
- package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
- package/dist/{index-C8zVGYsk.d.mts → index-uhkUA5-U.d.mts} +4 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/{init-B_oUYDXI.mjs → init-lpaUB-Ph.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-CzKHE-Fg.mjs} +2 -2
- package/dist/{keys-B2KtgMLJ.mjs → keys-BoZKnBel.mjs} +1 -1
- package/dist/{loadResources-Dn4lalw2.mjs → loadResources-BEKG6bP9.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-BEPA0ptL.mjs} +2 -2
- package/dist/logger/index.d.mts +9 -10
- package/dist/logger/index.mjs +2 -3
- package/dist/{logger-DXjfIqjV.mjs → logger-vxu0DXf_.mjs} +1 -1
- package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-DP_UB0LK.mjs} +42 -29
- package/dist/{memory-9Cp7611C.mjs → memory-DJN6kyC8.mjs} +3 -3
- package/dist/{metrics-CWI11eRu.mjs → metrics-wfr7XFE7.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-BtdcGn_E.mjs} +1 -1
- package/dist/mongodb-memory-server-Cn57YIsc.mjs +35539 -0
- package/dist/mongoose-DzFjTtBN.mjs +67451 -0
- package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
- package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-NHGOuUnG.mjs} +1 -1
- package/dist/node-C0HB_V6E.mjs +41236 -0
- package/dist/{openapi-DT_G4VhY.mjs → openapi-BCOaGAgE.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-BVDiMwXb.mjs} +9 -9
- package/dist/permissions/index.mjs +7 -7
- package/dist/{permissions-Cm0uYHvd.mjs → permissions-IdHJ0_5V.mjs} +9 -9
- package/dist/{pipe-BqeGT6UO.mjs → pipe-BPJPifhi.mjs} +2 -2
- package/dist/pipeline/index.d.mts +7 -7
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-FVR6LP59.mjs → plan-CEedaMlr.mjs} +1 -1
- package/dist/{plugin-BccET1tL.mjs → plugin-BDBOS3-c.mjs} +39 -27
- package/dist/plugins/index.d.mts +8 -8
- 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-B4FcZEyI.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-BPjNc-Np.mjs} +4 -4
- package/dist/{projection-Ce4aQhQk.mjs → projection-BXUOYosj.mjs} +2 -2
- package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-s4pBvjFF.mjs} +6 -6
- package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-C4mkCwQ-.mjs} +1 -1
- package/dist/{realtime-DmPE9S54.mjs → realtime-MPj6eIoV.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-DIdh6mWE.mjs} +5 -4
- package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-boGRXWCr.mjs} +1 -1
- package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-BW_p67QD.mjs} +2 -2
- package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-B8JKbeb7.mjs} +1 -1
- package/dist/{requirement-KDdoRcOP.mjs → requirement-tXpcD56f.mjs} +1 -1
- package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-DWob9nQ8.mjs} +2 -2
- package/dist/rolldown-runtime-AD16t29l.mjs +45 -0
- package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-CnmenC4Y.mjs} +1 -1
- package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-C7gAbIxC.mjs} +1 -1
- package/dist/{schedules-C-OpmHBq.mjs → schedules-Dr9gNFzx.mjs} +5 -5
- package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-rzBovk00.mjs} +2 -2
- package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-GrOK1JO4.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-DpOpxyHT.mjs} +4 -4
- package/dist/{shutdown-MqA81z_P.mjs → shutdown-BW8qwgpx.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-WdZw6GOt.mjs} +1 -1
- package/dist/sse-D8AgoUN3.mjs +212 -0
- package/dist/{sseStream-B5_Afiqn.mjs → sseStream-B7rPhIQw.mjs} +2 -2
- package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Bxk7TDgG.mjs} +1 -1
- package/dist/{streaming-DjTQhZrN.mjs → streaming-BLg1buwL.mjs} +1 -1
- package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-Cxp19Ked.mjs} +1 -1
- package/dist/{tenancy--ed9eH_z.mjs → tenancy-D7jo78AP.mjs} +2 -2
- package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-DqJnokDW.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-Y6_ZpoYG.mjs} +1 -1
- package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-BWp0MBGL.mjs} +1 -1
- package/dist/{typeGuards-CySF12G-.mjs → typeGuards-CtZJypJO.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-Bk9NOgOC.mjs → types-4JKkSvds.mjs} +4 -4
- package/dist/{types-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
- package/dist/usage/index.d.mts +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-aklawRaK.mjs → userHelpers-Nc5ePCsf.mjs} +1 -1
- package/dist/utils/index.d.mts +47 -47
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-ec1oTo1n.mjs → utils-QWSIKqAk.mjs} +4 -4
- package/dist/{validate-9yzHC1e2.mjs → validate-CT4umNhp.mjs} +3 -3
- package/dist/{versioning-Bsb51gGT.d.mts → versioning-Bqm_57Qt.d.mts} +23 -1
- package/dist/{versioning-fhhWHV74.mjs → versioning-JIqxO64K.mjs} +3 -3
- package/dist/{workScope-zpPyge4t.mjs → workScope-BDjGXwU9.mjs} +2 -2
- package/package.json +47 -52
- package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
- package/dist/sse-CYzQBVFe.mjs +0 -89
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { l as PermissionCheck, t as AnyRecord } from "../base-CZyixEQR.mjs";
|
|
4
|
-
import { F as ResourceDefinition } from "../index-
|
|
4
|
+
import { F as ResourceDefinition } from "../index-WH7xgvxS.mjs";
|
|
5
5
|
import { h as ModuleSetupContext, m as ModuleDisposer, o as ArcPorts, p as PortName, r as ArcModuleInput, u as ModuleName } from "../types-BJ-2XqVF.mjs";
|
|
6
|
-
import "../index-
|
|
7
|
-
import { n as CreateAppOptions } from "../index-
|
|
6
|
+
import "../index-CUJvoyw3.mjs";
|
|
7
|
+
import { n as CreateAppOptions } from "../index-uhkUA5-U.mjs";
|
|
8
8
|
import { StorageContractSetup, StorageContractSetupResult, runStorageContract } from "./storageContract.mjs";
|
|
9
9
|
import { StandardRepo } from "@classytic/repo-core/repository";
|
|
10
10
|
import { FastifyInstance, FastifyServerOptions } from "fastify";
|
|
@@ -72,11 +72,11 @@ interface ArcAssertion {
|
|
|
72
72
|
/** Assert a specific key on `body.meta` or flattened top-level (matches sendControllerResponse flattening). */
|
|
73
73
|
hasMeta(key: string, value?: unknown): ArcAssertion;
|
|
74
74
|
}
|
|
75
|
-
declare function expectArc(response: ArcResponseLike): ArcAssertion;
|
|
75
|
+
export declare function expectArc(response: ArcResponseLike): ArcAssertion;
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/testing/testActor.d.ts
|
|
78
78
|
/** The header the testing harness uses to carry a request's actor. */
|
|
79
|
-
declare const TEST_ACTOR_HEADER = "x-test-actor";
|
|
79
|
+
export declare const TEST_ACTOR_HEADER = "x-test-actor";
|
|
80
80
|
/**
|
|
81
81
|
* What a test wants to be. An `organizationId` produces a `member` scope (the
|
|
82
82
|
* org-scoped case); without one the actor is `authenticated`.
|
|
@@ -119,7 +119,7 @@ interface TestActor {
|
|
|
119
119
|
* headers: testActorHeaders('manager', ORG) });
|
|
120
120
|
* ```
|
|
121
121
|
*/
|
|
122
|
-
declare function testActorHeaders(actor: TestActor | string | null, organizationId?: string): Record<string, string>;
|
|
122
|
+
export declare function testActorHeaders(actor: TestActor | string | null, organizationId?: string): Record<string, string>;
|
|
123
123
|
/**
|
|
124
124
|
* Turn a spec into a `RequestScope`.
|
|
125
125
|
*
|
|
@@ -127,7 +127,7 @@ declare function testActorHeaders(actor: TestActor | string | null, organization
|
|
|
127
127
|
* levels, and making the caller repeat itself only produces tests that pass a
|
|
128
128
|
* global gate and mysteriously fail an org one.
|
|
129
129
|
*/
|
|
130
|
-
declare function scopeFromTestActor(spec: TestActor): RequestScope;
|
|
130
|
+
export declare function scopeFromTestActor(spec: TestActor): RequestScope;
|
|
131
131
|
/**
|
|
132
132
|
* Build the `auth` option that makes the test actor arc's authenticator.
|
|
133
133
|
*
|
|
@@ -144,7 +144,7 @@ declare function scopeFromTestActor(spec: TestActor): RequestScope;
|
|
|
144
144
|
* REJECTS rather than falling back to public — a test that meant to be an admin
|
|
145
145
|
* and got quietly demoted is the most expensive way to fail.
|
|
146
146
|
*/
|
|
147
|
-
declare function testActorAuth(defaultActor?: TestActor): {
|
|
147
|
+
export declare function testActorAuth(defaultActor?: TestActor): {
|
|
148
148
|
type: "authenticator";
|
|
149
149
|
authenticate: (request: unknown) => Promise<void>;
|
|
150
150
|
};
|
|
@@ -230,10 +230,10 @@ interface ModuleTestApp<TConn = unknown> {
|
|
|
230
230
|
* Everything Mongo-specific about the harness lives HERE — the harness
|
|
231
231
|
* itself is driver-blind and any kit can replace this via `database`.
|
|
232
232
|
*/
|
|
233
|
-
declare function mongoMemoryDatabase(opts: {
|
|
233
|
+
export declare function mongoMemoryDatabase(opts: {
|
|
234
234
|
replset?: boolean;
|
|
235
235
|
}): Promise<TestDatabase<unknown>>;
|
|
236
|
-
declare function bootModuleApp<TConn = unknown>(modules: BootModulesInput<TConn>, options?: BootModuleAppOptions<TConn>): Promise<ModuleTestApp<TConn>>;
|
|
236
|
+
export declare function bootModuleApp<TConn = unknown>(modules: BootModulesInput<TConn>, options?: BootModuleAppOptions<TConn>): Promise<ModuleTestApp<TConn>>;
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region src/testing/assertModuleBootsAlone.d.ts
|
|
239
239
|
interface ModuleBootsAloneOptions<TConn = unknown> extends BootModuleAppOptions<TConn> {
|
|
@@ -244,7 +244,7 @@ interface ModuleBootsAloneResult {
|
|
|
244
244
|
/** The closure's modules (bridges excluded), in input order. */
|
|
245
245
|
readonly closure: readonly string[];
|
|
246
246
|
}
|
|
247
|
-
declare function assertModuleBootsAlone<TConn = unknown>(modules: BootModulesInput<TConn>,
|
|
247
|
+
export declare function assertModuleBootsAlone<TConn = unknown>(modules: BootModulesInput<TConn>,
|
|
248
248
|
/** The module — or several roots booted together, when a deployment rule pairs them. */
|
|
249
249
|
name: ModuleName | readonly ModuleName[], options?: ModuleBootsAloneOptions<TConn>): Promise<ModuleBootsAloneResult>;
|
|
250
250
|
//#endregion
|
|
@@ -281,7 +281,7 @@ interface AuthorizationConformance {
|
|
|
281
281
|
* Boot a one-resource app gated by `permission` on both list + an aggregation,
|
|
282
282
|
* hit both surfaces anonymously, and report what arc enforced on each.
|
|
283
283
|
*/
|
|
284
|
-
declare function runAuthorizationConformance(opts: {
|
|
284
|
+
export declare function runAuthorizationConformance(opts: {
|
|
285
285
|
/** The permission under test — applied to `list` and the aggregation alike. */
|
|
286
286
|
permission: PermissionCheck;
|
|
287
287
|
/** Rows the mock repo returns for list (aggregation returns a count). */
|
|
@@ -340,21 +340,21 @@ interface TestAuthProvider {
|
|
|
340
340
|
* Accepts both `user` (payload to sign) and `token` (pre-signed) role configs,
|
|
341
341
|
* so the same provider handles mixed flows in a single test.
|
|
342
342
|
*/
|
|
343
|
-
declare function createJwtAuthProvider(app: FastifyInstance, opts?: {
|
|
343
|
+
export declare function createJwtAuthProvider(app: FastifyInstance, opts?: {
|
|
344
344
|
defaultOrgId?: string;
|
|
345
345
|
}): TestAuthProvider;
|
|
346
346
|
/**
|
|
347
347
|
* Better Auth provider — uses pre-signed tokens (from signUp/signIn flows).
|
|
348
348
|
* No signing: role configs MUST carry `token`. A `user` alone will throw.
|
|
349
349
|
*/
|
|
350
|
-
declare function createBetterAuthProvider(opts?: {
|
|
350
|
+
export declare function createBetterAuthProvider(opts?: {
|
|
351
351
|
defaultOrgId?: string;
|
|
352
352
|
}): TestAuthProvider;
|
|
353
353
|
/**
|
|
354
354
|
* Custom provider — plug in your own token minting logic. Useful for
|
|
355
355
|
* mocked external issuers, session-cookie flows, or fixtures that pre-mint.
|
|
356
356
|
*/
|
|
357
|
-
declare function createCustomAuthProvider(mintToken: (role: string, config: RoleConfig) => string, opts?: {
|
|
357
|
+
export declare function createCustomAuthProvider(mintToken: (role: string, config: RoleConfig) => string, opts?: {
|
|
358
358
|
defaultOrgId?: string;
|
|
359
359
|
}): TestAuthProvider;
|
|
360
360
|
//#endregion
|
|
@@ -487,13 +487,13 @@ interface SetupBetterAuthTestAppResult {
|
|
|
487
487
|
* Auth endpoints occasionally emit empty 204 bodies (e.g. set-active) and
|
|
488
488
|
* tests shouldn't crash on the parse.
|
|
489
489
|
*/
|
|
490
|
-
declare function safeParseBody<T = unknown>(body: string | undefined): T | null;
|
|
490
|
+
export declare function safeParseBody<T = unknown>(body: string | undefined): T | null;
|
|
491
491
|
/**
|
|
492
492
|
* Stateless Better Auth helpers. Each function takes the app as a positional
|
|
493
493
|
* argument, so a single helper instance works across multiple test apps in
|
|
494
494
|
* the same suite.
|
|
495
495
|
*/
|
|
496
|
-
declare function createBetterAuthTestHelpers(options?: BetterAuthTestHelpersOptions): BetterAuthTestHelpers;
|
|
496
|
+
export declare function createBetterAuthTestHelpers(options?: BetterAuthTestHelpersOptions): BetterAuthTestHelpers;
|
|
497
497
|
/**
|
|
498
498
|
* Composite setup for Better Auth apps. Replaces the pre-v2.11
|
|
499
499
|
* `setupBetterAuthOrg` with a tighter contract:
|
|
@@ -513,7 +513,7 @@ declare function createBetterAuthTestHelpers(options?: BetterAuthTestHelpersOpti
|
|
|
513
513
|
* creators are supplied (ambiguous ownership is a boot-time bug, not a
|
|
514
514
|
* runtime one).
|
|
515
515
|
*/
|
|
516
|
-
declare function setupBetterAuthTestApp(input: SetupBetterAuthTestAppInput): Promise<SetupBetterAuthTestAppResult>;
|
|
516
|
+
export declare function setupBetterAuthTestApp(input: SetupBetterAuthTestAppInput): Promise<SetupBetterAuthTestAppResult>;
|
|
517
517
|
//#endregion
|
|
518
518
|
//#region src/testing/fixtures.d.ts
|
|
519
519
|
type FixtureFactory<T extends object = AnyRecord> = (data: Partial<T>) => Promise<T>;
|
|
@@ -543,7 +543,7 @@ interface TestFixtures {
|
|
|
543
543
|
/** Registered factory names. */
|
|
544
544
|
readonly names: readonly string[];
|
|
545
545
|
}
|
|
546
|
-
declare function createTestFixtures(): TestFixtures;
|
|
546
|
+
export declare function createTestFixtures(): TestFixtures;
|
|
547
547
|
//#endregion
|
|
548
548
|
//#region src/testing/HttpTestHarness.d.ts
|
|
549
549
|
interface HttpTestHarnessOptions<T = unknown> {
|
|
@@ -563,7 +563,7 @@ interface HttpTestHarnessOptions<T = unknown> {
|
|
|
563
563
|
apiPrefix?: string;
|
|
564
564
|
}
|
|
565
565
|
type OptionsOrGetter<T> = HttpTestHarnessOptions<T> | (() => HttpTestHarnessOptions<T>);
|
|
566
|
-
declare class HttpTestHarness<T = unknown> {
|
|
566
|
+
export declare class HttpTestHarness<T = unknown> {
|
|
567
567
|
private resource;
|
|
568
568
|
private optionsOrGetter;
|
|
569
569
|
private enabledRoutes;
|
|
@@ -581,7 +581,7 @@ declare class HttpTestHarness<T = unknown> {
|
|
|
581
581
|
* Create an HTTP test harness. `optionsOrGetter` may be a plain object
|
|
582
582
|
* (for eager app setup) or a getter function (for async `beforeAll` apps).
|
|
583
583
|
*/
|
|
584
|
-
declare function createHttpTestHarness<T = unknown>(resource: ResourceDefinition<unknown>, optionsOrGetter: HttpTestHarnessOptions<T> | (() => HttpTestHarnessOptions<T>)): HttpTestHarness<T>;
|
|
584
|
+
export declare function createHttpTestHarness<T = unknown>(resource: ResourceDefinition<unknown>, optionsOrGetter: HttpTestHarnessOptions<T> | (() => HttpTestHarnessOptions<T>)): HttpTestHarness<T>;
|
|
585
585
|
//#endregion
|
|
586
586
|
//#region src/testing/mocks.d.ts
|
|
587
587
|
/**
|
|
@@ -606,11 +606,11 @@ interface MockRepository<T> extends StandardRepo<T> {
|
|
|
606
606
|
*
|
|
607
607
|
* await mockRepo.getById('1'); // Returns mocked product
|
|
608
608
|
*/
|
|
609
|
-
declare function createMockRepository<T extends object = AnyRecord>(overrides?: Partial<MockRepository<T>>): MockRepository<T>;
|
|
609
|
+
export declare function createMockRepository<T extends object = AnyRecord>(overrides?: Partial<MockRepository<T>>): MockRepository<T>;
|
|
610
610
|
/**
|
|
611
611
|
* Create a mock user for authentication testing
|
|
612
612
|
*/
|
|
613
|
-
declare function createMockUser(overrides?: Partial<AnyRecord>): {
|
|
613
|
+
export declare function createMockUser(overrides?: Partial<AnyRecord>): {
|
|
614
614
|
_id: string;
|
|
615
615
|
id: string;
|
|
616
616
|
email: string;
|
|
@@ -620,11 +620,11 @@ declare function createMockUser(overrides?: Partial<AnyRecord>): {
|
|
|
620
620
|
/**
|
|
621
621
|
* Create a mock Fastify request
|
|
622
622
|
*/
|
|
623
|
-
declare function createMockRequest(overrides?: Partial<AnyRecord>): unknown;
|
|
623
|
+
export declare function createMockRequest(overrides?: Partial<AnyRecord>): unknown;
|
|
624
624
|
/**
|
|
625
625
|
* Create a mock Fastify reply
|
|
626
626
|
*/
|
|
627
|
-
declare function createMockReply(): unknown;
|
|
627
|
+
export declare function createMockReply(): unknown;
|
|
628
628
|
/**
|
|
629
629
|
* Create a mock controller for testing.
|
|
630
630
|
*
|
|
@@ -640,7 +640,7 @@ declare function createMockReply(): unknown;
|
|
|
640
640
|
* arguments) while naming only `vitest`, which arc does declare. Same shape
|
|
641
641
|
* `MockRepository` above uses.
|
|
642
642
|
*/
|
|
643
|
-
declare function createMockController(repository: StandardRepo<AnyRecord>): {
|
|
643
|
+
export declare function createMockController(repository: StandardRepo<AnyRecord>): {
|
|
644
644
|
repository: StandardRepo<AnyRecord>;
|
|
645
645
|
list: Mock;
|
|
646
646
|
get: Mock;
|
|
@@ -661,7 +661,7 @@ declare function createMockController(repository: StandardRepo<AnyRecord>): {
|
|
|
661
661
|
* const product = productFactory.build();
|
|
662
662
|
* const products = productFactory.buildMany(10);
|
|
663
663
|
*/
|
|
664
|
-
declare function createDataFactory<T extends AnyRecord>(template: Record<keyof T, (index: number) => unknown>): {
|
|
664
|
+
export declare function createDataFactory<T extends AnyRecord>(template: Record<keyof T, (index: number) => unknown>): {
|
|
665
665
|
build(overrides?: Partial<T>): T;
|
|
666
666
|
buildMany(count: number, overrides?: Partial<T>): T[];
|
|
667
667
|
reset(): void;
|
|
@@ -671,7 +671,7 @@ declare function createDataFactory<T extends AnyRecord>(template: Record<keyof T
|
|
|
671
671
|
*
|
|
672
672
|
* Useful for testing side effects without full mocking
|
|
673
673
|
*/
|
|
674
|
-
declare function createSpy<T extends (...args: unknown[]) => unknown>(_name?: string): Mock<T> & {
|
|
674
|
+
export declare function createSpy<T extends (...args: unknown[]) => unknown>(_name?: string): Mock<T> & {
|
|
675
675
|
getCalls(): unknown[][];
|
|
676
676
|
getLastCall(): unknown[];
|
|
677
677
|
};
|
|
@@ -692,7 +692,7 @@ declare function createSpy<T extends (...args: unknown[]) => unknown>(_name?: st
|
|
|
692
692
|
* @example
|
|
693
693
|
* await waitFor(() => runs >= 3, { label: "3 scheduler ticks" });
|
|
694
694
|
*/
|
|
695
|
-
declare function waitFor(condition: () => boolean | Promise<boolean>, options?: {
|
|
695
|
+
export declare function waitFor(condition: () => boolean | Promise<boolean>, options?: {
|
|
696
696
|
timeout?: number;
|
|
697
697
|
interval?: number;
|
|
698
698
|
label?: string;
|
|
@@ -700,7 +700,7 @@ declare function waitFor(condition: () => boolean | Promise<boolean>, options?:
|
|
|
700
700
|
/**
|
|
701
701
|
* Create a test timer that can be controlled
|
|
702
702
|
*/
|
|
703
|
-
declare function createTestTimer(): {
|
|
703
|
+
export declare function createTestTimer(): {
|
|
704
704
|
now: () => number;
|
|
705
705
|
advance: (ms: number) => void;
|
|
706
706
|
set: (timestamp: number) => void;
|
|
@@ -727,7 +727,7 @@ interface TestModuleSetup {
|
|
|
727
727
|
*/
|
|
728
728
|
dispose(): Promise<void>;
|
|
729
729
|
}
|
|
730
|
-
declare function createTestModuleSetup(options?: {
|
|
730
|
+
export declare function createTestModuleSetup(options?: {
|
|
731
731
|
/** The `context.ports` the phases see — supply what the module declares. */
|
|
732
732
|
readonly ports?: ArcPorts;
|
|
733
733
|
}): TestModuleSetup;
|
|
@@ -755,7 +755,7 @@ declare function createTestModuleSetup(options?: {
|
|
|
755
755
|
* filters by tenant, so a gate that waves a tenant-less request through is how a
|
|
756
756
|
* green test reads another org's rows.
|
|
757
757
|
*/
|
|
758
|
-
declare function scopeRoleGate(...allowed: string[]): PermissionCheck;
|
|
758
|
+
export declare function scopeRoleGate(...allowed: string[]): PermissionCheck;
|
|
759
759
|
//#endregion
|
|
760
760
|
//#region src/testing/testApp.d.ts
|
|
761
761
|
type DbMode = "in-memory" | {
|
|
@@ -826,12 +826,12 @@ interface TestAppContext {
|
|
|
826
826
|
*/
|
|
827
827
|
close(): Promise<void>;
|
|
828
828
|
}
|
|
829
|
-
declare function createTestApp(options?: CreateTestAppOptions): Promise<TestAppContext>;
|
|
829
|
+
export declare function createTestApp(options?: CreateTestAppOptions): Promise<TestAppContext>;
|
|
830
830
|
/**
|
|
831
831
|
* Minimal Fastify instance — no arc plugins, no auth, no db. Use when a test
|
|
832
832
|
* needs bare Fastify (e.g. plugin unit tests that manually register their
|
|
833
833
|
* dependencies).
|
|
834
834
|
*/
|
|
835
|
-
declare function createMinimalTestApp(options?: FastifyServerOptions): FastifyInstance;
|
|
835
|
+
export declare function createMinimalTestApp(options?: FastifyServerOptions): FastifyInstance;
|
|
836
836
|
//#endregion
|
|
837
|
-
export { type ArcAssertion, type ArcResponseLike, type AuthMode, type AuthResponse, type AuthorizationConformance, type BetterAuthTestHelpers, type BetterAuthTestHelpersOptions, type BetterAuthTestUser, type BootModuleAppOptions, type BootModulesInput, type CreateOrgInput, type CreateTestAppOptions, type DbMode, type FixtureDestroyer, type FixtureFactory, type FixtureRegistration,
|
|
837
|
+
export { type ArcAssertion, type ArcResponseLike, type AuthMode, type AuthResponse, type AuthorizationConformance, type BetterAuthTestHelpers, type BetterAuthTestHelpersOptions, type BetterAuthTestUser, type BootModuleAppOptions, type BootModulesInput, type CreateOrgInput, type CreateTestAppOptions, type DbMode, type FixtureDestroyer, type FixtureFactory, type FixtureRegistration, type HttpTestHarnessOptions, type MockRepository, type ModuleBootsAloneOptions, type ModuleBootsAloneResult, type ModuleTestApp, type OrgResponse, type RoleConfig, type SetupBetterAuthTestAppInput, type SetupBetterAuthTestAppResult, type SignInInput, type SignUpInput, type StorageContractSetup, type StorageContractSetupResult, type SurfaceObservation, type TestActor, type TestAppContext, type TestAuthProvider, type TestAuthSession, type TestDatabase, type TestDatabaseFactory, type TestFixtures, type TestModuleSetup, type TestkitContext, runStorageContract };
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { o as __toESM } from "../rolldown-runtime-AD16t29l.mjs";
|
|
3
|
+
import { t as CRUD_OPERATIONS } from "../constants-B90SnSQn.mjs";
|
|
4
|
+
import { c as BaseController } from "../plugin-BDBOS3-c.mjs";
|
|
5
|
+
import { g as getUserId } from "../types-4JKkSvds.mjs";
|
|
6
|
+
import { t as defineAggregation } from "../defineAggregation-CwD8_XNd.mjs";
|
|
7
|
+
import { t as defineResource } from "../defineResource-CRkhRRSj.mjs";
|
|
8
|
+
import { E as requireOrgRole } from "../permissions-IdHJ0_5V.mjs";
|
|
9
|
+
import { h as asModulePorts, r as createApp } from "../createApp-BSBPntOQ.mjs";
|
|
10
|
+
import { d as resolveModule, l as isLazyBridge, o as resolveModuleClosure } from "../plan-CEedaMlr.mjs";
|
|
11
|
+
import { n as getModuleExports } from "../module-BtdcGn_E.mjs";
|
|
11
12
|
import { runStorageContract } from "./storageContract.mjs";
|
|
12
13
|
import Fastify from "fastify";
|
|
13
14
|
import { afterAll, describe, expect, it, vi } from "vitest";
|
|
@@ -265,13 +266,13 @@ function testActorAuth(defaultActor) {
|
|
|
265
266
|
async function mongoMemoryDatabase(opts) {
|
|
266
267
|
let mms;
|
|
267
268
|
try {
|
|
268
|
-
mms = await import("mongodb-memory-server");
|
|
269
|
+
mms = await import("../mongodb-memory-server-Cn57YIsc.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
269
270
|
} catch {
|
|
270
271
|
throw new Error("[arc-testing] bootModuleApp's default database is in-memory MongoDB — install 'mongodb-memory-server' + 'mongoose' as devDependencies, or inject your own `database` factory for a different store");
|
|
271
272
|
}
|
|
272
273
|
const server = opts.replset ? await mms.MongoMemoryReplSet.create({ replSet: { count: 1 } }) : await mms.MongoMemoryServer.create();
|
|
273
274
|
const uri = server.getUri();
|
|
274
|
-
const mongoose = (await import("mongoose")).default;
|
|
275
|
+
const mongoose = (await import("../mongoose-DzFjTtBN.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1))).default;
|
|
275
276
|
if (mongoose.connection.readyState !== 0) await mongoose.disconnect();
|
|
276
277
|
await mongoose.connect(uri);
|
|
277
278
|
mongoose.connection.deleteModel(/.*/);
|
|
@@ -1547,7 +1548,7 @@ function scopeRoleGate(...allowed) {
|
|
|
1547
1548
|
*/
|
|
1548
1549
|
async function startInMemoryMongo() {
|
|
1549
1550
|
try {
|
|
1550
|
-
const { MongoMemoryServer } = await import("mongodb-memory-server");
|
|
1551
|
+
const { MongoMemoryServer } = await import("../mongodb-memory-server-Cn57YIsc.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
1551
1552
|
const mongod = await MongoMemoryServer.create();
|
|
1552
1553
|
return {
|
|
1553
1554
|
uri: mongod.getUri(),
|
|
@@ -1561,7 +1562,7 @@ async function startInMemoryMongo() {
|
|
|
1561
1562
|
}
|
|
1562
1563
|
async function connectMongooseToUri(uri) {
|
|
1563
1564
|
try {
|
|
1564
|
-
const mongoose = (await import("mongoose")).default;
|
|
1565
|
+
const mongoose = (await import("../mongoose-DzFjTtBN.mjs").then((m) => /* @__PURE__ */ __toESM(m.default, 1))).default;
|
|
1565
1566
|
await mongoose.connect(uri);
|
|
1566
1567
|
return { async disconnect() {
|
|
1567
1568
|
await mongoose.disconnect();
|
|
@@ -1578,7 +1579,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1578
1579
|
};
|
|
1579
1580
|
}
|
|
1580
1581
|
async function createTestApp(options = {}) {
|
|
1581
|
-
const { createApp } = await import("../createApp-
|
|
1582
|
+
const { createApp } = await import("../createApp-BSBPntOQ.mjs").then((n) => n.i);
|
|
1582
1583
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1583
1584
|
let dbHandle;
|
|
1584
1585
|
let dbUri;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { OutboxStore } from "@classytic/primitives/outbox";
|
|
3
3
|
//#region src/testing/outboxStoreContract.d.ts
|
|
4
|
-
interface OutboxStoreContractSetupResult {
|
|
4
|
+
export interface OutboxStoreContractSetupResult {
|
|
5
5
|
store: OutboxStore;
|
|
6
6
|
/** Called once after the suite. */
|
|
7
7
|
teardown?: () => Promise<void>;
|
|
@@ -17,7 +17,6 @@ interface OutboxStoreContractSetupResult {
|
|
|
17
17
|
*/
|
|
18
18
|
reset: () => Promise<void>;
|
|
19
19
|
}
|
|
20
|
-
type OutboxStoreContractSetup = () => Promise<OutboxStoreContractSetupResult>;
|
|
21
|
-
declare function runOutboxStoreContract(name: string, setup: OutboxStoreContractSetup): void;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { OutboxStoreContractSetup, OutboxStoreContractSetupResult, runOutboxStoreContract };
|
|
20
|
+
export type OutboxStoreContractSetup = () => Promise<OutboxStoreContractSetupResult>;
|
|
21
|
+
export declare function runOutboxStoreContract(name: string, setup: OutboxStoreContractSetup): void;
|
|
22
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as claimedAttempts } from "../claimed-
|
|
1
|
+
/*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as claimedAttempts } from "../claimed-CnEEOHuL.mjs";
|
|
3
3
|
import { OutboxConflictError, OutboxOwnershipError } from "@classytic/primitives/outbox";
|
|
4
4
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
5
5
|
//#region src/testing/outboxStoreContract.ts
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { r as ArcModuleInput } from "../types-BJ-2XqVF.mjs";
|
|
3
3
|
//#region src/testing/requiredPorts.d.ts
|
|
4
|
-
interface RequiredPortsOptions {
|
|
4
|
+
export interface RequiredPortsOptions {
|
|
5
5
|
/** Modules composed alongside — the peers the module `dependsOn` or `requires.modules`. */
|
|
6
6
|
readonly with?: readonly ArcModuleInput[];
|
|
7
7
|
/** Ports supplied in every case — the peers' own required ports. Never one under test. Values are never read. */
|
|
8
8
|
readonly ports?: Readonly<Record<string, unknown>>;
|
|
9
9
|
}
|
|
10
|
-
interface RequiredPortsResult {
|
|
10
|
+
export interface RequiredPortsResult {
|
|
11
11
|
readonly module: string;
|
|
12
12
|
/** The required ports, in declared order. */
|
|
13
13
|
readonly ports: readonly string[];
|
|
14
14
|
}
|
|
15
|
-
declare function assertRequiresPorts(module: ArcModuleInput, ports: readonly string[], options?: RequiredPortsOptions): Promise<RequiredPortsResult>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { RequiredPortsOptions, RequiredPortsResult, assertRequiresPorts };
|
|
15
|
+
export declare function assertRequiresPorts(module: ArcModuleInput, ports: readonly string[], options?: RequiredPortsOptions): Promise<RequiredPortsResult>;
|
|
16
|
+
//#endregion
|
|
@@ -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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { c as declareModules, d as resolveModule, i as planModules, r as compositionProblems } from "../plan-CEedaMlr.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.45.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.45.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.45.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|
|
@@ -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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { l as UnauthorizedError, o as OrgRequiredError } from "./errors-C9G4A8cN.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-B6DRXXzT.mjs";
|
|
4
|
+
import { t as getUserId$1 } from "./userHelpers-Nc5ePCsf.mjs";
|
|
5
5
|
//#region src/scope/types.ts
|
|
6
6
|
/**
|
|
7
7
|
* Request Scope — The One Standard
|
|
@@ -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
|
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.45.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as ArcError } from "../errors-C9G4A8cN.mjs";
|
|
3
|
+
import { c as getOrgId, g as getUserId, i as getClientId } from "../types-4JKkSvds.mjs";
|
|
4
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-C7gAbIxC.mjs";
|
|
5
5
|
import { usagePeriod } from "@classytic/repo-core/usage";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
7
7
|
//#region src/usage/requireQuota.ts
|