@classytic/arc 2.34.0 → 2.35.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/{BaseController-CbkuhNI2.mjs → BaseController-C-pofd0v.mjs} +95 -14
- package/dist/{EventTransport-tq4CEB-q.mjs → EventTransport-BrPeGUil.mjs} +1 -1
- package/dist/{HookSystem-DqXkMXkB.mjs → HookSystem-LlPm3Anm.mjs} +6 -4
- package/dist/{ResourceRegistry-DoALUlOO.mjs → ResourceRegistry-yuD1Ra53.mjs} +2 -2
- package/dist/{pipeline-q69DZzgG.mjs → actionPermissions-LFuOra7W.mjs} +30 -7
- package/dist/audit/index.d.mts +2 -2
- package/dist/audit/index.mjs +2 -2
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +6 -6
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/{authorizationDecision-CMMLWmuZ.mjs → authorizationDecision-DYXBBgtg.mjs} +2 -2
- package/dist/{base-Csjc2oF-.d.mts → base-GZU3LlzP.d.mts} +1 -1
- package/dist/{buildHandler-BrdYrG_1.mjs → buildHandler-Do9aMIvL.mjs} +4 -4
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-BcGmvnHh.mjs → caching-cN5X9VEL.mjs} +2 -2
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/describe.mjs +3 -3
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.mjs +1 -1
- package/dist/cli/commands/generate.mjs +2 -2
- package/dist/cli/commands/init.mjs +2 -2
- package/dist/cli/commands/introspect.mjs +2 -2
- package/dist/cli/index.mjs +3 -3
- package/dist/{constants-BxCoxmiN.mjs → constants-BhzLXCfN.mjs} +1 -1
- package/dist/context/index.d.mts +16 -1
- package/dist/context/index.mjs +64 -4
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -8
- package/dist/{core-BYKa8wHu.mjs → core-DdEvmmkY.mjs} +3 -3
- package/dist/{createActionRouter-D6T0jWhS.mjs → createActionRouter-EYWgd0ly.mjs} +27 -64
- package/dist/{createAggregationRouter-QLV2PrWP.mjs → createAggregationRouter-ByOK9Iev.mjs} +7 -7
- package/dist/defineAggregation-DoIijIFq.mjs +25 -0
- package/dist/{defineResource-ZhuLonLm.mjs → defineResource-BOrGeocE.mjs} +62 -66
- package/dist/discovery/index.mjs +1 -1
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +3 -3
- package/dist/{elevation-B0tlY8y1.mjs → elevation-tGIAldco.mjs} +4 -4
- package/dist/encryption/index.mjs +3 -3
- package/dist/{errorHandler-C7xBqHsI.mjs → errorHandler-BbQ1nQdk.mjs} +3 -3
- package/dist/{errors-Cd_yy7aW.mjs → errors-CLid6atr.mjs} +1 -1
- package/dist/{eventPlugin-DSNEZWfV.d.mts → eventPlugin-B47sfCJ8.d.mts} +1 -1
- package/dist/{eventPlugin-Dar8qRaj.mjs → eventPlugin-ClPn5kjn.mjs} +5 -5
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +5 -5
- package/dist/events/transports/redis-stream-entry.mjs +1 -1
- package/dist/events/transports/redis.mjs +1 -1
- package/dist/factory/index.d.mts +5 -5
- package/dist/factory/index.mjs +5 -6
- package/dist/{fastify-augmentation-DVsTAy6X.d.mts → fastify-augmentation-CMMTL3cj.d.mts} +3 -3
- package/dist/{fields-CojeUkS4.mjs → fields-UtpiJO5R.mjs} +1 -1
- package/dist/{generate-DiB0nHPR.mjs → generate-BoAVy3_b.mjs} +2 -2
- package/dist/{headers-CveNO9gR.mjs → headers-DODWf7aC.mjs} +2 -2
- package/dist/{health-CasG2A28.mjs → health-_Zs3R_Sb.mjs} +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/idempotency/index.mjs +22 -56
- package/dist/idempotency/redis.mjs +1 -1
- package/dist/{index-C5NnMEKF.d.mts → index-C50BUxKs.d.mts} +1 -1
- package/dist/{index-BcR2bFZQ.d.mts → index-C5K78SXo.d.mts} +33 -105
- package/dist/{index-ugr1tQlW.d.mts → index-CJCcbADG.d.mts} +1 -1
- package/dist/{index-B-DvUzsr.d.mts → index-K7auNNW0.d.mts} +2 -2
- package/dist/{index-CFAJEWCX.d.mts → index-h-mTgMqy.d.mts} +7 -30
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -12
- package/dist/{init-mdJ-v4Xp.mjs → init-Ce4R0ZGK.mjs} +1 -1
- package/dist/integrations/event-gateway.mjs +2 -2
- package/dist/integrations/index.d.mts +2 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs/index.d.mts +1 -1
- package/dist/integrations/jobs/index.mjs +2 -2
- package/dist/integrations/mcp/index.d.mts +4 -4
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +3 -3
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +11 -24
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +1 -1
- package/dist/{interface-DznJrm9R.mjs → interface-my7sxjw5.mjs} +1 -1
- package/dist/{jsonBody-CfGH-GxO.mjs → jsonBody-CVKA7C5m.mjs} +2 -2
- package/dist/{keys-WeKvY1dE.mjs → keys-GlU7XpmG.mjs} +1 -1
- package/dist/{loadResources-Bj-aSsXi.mjs → loadResources-DdQb0qgV.mjs} +2 -2
- package/dist/{loadResourcesFromEntry-DwaxNcE2.mjs → loadResourcesFromEntry-s6aGs6-0.mjs} +2 -2
- package/dist/logger/index.d.mts +23 -4
- package/dist/logger/index.mjs +50 -7
- package/dist/{mcpPlugin-DX3PHD7K.mjs → mcpPlugin-DkzZ7Nfx.mjs} +15 -16
- package/dist/{memory-qYSB7rMQ.mjs → memory-BwedEXau.mjs} +2 -2
- package/dist/{metrics-D7uchLjN.mjs → metrics-5LNPvL3P.mjs} +2 -2
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +7 -4
- package/dist/{module-CwKsgZXp.mjs → module-Bh5OC7ww.mjs} +1 -1
- package/dist/{multipartBody-4w-S3-PU.mjs → multipartBody-DjilSDAT.mjs} +1 -1
- package/dist/{openapi-CkV5mQ53.mjs → openapi-ItLH12_L.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +2 -2
- package/dist/outbox-admin/index.mjs +4 -4
- package/dist/{outbox-module-D1QfHqO4.mjs → outbox-module-SGIZz6oS.mjs} +6 -4
- package/dist/{outbox-module-C1Bs_FXF.d.mts → outbox-module-b1TyDGGi.d.mts} +24 -1
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +5 -5
- package/dist/{permissions-CP47jdi7.mjs → permissions-CpSBlFXZ.mjs} +6 -6
- package/dist/{pipe-BzzoEhHj.mjs → pipe-DNOuCfAs.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/plugins/index.d.mts +92 -7
- package/dist/plugins/index.mjs +168 -17
- package/dist/plugins/response-cache.mjs +2 -2
- package/dist/plugins/tracing-entry.mjs +2 -2
- package/dist/{pluralize-B7xf8qZF.mjs → pluralize-DGAQQKL8.mjs} +1 -1
- package/dist/{preloadResources-g07ldtzh.d.mts → preloadResources--ZtY9pe9.d.mts} +54 -270
- package/dist/{createApp-zR-DEesr.mjs → preloadResources-DYMzmUk1.mjs} +112 -31
- package/dist/presets/filesUpload.d.mts +3 -3
- package/dist/presets/filesUpload.mjs +5 -5
- package/dist/presets/index.d.mts +2 -2
- package/dist/presets/index.mjs +2 -2
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +3 -3
- package/dist/presets/search.d.mts +9 -47
- package/dist/presets/search.mjs +2 -2
- package/dist/{presets-BAPijK_A.mjs → presets-Bi0Z6Iq8.mjs} +4 -4
- package/dist/{projection-BKM0Ui-s.mjs → projection-aevMua7Q.mjs} +2 -2
- package/dist/{queryCachePlugin-DhsZ0ZIc.mjs → queryCachePlugin-BI7Z88Cx.mjs} +5 -5
- package/dist/{rateLimitKey-XngqVNEV.mjs → rateLimitKey-pyevMUVf.mjs} +1 -1
- package/dist/{realtime-G1TC6Yzc.mjs → realtime-Cfl2bVjj.mjs} +9 -9
- package/dist/{rateLimit-D4-ASwsI.mjs → registerRoute-u1opU66a.mjs} +114 -3
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-CLxCR5LF.mjs → registry-B4sf9Rfm.mjs} +15 -56
- package/dist/{renewingLease-BnWtbA2U.mjs → renewingLease-5ESPMxp0.mjs} +14 -2
- package/dist/{replyHelpers-BSBVCwL3.mjs → replyHelpers-2jfmMnnV.mjs} +2 -2
- package/dist/{requestContext-uYE35JxI.mjs → requestContext-DzOUGNdY.mjs} +1 -1
- package/dist/{rolldown-runtime-DNg-KNCk.mjs → rolldown-runtime-CEvvVXTC.mjs} +1 -1
- package/dist/{runtimeCapabilities-Dm88DaTW.mjs → runtimeCapabilities-BagWc3TI.mjs} +1 -1
- package/dist/{schedules-CAcZgia0.mjs → schedules-BLpZLWGF.mjs} +6 -4
- package/dist/{schemaConverter-XH1RZRyu.mjs → schemaConverter-D2_bHGil.mjs} +19 -32
- package/dist/{schemaIR-CDvclAew.mjs → schemaIR-s3-ouZmP.mjs} +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +1 -1
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-BaWcqBvr.mjs → scope-DgepeCv6.mjs} +4 -4
- package/dist/simpleEqualityMatcher-BO-sFTQf.mjs +43 -0
- package/dist/{sse-Cf0jUHsh.mjs → sse-DUIP1XH6.mjs} +5 -5
- package/dist/{sseStream-Bvpi-UXQ.mjs → sseStream-ByFGyIVr.mjs} +2 -2
- package/dist/{store-helpers-B88p99Z2.mjs → store-helpers-kIJCY0wI.mjs} +1 -1
- package/dist/{streaming-DsT1B5zJ.mjs → streaming-DOpZVht6.mjs} +1 -1
- package/dist/{subscribe-helpers-CLIOHsOK.mjs → subscribe-helpers-Dh2BnzJf.mjs} +12 -46
- package/dist/sync/changelog.mjs +1 -1
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +6 -6
- package/dist/testing/index.mjs +10 -11
- package/dist/testing/outboxStoreContract.mjs +1 -1
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{transactionContext-BYtWnwAS.mjs → transactionContext-BTZzEcRo.mjs} +1 -1
- package/dist/{typeGuards-jjKJDN13.mjs → typeGuards-B-_jqaMi.mjs} +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-BcTumAz_.d.mts → types-DDD5RKTu.d.mts} +30 -87
- package/dist/{types-BfC83KsP.d.mts → types-DSvHH0uR.d.mts} +1 -1
- package/dist/{types-ChuShpCP.d.mts → types-Ddl9OjmE.d.mts} +18 -121
- package/dist/{types-CoqIRrkY.mjs → types-GY4kATJb.mjs} +10 -53
- package/dist/usage/index.d.mts +2 -2
- package/dist/usage/index.mjs +0 -0
- package/dist/{userHelpers-CWF5pbZD.mjs → userHelpers-AKcB4V03.mjs} +1 -1
- package/dist/utils/index.d.mts +16 -42
- package/dist/utils/index.mjs +11 -11
- package/dist/{utils-h1V_sT-t.mjs → utils-CBK9HQOI.mjs} +3 -3
- package/dist/{validate-CdQlz52F.mjs → validate-dosAIvQU.mjs} +2 -2
- package/dist/{versioning-rZbyLVD-.mjs → versioning-BbTs4pwM.mjs} +3 -3
- package/package.json +8 -8
- package/dist/actionPermissions-CUeCmpUd.mjs +0 -25
- package/dist/defineAggregation-Nv-DwfOf.mjs +0 -48
- package/dist/preloadResources-BkyqeTDz.mjs +0 -46
- package/dist/registerRoute-Ba8v0PCa.mjs +0 -113
- package/dist/repositoryFilter-BANpz6BX.mjs +0 -78
- package/dist/simpleEqualityMatcher-Se8VrsaP.mjs +0 -69
package/dist/registry/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-
|
|
3
|
-
import { t as ResourceRegistry } from "../ResourceRegistry-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as cascadeDeleteForOrganization, c as assertNoTenantData, i as introspectionPlugin_default, n as buildResourceManifestFromRegistry, o as getCascadingResources, r as introspectionPlugin, s as getCascadingResourcesWithMetadata, t as buildResourceManifest } from "../registry-B4sf9Rfm.mjs";
|
|
3
|
+
import { t as ResourceRegistry } from "../ResourceRegistry-yuD1Ra53.mjs";
|
|
4
4
|
export { ResourceRegistry, assertNoTenantData, buildResourceManifest, buildResourceManifestFromRegistry, cascadeDeleteForOrganization, getCascadingResources, getCascadingResourcesWithMetadata, introspectionPlugin_default as introspectionPlugin, introspectionPlugin as introspectionPluginFn };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "./constants-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "./constants-BhzLXCfN.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/registry/assertNoTenantData.ts
|
|
5
5
|
/**
|
|
@@ -441,64 +441,23 @@ var introspectionPlugin_default = fp(introspectionPlugin, { name: "arc-introspec
|
|
|
441
441
|
//#endregion
|
|
442
442
|
//#region src/registry/manifest.ts
|
|
443
443
|
/**
|
|
444
|
-
* Resource
|
|
444
|
+
* Resource metadata for frontend code generators — `{ name, prefix, idField,
|
|
445
|
+
* crudOps, actions[] }`, where each action carries its `mount` and
|
|
446
|
+
* `requiresId`.
|
|
445
447
|
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
* on the resource. The OpenAI-team report flagged this in fajr's
|
|
450
|
-
* `invoices.js`, and now matches needs the same.
|
|
448
|
+
* A hand-rolled FE client needs a method per declarative action and drifts the
|
|
449
|
+
* moment a new one is declared. Arc owns the resource definition, so it can
|
|
450
|
+
* emit the list instead of the host maintaining a parallel one.
|
|
451
451
|
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
452
|
+
* BE-side only — arc ships no FE runtime. The host decides whether this powers
|
|
453
|
+
* a fetch helper, a TanStack Query factory, an RPC client, or `.d.ts` codegen.
|
|
454
454
|
*
|
|
455
|
-
*
|
|
456
|
-
* name: 'invoice',
|
|
457
|
-
* prefix: '/invoices',
|
|
458
|
-
* idField: '_id',
|
|
459
|
-
* crudOps: ['list', 'get', 'create', 'update', 'delete'],
|
|
460
|
-
* actions: [
|
|
461
|
-
* { name: 'recordPayment', mount: '/:id/action', requiresId: true, description: '...' },
|
|
462
|
-
* { name: 'propose', mount: '/action', requiresId: false, description: '...' },
|
|
463
|
-
* ],
|
|
464
|
-
* }
|
|
465
|
-
*
|
|
466
|
-
* Hosts feed this into their FE generator (or a runtime `createActionsApi`
|
|
467
|
-
* shim) and every action is wired automatically. New actions land on the FE
|
|
468
|
-
* the same moment they're declared on the resource — no parallel list to
|
|
469
|
-
* keep in sync.
|
|
470
|
-
*
|
|
471
|
-
* The helper is BE-side only (lives under `@classytic/arc/registry`) — arc
|
|
472
|
-
* stays a backend framework and doesn't ship FE runtime code. The host
|
|
473
|
-
* decides whether the manifest powers a fetch-based helper, a TanStack
|
|
474
|
-
* Query factory, an RPC client, or static `.d.ts` generation.
|
|
475
|
-
*
|
|
476
|
-
* @example BE → emit JSON at build time / on a route
|
|
455
|
+
* @example
|
|
477
456
|
* ```ts
|
|
478
|
-
* //
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
* JSON.stringify(buildResourceManifest(invoiceResource)));
|
|
483
|
-
*
|
|
484
|
-
* // Runtime introspection endpoint
|
|
485
|
-
* fastify.get('/manifest/:name', async (req) => {
|
|
486
|
-
* const r = arc.registry.get(req.params.name);
|
|
487
|
-
* return r ? buildResourceManifestFromRegistry(r) : reply.code(404);
|
|
488
|
-
* });
|
|
489
|
-
* ```
|
|
490
|
-
*
|
|
491
|
-
* @example FE → generate fetch methods from the manifest
|
|
492
|
-
* ```ts
|
|
493
|
-
* import manifest from './fe-gen/invoice.manifest.json';
|
|
494
|
-
* import { createActionsApi } from './my-fe-shim.js'; // host-owned
|
|
495
|
-
*
|
|
496
|
-
* export const invoicesApi = {
|
|
497
|
-
* ...createCrudApi(manifest.prefix),
|
|
498
|
-
* ...createActionsApi(manifest.prefix, manifest.actions),
|
|
499
|
-
* // → invoicesApi.recordPayment(id, body)
|
|
500
|
-
* // → invoicesApi.propose(body) // id-less
|
|
501
|
-
* };
|
|
457
|
+
* // build time
|
|
458
|
+
* writeFileSync('invoice.manifest.json', JSON.stringify(buildResourceManifest(r)));
|
|
459
|
+
* // or at runtime, from the live registry
|
|
460
|
+
* buildResourceManifestFromRegistry(arc.registry.get(name));
|
|
502
461
|
* ```
|
|
503
462
|
*/
|
|
504
463
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
2
|
//#region src/lock/renewingLease.ts
|
|
3
3
|
/**
|
|
4
4
|
* Start renewing an ALREADY-ACQUIRED lease. The caller performed the
|
|
@@ -8,14 +8,23 @@
|
|
|
8
8
|
function startRenewingLease(options) {
|
|
9
9
|
const { lock, name, holderId, leaseMs, onLost, onError } = options;
|
|
10
10
|
const renewEveryMs = options.renewEveryMs ?? Math.max(10, Math.floor(leaseMs / 2));
|
|
11
|
+
const fenced = typeof lock.tryAcquireFenced === "function" && options.token !== void 0;
|
|
11
12
|
let stopped = false;
|
|
12
13
|
let lost = false;
|
|
14
|
+
let token = options.token;
|
|
13
15
|
let timer;
|
|
14
16
|
let inFlight;
|
|
15
17
|
const scheduleNext = () => {
|
|
16
18
|
if (stopped) return;
|
|
17
19
|
timer = setTimeout(() => {
|
|
18
|
-
inFlight = Promise.resolve(lock.
|
|
20
|
+
inFlight = (fenced ? Promise.resolve(lock.tryAcquireFenced?.(name, holderId, leaseMs)).then((result) => {
|
|
21
|
+
if (result === null || result === void 0) return false;
|
|
22
|
+
if (result.token !== token) {
|
|
23
|
+
token = result.token;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}) : Promise.resolve(lock.tryAcquire(name, holderId, leaseMs))).then((renewed) => {
|
|
19
28
|
if (!renewed && !lost) {
|
|
20
29
|
lost = true;
|
|
21
30
|
onLost?.();
|
|
@@ -34,6 +43,9 @@ function startRenewingLease(options) {
|
|
|
34
43
|
get lost() {
|
|
35
44
|
return lost;
|
|
36
45
|
},
|
|
46
|
+
get token() {
|
|
47
|
+
return token;
|
|
48
|
+
},
|
|
37
49
|
async stop() {
|
|
38
50
|
stopped = true;
|
|
39
51
|
if (timer) clearTimeout(timer);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
3
|
import { toCanonicalList } from "@classytic/repo-core/pagination";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/replyHelpers.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
3
|
-
import { t as startRenewingLease } from "./renewingLease-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
|
+
import { t as startRenewingLease } from "./renewingLease-5ESPMxp0.mjs";
|
|
4
4
|
import fp from "fastify-plugin";
|
|
5
5
|
//#region src/plugins/schedules.ts
|
|
6
6
|
var schedules_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -40,7 +40,8 @@ const schedulesPlugin = async (fastify, opts) => {
|
|
|
40
40
|
if (lock) {
|
|
41
41
|
const lockName = `arc:schedule:${s.name}`;
|
|
42
42
|
const leaseMs = s.leaseMs ?? Math.min(Math.floor(s.every * .9), MAX_DEFAULT_LEASE_MS);
|
|
43
|
-
|
|
43
|
+
const fenced = await lock.tryAcquireFenced?.(lockName, holderId, leaseMs);
|
|
44
|
+
if (!(fenced !== void 0 ? fenced !== null : await lock.tryAcquire(lockName, holderId, leaseMs))) {
|
|
44
45
|
stat.skippedByLock++;
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
@@ -49,6 +50,7 @@ const schedulesPlugin = async (fastify, opts) => {
|
|
|
49
50
|
name: lockName,
|
|
50
51
|
holderId,
|
|
51
52
|
leaseMs,
|
|
53
|
+
...fenced ? { token: fenced.token } : {},
|
|
52
54
|
onLost: () => fastify.log.warn({ schedule: s.name }, "[arc-schedules] lease renewal lost — another holder took the lock; this run may now overlap. Handlers should be idempotent."),
|
|
53
55
|
onError: (err) => fastify.log.warn({
|
|
54
56
|
err,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
2
|
import { arcLog } from "./logger/index.mjs";
|
|
3
3
|
//#region src/utils/schemaConverter.ts
|
|
4
4
|
/**
|
|
@@ -14,44 +14,31 @@ import { arcLog } from "./logger/index.mjs";
|
|
|
14
14
|
* boot with an actionable error; DOC paths warn and degrade — see
|
|
15
15
|
* {@link UnconvertibleMode}. Hosts that never pass Zod pay nothing.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* TARGET — `draft-7` for Fastify route schemas, `openapi-3.0` for docs. Fastify
|
|
18
|
+
* v5's AJV 8 is draft-07 and wants NUMERIC `exclusiveMinimum`; the
|
|
19
|
+
* `openapi-3.0` target emits the draft-04 boolean form, which AJV rejects at
|
|
20
|
+
* registration (`exclusiveMinimum must be number`). Using `draft-7` makes
|
|
21
|
+
* `.positive()` / `.gt()` work unmodified.
|
|
18
22
|
*
|
|
19
|
-
* Zod
|
|
20
|
-
*
|
|
21
|
-
* - **`draft-7`** (default) — for Fastify route schemas. Fastify v5 bundles AJV 8
|
|
22
|
-
* configured for draft-07, which uses **numeric** `exclusiveMinimum`/`exclusiveMaximum`.
|
|
23
|
-
* The `openapi-3.0` target emits the **boolean** form inherited from draft-04
|
|
24
|
-
* (`exclusiveMinimum: true` alongside `minimum`), which AJV rejects at route
|
|
25
|
-
* registration with `schema is invalid: data/properties/X/exclusiveMinimum must be number`.
|
|
26
|
-
* Using `draft-7` fixes `.positive() / .negative() / .gt() / .lt()` out of the box.
|
|
27
|
-
* - **`openapi-3.0`** — for OpenAPI doc generation (arc emits OpenAPI 3.0.3). Keeps
|
|
28
|
-
* the boolean exclusive form that 3.0 tooling expects.
|
|
29
|
-
*
|
|
30
|
-
* ## Input vs output (`io`)
|
|
31
|
-
*
|
|
32
|
-
* A Zod schema has TWO shapes and `z.toJSONSchema()` emits one of them. Getting
|
|
33
|
-
* this wrong is not cosmetic — it rejects legal traffic:
|
|
23
|
+
* IO DIRECTION — a Zod schema has two shapes and getting this wrong REJECTS
|
|
24
|
+
* LEGAL TRAFFIC:
|
|
34
25
|
*
|
|
35
26
|
* ```ts
|
|
36
27
|
* z.object({ title: z.string(), status: z.string().default("draft") })
|
|
37
|
-
* // io: "output" → required: ["title", "status"]
|
|
38
|
-
* // io: "input" → required: ["title"]
|
|
28
|
+
* // io: "output" → required: ["title", "status"] ← omitting `status` is rejected
|
|
29
|
+
* // io: "input" → required: ["title"] ← correct; the default fills it
|
|
39
30
|
* ```
|
|
40
31
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* validates what the client SENDS, before defaults/transforms/coercion apply.
|
|
47
|
-
* - **response** (and the `entity` doc shape) → `io: "output"` — describes what
|
|
48
|
-
* the server RETURNS, after they apply.
|
|
32
|
+
* `.transform()` is worse in output mode: unrepresentable, so it degrades to
|
|
33
|
+
* `{}` — no validation at all. Arc therefore converts by direction: REQUESTS
|
|
34
|
+
* (`body`/`querystring`/`params`/`headers`) use `io: "input"`, validating what
|
|
35
|
+
* the client sends before defaults and transforms; RESPONSES (and the `entity`
|
|
36
|
+
* shape) use `io: "output"`, describing what the server returns.
|
|
49
37
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `z.
|
|
53
|
-
*
|
|
54
|
-
* them; it keeps `additionalProperties: false` in both modes.
|
|
38
|
+
* Consequence: plain `z.object()` emits `additionalProperties: false` only in
|
|
39
|
+
* output mode, because it STRIPS unknown keys rather than rejecting them — so
|
|
40
|
+
* extra keys are legal input. Use `z.strictObject()` when the wire contract
|
|
41
|
+
* must reject them; it holds in both modes.
|
|
55
42
|
*/
|
|
56
43
|
const log = arcLog("schema");
|
|
57
44
|
/** Default target for Fastify-consumed schemas (matches Fastify v5's default AJV draft). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { o as toJsonSchema } from "./schemaConverter-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { o as toJsonSchema } from "./schemaConverter-D2_bHGil.mjs";
|
|
3
3
|
//#region src/core/schemaIR.ts
|
|
4
4
|
/**
|
|
5
5
|
* Schema IR — one canonical representation, two adapters.
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
2
|
import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
|
|
3
3
|
import { Type, Type as Type$1 } from "typebox";
|
|
4
4
|
//#region src/schemas/index.ts
|
package/dist/scim/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as parseJsonBody } from "../jsonBody-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as parseJsonBody } from "../jsonBody-CVKA7C5m.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
//#region src/scim/errors.ts
|
|
5
5
|
var ScimError = class extends Error {
|
package/dist/scope/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as requireOrgId, C as hasOrgAccess, D as isOrgInScope, E as isMember, M as requireUserId, N as scopeFirstCtx, O as isService, S as getUserRoles, T as isElevated, _ as getScopeContextMap, a as ScopeFirstCtx, b as getTenantFromRequest, c as getAncestorOrgIds, d as getMandate, f as getOrgContext, g as getScopeContext, h as getRequestScope, i as RequestScope, j as requireTeamId, k as requireClientId, l as getClientId, m as getOrgRoles, n as Mandate, o as ScopeFirstCtxOptions, p as getOrgId, r as PUBLIC_SCOPE, s as ScopeFirstCtxRequest, t as AUTHENTICATED_SCOPE, u as getDPoPJkt, v as getServiceScopes, w as isAuthenticated, x as getUserId, y as getTeamId } from "../types-
|
|
2
|
+
import { A as requireOrgId, C as hasOrgAccess, D as isOrgInScope, E as isMember, M as requireUserId, N as scopeFirstCtx, O as isService, S as getUserRoles, T as isElevated, _ as getScopeContextMap, a as ScopeFirstCtx, b as getTenantFromRequest, c as getAncestorOrgIds, d as getMandate, f as getOrgContext, g as getScopeContext, h as getRequestScope, i as RequestScope, j as requireTeamId, k as requireClientId, l as getClientId, m as getOrgRoles, n as Mandate, o as ScopeFirstCtxOptions, p as getOrgId, r as PUBLIC_SCOPE, s as ScopeFirstCtxRequest, t as AUTHENTICATED_SCOPE, u as getDPoPJkt, v as getServiceScopes, w as isAuthenticated, x as getUserId, y as getTeamId } from "../types-Ddl9OjmE.mjs";
|
|
3
3
|
import { i as elevationPlugin, n as ElevationOptions, r as _default, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
|
|
4
4
|
import { FastifyReply, FastifyRequest } from "fastify";
|
|
5
5
|
//#region src/scope/rateLimitKey.d.ts
|
package/dist/scope/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-
|
|
3
|
-
import { n as elevation_default, t as elevationPlugin } from "../elevation-
|
|
4
|
-
import { t as createTenantKeyGenerator } from "../rateLimitKey-
|
|
5
|
-
import { t as resolveOrgFromHeader } from "../scope-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { C as isService, D as requireUserId, E as requireTeamId, O as scopeFirstCtx, S as isOrgInScope, T as requireOrgId, _ as getUserRoles, a as getDPoPJkt, b as isElevated, c as getOrgId, d as getScopeContext, f as getScopeContextMap, g as getUserId, h as getTenantFromRequest, i as getClientId, l as getOrgRoles, m as getTeamId, n as PUBLIC_SCOPE, o as getMandate, p as getServiceScopes, r as getAncestorOrgIds, s as getOrgContext, t as AUTHENTICATED_SCOPE, u as getRequestScope, v as hasOrgAccess, w as requireClientId, x as isMember, y as isAuthenticated } from "../types-GY4kATJb.mjs";
|
|
3
|
+
import { n as elevation_default, t as elevationPlugin } from "../elevation-tGIAldco.mjs";
|
|
4
|
+
import { t as createTenantKeyGenerator } from "../rateLimitKey-pyevMUVf.mjs";
|
|
5
|
+
import { t as resolveOrgFromHeader } from "../scope-DgepeCv6.mjs";
|
|
6
6
|
export { AUTHENTICATED_SCOPE, PUBLIC_SCOPE, createTenantKeyGenerator, elevation_default as elevationPlugin, elevationPlugin as elevationPluginFn, getAncestorOrgIds, getClientId, getDPoPJkt, getMandate, getOrgContext, getOrgId, getOrgRoles, getRequestScope, getScopeContext, getScopeContextMap, getServiceScopes, getTeamId, getTenantFromRequest, getUserId, getUserRoles, hasOrgAccess, isAuthenticated, isElevated, isMember, isOrgInScope, isService, requireClientId, requireOrgId, requireTeamId, requireUserId, resolveOrgFromHeader, scopeFirstCtx };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-
|
|
3
|
-
import { n as requireSingleHeaderValue } from "./headers-
|
|
4
|
-
import { n as getUserRoles } from "./userHelpers-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { a as OrgAccessDeniedError, l as UnauthorizedError } from "./errors-CLid6atr.mjs";
|
|
3
|
+
import { n as requireSingleHeaderValue } from "./headers-DODWf7aC.mjs";
|
|
4
|
+
import { n as getUserRoles } from "./userHelpers-AKcB4V03.mjs";
|
|
5
5
|
//#region src/scope/resolveOrgFromHeader.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a preHandler hook that resolves org scope from a header.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
//#region src/utils/simpleEqualityMatcher.ts
|
|
3
|
+
/**
|
|
4
|
+
* `simpleEqualityMatcher` — a minimal, dialect-agnostic flat-key equality
|
|
5
|
+
* matcher for `DataAdapter.matchesFilter` / `BaseController({ matchesFilter })`.
|
|
6
|
+
*
|
|
7
|
+
* Compares `item[key]` to each filter value by string coercion, so a Mongo
|
|
8
|
+
* `ObjectId` matches its string form; array values match by contains. ALL
|
|
9
|
+
* entries must match.
|
|
10
|
+
*
|
|
11
|
+
* NOT an operator engine: no `$in`/`$ne`/`$gt`/`$regex`/`$exists`, no
|
|
12
|
+
* `$and`/`$or`, no dot paths, no schema coercion. Most `_policyFilters` from
|
|
13
|
+
* arc's built-in permission helpers are flat equality (`{ ownerId }`,
|
|
14
|
+
* `{ organizationId }`), and this covers exactly that — defense-in-depth for
|
|
15
|
+
* hosts on minimal repos with no `getOne(compoundFilter)` path.
|
|
16
|
+
*
|
|
17
|
+
* Do NOT use it with operator-shaped filters — supply a native matcher instead
|
|
18
|
+
* (a kit's predicate engine). Kit users need neither: the DB-level filter in
|
|
19
|
+
* `getOne(compoundFilter)` already applies.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const adapter: DataAdapter = { repository, type: 'custom', name: 'in-memory',
|
|
24
|
+
* matchesFilter: simpleEqualityMatcher };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function simpleEqualityMatcher(item, filters) {
|
|
28
|
+
if (!item || typeof item !== "object") return false;
|
|
29
|
+
const obj = item;
|
|
30
|
+
for (const [key, expected] of Object.entries(filters)) {
|
|
31
|
+
if (expected && typeof expected === "object" && !Array.isArray(expected) && Object.getPrototypeOf(expected) === Object.prototype && Object.keys(expected).some((k) => k.startsWith("$"))) return false;
|
|
32
|
+
const actual = obj[key];
|
|
33
|
+
if (Array.isArray(actual)) {
|
|
34
|
+
const expectedStr = String(expected);
|
|
35
|
+
if (!actual.some((v) => String(v) === expectedStr)) return false;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (String(actual) !== String(expected)) return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { simpleEqualityMatcher as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-CEvvVXTC.mjs";
|
|
3
3
|
import { arcLog } from "./logger/index.mjs";
|
|
4
|
-
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-
|
|
5
|
-
import { a as promoteStreamTokenToHeader } from "./streaming-
|
|
6
|
-
import { t as openSseStream } from "./sseStream-
|
|
4
|
+
import { c as getOrgId, n as PUBLIC_SCOPE } from "./types-GY4kATJb.mjs";
|
|
5
|
+
import { a as promoteStreamTokenToHeader } from "./streaming-DOpZVht6.mjs";
|
|
6
|
+
import { t as openSseStream } from "./sseStream-ByFGyIVr.mjs";
|
|
7
7
|
import fp from "fastify-plugin";
|
|
8
8
|
//#region src/plugins/sse.ts
|
|
9
9
|
var sse_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as forwardedStreamHeaders } from "./streaming-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as forwardedStreamHeaders } from "./streaming-DOpZVht6.mjs";
|
|
3
3
|
//#region src/utils/sseStream.ts
|
|
4
4
|
/**
|
|
5
5
|
* Take over the reply socket and open an SSE stream. Call ONLY after every
|
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as createEvent } from "./EventTransport-
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as createEvent } from "./EventTransport-BrPeGUil.mjs";
|
|
3
3
|
//#region src/events/defineEvent.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Typed event declarations, a registry for introspection, and `.create()` to
|
|
6
|
+
* build a `DomainEvent` with generated metadata.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* The built-in validator checks: object type, required fields, and top-level
|
|
13
|
-
* property types. It does NOT recurse into nested objects, validate arrays,
|
|
14
|
-
* enums, patterns, formats, or $ref. This is intentional — it's a lightweight
|
|
15
|
-
* guard, not a full JSON Schema engine.
|
|
16
|
-
*
|
|
17
|
-
* For full validation, pass a custom `validate` function to `createEventRegistry()`:
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import Ajv from 'ajv';
|
|
22
|
-
* const ajv = new Ajv();
|
|
23
|
-
*
|
|
24
|
-
* const registry = createEventRegistry({
|
|
25
|
-
* validate: (schema, payload) => {
|
|
26
|
-
* const valid = ajv.validate(schema, payload);
|
|
27
|
-
* return valid
|
|
28
|
-
* ? { valid: true }
|
|
29
|
-
* : { valid: false, errors: ajv.errorsText().split(', ') };
|
|
30
|
-
* },
|
|
31
|
-
* });
|
|
32
|
-
* ```
|
|
8
|
+
* The BUILT-IN validator is deliberately shallow: object type, required
|
|
9
|
+
* fields, and top-level property types only. It does not recurse, nor handle
|
|
10
|
+
* arrays, enums, patterns, formats, or `$ref` — it is a guard, not a JSON
|
|
11
|
+
* Schema engine. Pass `validate` to `createEventRegistry()` to delegate to AJV
|
|
12
|
+
* or similar when you need the real thing.
|
|
33
13
|
*
|
|
34
14
|
* @example
|
|
35
15
|
* ```typescript
|
|
36
|
-
* import { defineEvent, createEventRegistry } from '@classytic/arc/events';
|
|
37
|
-
*
|
|
38
16
|
* const OrderCreated = defineEvent({
|
|
39
17
|
* name: 'order.created',
|
|
40
18
|
* version: 1,
|
|
41
|
-
* schema: {
|
|
42
|
-
*
|
|
43
|
-
* properties: {
|
|
44
|
-
* orderId: { type: 'string' },
|
|
45
|
-
* total: { type: 'number' },
|
|
46
|
-
* },
|
|
47
|
-
* required: ['orderId', 'total'],
|
|
48
|
-
* },
|
|
19
|
+
* schema: { type: 'object', properties: { orderId: { type: 'string' } },
|
|
20
|
+
* required: ['orderId'] },
|
|
49
21
|
* });
|
|
50
22
|
*
|
|
51
|
-
*
|
|
52
|
-
* const event = OrderCreated.create({ orderId: 'o-1', total: 100 });
|
|
23
|
+
* const event = OrderCreated.create({ orderId: 'o-1' });
|
|
53
24
|
* await fastify.events.publish(event.type, event.payload, event.meta);
|
|
54
|
-
*
|
|
55
|
-
* // Registry for introspection + validation
|
|
56
|
-
* const registry = createEventRegistry();
|
|
57
|
-
* registry.register(OrderCreated);
|
|
58
|
-
* const result = registry.validate('order.created', payload);
|
|
59
25
|
* ```
|
|
60
26
|
*/
|
|
61
27
|
/**
|
package/dist/sync/changelog.mjs
CHANGED
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as RequestScope } from "../types-
|
|
3
|
-
import { l as PermissionCheck, t as AnyRecord } from "../base-
|
|
4
|
-
import { V as ResourceDefinition } from "../index-
|
|
5
|
-
import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-
|
|
6
|
-
import "../index-
|
|
7
|
-
import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources
|
|
2
|
+
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
3
|
+
import { l as PermissionCheck, t as AnyRecord } from "../base-GZU3LlzP.mjs";
|
|
4
|
+
import { V as ResourceDefinition } from "../index-C5K78SXo.mjs";
|
|
5
|
+
import { n as ArcModuleInput, o as ModuleDisposer, s as ModuleSetupContext } from "../types-DDD5RKTu.mjs";
|
|
6
|
+
import "../index-C50BUxKs.mjs";
|
|
7
|
+
import { n as preloadResourcesAsync, r as CreateAppOptions, t as preloadResources } from "../preloadResources--ZtY9pe9.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";
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../constants-
|
|
3
|
-
import { g as getUserId } from "../types-
|
|
4
|
-
import { t as BaseController } from "../BaseController-
|
|
5
|
-
import { t as defineResource } from "../defineResource-
|
|
6
|
-
import { t as defineAggregation } from "../defineAggregation-
|
|
7
|
-
import { E as requireOrgRole } from "../permissions-
|
|
8
|
-
import {
|
|
9
|
-
import { n as getModuleExports } from "../module-
|
|
10
|
-
import { n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-BkyqeTDz.mjs";
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../constants-BhzLXCfN.mjs";
|
|
3
|
+
import { g as getUserId } from "../types-GY4kATJb.mjs";
|
|
4
|
+
import { t as BaseController } from "../BaseController-C-pofd0v.mjs";
|
|
5
|
+
import { t as defineResource } from "../defineResource-BOrGeocE.mjs";
|
|
6
|
+
import { t as defineAggregation } from "../defineAggregation-DoIijIFq.mjs";
|
|
7
|
+
import { E as requireOrgRole } from "../permissions-CpSBlFXZ.mjs";
|
|
8
|
+
import { a as createApp, n as preloadResourcesAsync, t as preloadResources } from "../preloadResources-DYMzmUk1.mjs";
|
|
9
|
+
import { n as getModuleExports } from "../module-Bh5OC7ww.mjs";
|
|
11
10
|
import { runStorageContract } from "./storageContract.mjs";
|
|
12
11
|
import Fastify from "fastify";
|
|
13
12
|
import { afterAll, describe, expect, it, vi } from "vitest";
|
|
@@ -1505,7 +1504,7 @@ function pickDefaultAuth(authMode, callerAuth) {
|
|
|
1505
1504
|
};
|
|
1506
1505
|
}
|
|
1507
1506
|
async function createTestApp(options = {}) {
|
|
1508
|
-
const { createApp } = await import("../
|
|
1507
|
+
const { createApp } = await import("../preloadResources-DYMzmUk1.mjs").then((n) => n.o);
|
|
1509
1508
|
const { resources = [], db = "in-memory", connectMongoose = false, authMode = "jwt", defaultOrgId, plugins, auth: callerAuth, ...appOptions } = options;
|
|
1510
1509
|
let dbHandle;
|
|
1511
1510
|
let dbUri;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
2
|
import { OutboxOwnershipError } from "@classytic/primitives/outbox";
|
|
3
3
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
4
4
|
//#region src/testing/outboxStoreContract.ts
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { i as RequestScope } from "../types-
|
|
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-
|
|
4
|
-
import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-
|
|
2
|
+
import { i as RequestScope } from "../types-Ddl9OjmE.mjs";
|
|
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-GZU3LlzP.mjs";
|
|
4
|
+
import { $ as OpenApiSchemas, A as RequestIdOptions, An as WriteVerbKey, At as RouteDefinition, C as RequestContext, D as HealthCheck, Dn as MutationWriteContext, Dt as ActionEntry, E as GracefulShutdownOptions, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, G as OnTenantDeleteConfig, H as CrudController, I as MiddlewareHandler, In as IRequestContext, It as Authenticator, J as PresetHook, K as ResolvedTenantPurge, L as RequestWithExtras, Ln as RawRouteHandler, Lt as AuthenticatorContext, M as EventsDecorator, Mn as ControllerLike, Mt as RouteMethod, N as FastifyRequestExtras, Nn as FastifyHandler, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, Ot as ActionHandlerFn, P as FastifyWithAuth, Pn as IController, Pt as AuthHelpers, Q as MiddlewareConfig, Rn as RouteHandler, Rt as JwtContext, S as QueryParserInterface, T as CrudRouterOptions, Tt as ResourceCacheConfig, U as ResourceConfig, W as ResourcePermissions, X as CrudRouteKey, Y as PresetResult, Z as CrudSchemas, _ as ControllerQueryOptions, a as InferAdapterDoc, at as ResourceExtensions, b as ParsedQuery, c as TypedController, d as PaginationResult, et as RouteSchemaOptions, f as IntrospectionData, g as ArcInternalMetadata, h as ResourceMetadata, i as ValidationResult, it as ResourceHooks, j as ArcDecorator, jn as ControllerHandler, jt as RouteMcpConfig, k as IntrospectionPluginOptions, kn as WriteContext, kt as ActionsMap, l as TypedRepository, m as RegistryStats, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, q as PresetFunction, r as ValidateOptions, rt as ResourceHookContext, s as InferResourceDoc, t as RouteHandlerMethod, tt as ArcFieldRule, u as TypedResourceConfig, v as LookupOption, w as ServiceContext, x as PopulateOption, xn as BaseControllerOptions, y as OwnershipCheck, zt as TokenPair } from "../index-C5K78SXo.mjs";
|
|
5
5
|
import { n as ElevationOptions, t as ElevationEvent } from "../elevation-BXCfVcNG.mjs";
|
|
6
6
|
export type { ActionDefinition, ActionEntry, ActionHandlerFn, ActionsMap, AnyRecord, ArcDecorator, ArcFieldRule, ArcInternalMetadata, ArcRequest, AuthHelpers, AuthPluginOptions, Authenticator, AuthenticatorContext, AuthorizationDecision, BaseControllerOptions, ConfigError, 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, 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, ResourceMetadata, ResourcePermissions, ResourceWrites, RouteDefinition, RouteHandler, RouteHandlerMethod, RouteMcpConfig, RouteMethod, RouteSchemaOptions, ServiceContext, TokenPair, TypedController, TypedRepository, TypedResourceConfig, UserBase, UserLike, UserOrganization, ValidateOptions, ValidationResult, WriteContext, WriteVerbKey };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.35.0 | MIT | https://classytic.com */
|
|
2
2
|
export {};
|