@classytic/arc 2.51.0 → 2.53.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/README.md +2 -1
- package/dist/{EventTransport-K7Q9WPjm.mjs → EventTransport-B3jTKMQH.mjs} +2 -2
- package/dist/{HookSystem-DBAu9uNT.mjs → HookSystem-DNwxV463.mjs} +2 -2
- package/dist/{ResourceRegistry-BelzCRMy.mjs → ResourceRegistry-Ck7RFodL.mjs} +2 -2
- package/dist/{acquire-B0zhfGSm.mjs → acquire-DkLruwhL.mjs} +1 -1
- package/dist/audit/index.d.mts +1 -1
- package/dist/audit/index.mjs +4 -4
- package/dist/auth/audit.mjs +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.mjs +7 -7
- package/dist/auth/redis-session.mjs +1 -1
- package/dist/auth/social/index.mjs +1 -1
- package/dist/{authorizationDecision-Dxj_cy6N.mjs → authorizationDecision-gB5-bHDp.mjs} +9 -7
- package/dist/bootError-BT3z3cvX.mjs +38 -0
- package/dist/{boundedMap-DOBai-H3.mjs → boundedMap-Ddw2yGb2.mjs} +1 -1
- package/dist/{buildHandler-Dyl8P9j0.mjs → buildHandler-B8IDGmhD.mjs} +5 -5
- package/dist/cache/index.mjs +4 -4
- package/dist/{caching-CUmaNL8Y.mjs → caching-BitJDAY0.mjs} +2 -2
- package/dist/{claimed-DJPk4VZr.mjs → claimed-CM_-lFHX.mjs} +1 -1
- package/dist/cleanup/index.d.mts +2 -2
- package/dist/cleanup/index.mjs +4 -4
- package/dist/cli/commands/describe.d.mts +18 -1
- package/dist/cli/commands/describe.mjs +39 -7
- package/dist/cli/commands/docs.mjs +3 -3
- package/dist/cli/commands/doctor.d.mts +3 -1
- package/dist/cli/commands/doctor.mjs +135 -22
- 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-DH41jnNT.mjs → constants-D9EiaO5s.mjs} +1 -1
- package/dist/context/index.d.mts +5 -2
- package/dist/context/index.mjs +5 -5
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +7 -7
- package/dist/{core-DPmRWlpx.mjs → core-B_06Fcn0.mjs} +3 -3
- package/dist/{createActionRouter-B1xhER6i.mjs → createActionRouter-DtxUXOCI.mjs} +5 -5
- package/dist/{createAggregationRouter-CNntJL-z.mjs → createAggregationRouter-BMiKyDoW.mjs} +7 -7
- package/dist/{createApp-DpG26bCu.mjs → createApp-CEdGZtkP.mjs} +207 -44
- package/dist/{createMcpServer-CS2KOVP6.d.mts → createMcpServer-Bk3ls5jS.d.mts} +1 -1
- package/dist/{defineAggregation-rI3EbZUg.mjs → defineAggregation-DUsrGcsm.mjs} +1 -1
- package/dist/{defineResource-5DcG_wlI.mjs → defineResource-q8TsJpOm.mjs} +92 -36
- package/dist/deprecation-DX625dth.mjs +27 -0
- 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-XFu7J3aj.mjs → elevation-NJ3908pJ.mjs} +5 -5
- package/dist/encryption/index.d.mts +26 -1
- package/dist/encryption/index.mjs +56 -6
- package/dist/{errorHandler-xDVUWOMu.mjs → errorHandler-Ke6PGvF7.mjs} +7 -4
- package/dist/{errors-KBZ3tQk5.mjs → errors-Ukhmfmmx.mjs} +1 -1
- package/dist/{eventPlugin-BY38F6yK.d.mts → eventPlugin-BeJasppx.d.mts} +7 -18
- package/dist/{eventPlugin-C4lNj2Dw.mjs → eventPlugin-DTKAgSvb.mjs} +10 -8
- package/dist/{eventTypes-DZRoUAdk.mjs → eventTypes-DpDQtyR6.mjs} +2 -2
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +8 -8
- package/dist/events/transports/redis-stream-entry.mjs +4 -4
- package/dist/events/transports/redis.mjs +2 -2
- package/dist/factory/index.d.mts +28 -5
- package/dist/factory/index.mjs +12 -7
- package/dist/{fastify-augmentation-baQc3MaO.d.mts → fastify-augmentation-DjxuSRG4.d.mts} +4 -3
- package/dist/{fieldTypes-DrXUW1jc.mjs → fieldTypes-BtFpQO6I.mjs} +2 -2
- package/dist/{fields-C5J8WTd2.mjs → fields-B7fuROWK.mjs} +1 -1
- package/dist/{filter-merge-DTjYoDrj.mjs → filter-merge-BuzZ-r9z.mjs} +1 -1
- package/dist/{generate-SA8oMlLB.mjs → generate-c4F39pk1.mjs} +4 -4
- package/dist/{headers-D5wrBLOk.mjs → headers-Ib7BDgRI.mjs} +2 -2
- package/dist/{health-BLal039H.mjs → health-22T82HAa.mjs} +1 -1
- package/dist/health-skjSwNaC.d.mts +36 -0
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/http-cache/index.mjs +4 -4
- package/dist/http-cache/purgers/cloudflare.mjs +2 -2
- package/dist/http-cache/purgers/fastly.mjs +2 -2
- package/dist/http-cache/testing/index.mjs +1 -1
- package/dist/idempotency/index.d.mts +7 -1
- package/dist/idempotency/index.mjs +9 -7
- package/dist/idempotency/redis.mjs +2 -2
- package/dist/{index-CMNpMBtW.d.mts → index-BzUyno-u.d.mts} +14 -5
- package/dist/{index-Dhrks-hM.d.mts → index-CXqYFGoH.d.mts} +13 -4
- package/dist/{index-DexdFs1a.d.mts → index-CaBFPmnu.d.mts} +29 -7
- package/dist/{index-DKM2p5w5.d.mts → index-DWn0o4U7.d.mts} +2 -2
- package/dist/{index-DLCcLUQT.d.mts → index-DtHACefu.d.mts} +109 -116
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +12 -12
- package/dist/{init-DeKHaNZn.mjs → init-XY5slyuS.mjs} +3 -3
- 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 +9 -4
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +2 -2
- package/dist/integrations/mcp/testing.mjs +2 -2
- package/dist/integrations/streamline.mjs +3 -3
- package/dist/integrations/webhooks.d.mts +1 -1
- package/dist/integrations/webhooks.mjs +4 -4
- package/dist/integrations/websocket-pushref-redis.mjs +1 -1
- package/dist/integrations/websocket-redis.mjs +1 -1
- package/dist/integrations/websocket.mjs +2 -2
- package/dist/invariants-COekUeoh.mjs +120 -0
- package/dist/{jsonBody-rDPGT5A9.mjs → jsonBody-BNlcGUnb.mjs} +2 -2
- package/dist/{keys-t7i-lJ2r.mjs → keys-DwvXJwUX.mjs} +1 -1
- package/dist/{loadResources-CcupAVJH.mjs → loadResources-izEeQLO_.mjs} +3 -3
- package/dist/{loadResourcesFromEntry-BpjYlaoj.mjs → loadResourcesFromEntry-CijqjbHE.mjs} +2 -2
- package/dist/logger/index.mjs +2 -2
- package/dist/{logger-IL7Btm-N.mjs → logger-DdMS0XC_.mjs} +1 -1
- package/dist/{mcpPlugin-BsdH7Vot.mjs → mcpPlugin-D0tSZqKk.mjs} +24 -22
- package/dist/{memory-Dkp6ZD3F.mjs → memory-Ay0haw9n.mjs} +3 -3
- package/dist/{metrics-CDPqgdKr.mjs → metrics-Bpgf4UL6.mjs} +3 -3
- package/dist/middleware/index.d.mts +1 -1
- package/dist/middleware/index.mjs +3 -3
- package/dist/migrations/index.mjs +2 -2
- package/dist/{module-KFxT1Iuk.mjs → module-BLrTmMyk.mjs} +17 -2
- package/dist/{multiTenant-QtDzxx_K.d.mts → multiTenant-Cf0Ye-Wu.d.mts} +1 -1
- package/dist/{multipartBody-BHktuarE.mjs → multipartBody-L2gr96df.mjs} +1 -1
- package/dist/{observeSend-CY-sLanc.mjs → observeSend-B7FEdk_g.mjs} +1 -1
- package/dist/{openapi-DbeXiy2v.mjs → openapi-COrL_33P.mjs} +6 -6
- package/dist/outbox-admin/index.d.mts +1 -1
- package/dist/outbox-admin/index.mjs +6 -6
- package/dist/{outbox-module-BWqkTE8-.mjs → outbox-module-BY2HtnjU.mjs} +7 -7
- package/dist/{outbox-module-DzW6zwWJ.d.mts → outbox-module-C1QWMloZ.d.mts} +5 -8
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +8 -8
- package/dist/{permissions-e5YMrFbm.mjs → permissions-CEyeDHtT.mjs} +36 -17
- package/dist/{pipe-CMnKfdF4.mjs → pipe-DIAr91at.mjs} +2 -2
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/pipeline/index.mjs +2 -2
- package/dist/{plan-BvLJGm3U.mjs → plan-BhKHIkFl.mjs} +75 -20
- package/dist/{plugin-DYmu8uT4.mjs → plugin-D6hrdx-j.mjs} +72 -38
- package/dist/plugins/index.d.mts +4 -3
- package/dist/plugins/index.mjs +18 -18
- package/dist/plugins/response-cache.mjs +4 -4
- package/dist/plugins/tracing-entry.mjs +177 -85
- package/dist/{pluralize-ClwfBdIx.mjs → pluralize-CJKgYkVc.mjs} +1 -1
- package/dist/presetPermission-2pcRVYRG.mjs +23 -0
- package/dist/presets/filesUpload.d.mts +4 -2
- package/dist/presets/filesUpload.mjs +11 -6
- package/dist/presets/index.d.mts +6 -4
- 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 +2 -2
- package/dist/presets/search.mjs +54 -38
- package/dist/{presets-DX_lPabi.mjs → presets-st11ePNn.mjs} +150 -41
- package/dist/{projection-DnZiFPPE.mjs → projection-B4rqiJTi.mjs} +2 -2
- package/dist/{purger.types-BEzTVDOU.mjs → purger.types-BcHeAhY_.mjs} +1 -1
- package/dist/{queryCachePlugin-C57-Nj-g.mjs → queryCachePlugin-BgSc2bga.mjs} +6 -6
- package/dist/rateLimitKey-DLGdeFd2.mjs +138 -0
- package/dist/{realtime-C-VIoXMg.mjs → realtime-CpYpIFsm.mjs} +11 -11
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +3 -3
- package/dist/{registry-DbQvODPH.mjs → registry-BQsdAlZ_.mjs} +2 -2
- package/dist/{relay-B61seKq1.mjs → relay-CmT3gtkP.mjs} +11 -12
- package/dist/{renewingLease-Dp7wmzNN.mjs → renewingLease-DaoP0K-e.mjs} +1 -1
- package/dist/{replyHelpers-CHii_jIO.mjs → replyHelpers-SiLr1wK4.mjs} +2 -2
- package/dist/{requestContext-C_mbAm8o.mjs → requestContext-B-TjFpWt.mjs} +8 -3
- package/dist/{health-vEo3fni4.mjs → requestId-ClcKoWLq.mjs} +154 -116
- package/dist/{requirement-C8OsWLYp.mjs → requirement-BygDzjDS.mjs} +1 -1
- package/dist/{resourceRateLimit-DhbQZjE2.mjs → resourceRateLimit-DdIYis3m.mjs} +2 -2
- package/dist/{rolldown-runtime-HTi8KV7V.mjs → rolldown-runtime-Cy6j0m8_.mjs} +1 -1
- package/dist/{routeValidator-DnQ2BGnH.mjs → routeValidator-Bn-x2gaJ.mjs} +1 -1
- package/dist/{runtimeCapabilities-G9QXHov1.mjs → runtimeCapabilities-DY20Pibh.mjs} +7 -2
- package/dist/{schedules-DAthT5O3.mjs → schedules-CwqC0Mp0.mjs} +5 -5
- package/dist/{schemaConverter-BOt_ed78.mjs → schemaConverter-XoLKVpzG.mjs} +2 -2
- package/dist/{schemaIR-MZVVj6Cw.mjs → schemaIR-DP7mMj7c.mjs} +16 -16
- package/dist/schemas/index.mjs +1 -1
- package/dist/scim/index.mjs +2 -2
- package/dist/scope/index.d.mts +6 -2
- package/dist/scope/index.mjs +5 -5
- package/dist/{scope-btg-225w.mjs → scope-B0vgM2Zw.mjs} +4 -4
- package/dist/{shutdown-Dfy8La90.mjs → shutdown-C76Hn-Th.mjs} +1 -1
- package/dist/{simpleEqualityMatcher-D5dOqbbj.mjs → simpleEqualityMatcher-Qbl-11cE.mjs} +1 -1
- package/dist/{sse-DivxX1m6.mjs → sse-eyb8lNuI.mjs} +7 -7
- package/dist/{sseStream-hQxQjvre.mjs → sseStream-BsBesrfw.mjs} +2 -2
- package/dist/{store-helpers-DfqfssAw.mjs → store-helpers-D1yIVa91.mjs} +1 -1
- package/dist/{streaming-CQiOktsh.mjs → streaming-DKziqs1Z.mjs} +1 -1
- package/dist/{subscriberIdentity-Bf8VLqA7.mjs → subscriberIdentity-DpdSQMQq.mjs} +1 -1
- package/dist/{tenancy-Btmaf1MB.mjs → tenancy-YuRYsOPr.mjs} +2 -2
- package/dist/{tenantPreparation-4e3qyb6q.mjs → tenantPreparation-Bk8ouRB3.mjs} +17 -5
- package/dist/testing/cleanupStoreContract.mjs +1 -1
- package/dist/testing/index.d.mts +4 -4
- package/dist/testing/index.mjs +11 -11
- package/dist/testing/outboxStoreContract.mjs +2 -2
- package/dist/testing/requiredPorts.d.mts +1 -1
- package/dist/testing/requiredPorts.mjs +2 -2
- package/dist/testing/storageContract.mjs +1 -1
- package/dist/{timing-DXx0IWyi.mjs → timing-BtIDIdQz.mjs} +1 -1
- package/dist/{transactionContext-DperjON1.mjs → transactionContext-BsQ5ortM.mjs} +1 -1
- package/dist/{typeGuards-eoQLIOh6.mjs → typeGuards-Cr2_zEW0.mjs} +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/storage.mjs +1 -1
- package/dist/{types-BeEJm-DV.d.mts → types-CQhHTZXs.d.mts} +48 -35
- package/dist/{types-B4E0sc6D.d.mts → types-DWFgq8EP.d.mts} +1 -1
- package/dist/{types-CcpISJe8.mjs → types-ZvdR7MVa.mjs} +4 -4
- package/dist/usage/index.mjs +4 -4
- package/dist/{userHelpers-Cp5zqlEN.mjs → userHelpers-CwpEK36a.mjs} +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +12 -12
- package/dist/{utils-dKN-_315.mjs → utils-CnrfcYMq.mjs} +6 -6
- package/dist/{validate-BZHaAdgy.mjs → validate-BTQBh-Dr.mjs} +3 -3
- package/dist/{versioning-CPLP0VbB.mjs → versioning-DiLykI6U.mjs} +3 -3
- package/dist/{workScope-BI72KXsI.mjs → workScope-C3tPz_Gt.mjs} +2 -2
- package/package.json +34 -9
- package/skills/arc/SKILL.md +5 -5
- package/skills/arc/references/api-reference.md +1 -1
- package/skills/arc/references/boot.md +17 -2
- package/skills/arc/references/events.md +0 -1
- package/skills/arc/references/mcp-setup.md +3 -2
- package/skills/arc/references/multi-tenancy.md +1 -1
- package/skills/arc/references/production-api.md +19 -12
- package/skills/arc/references/production-audit.md +1 -1
- package/skills/arc/references/production-boot.md +3 -3
- package/skills/arc/references/production-idempotency.md +2 -2
- package/skills/arc/references/production-observability.md +14 -2
- package/skills/arc/references/production-reliability.md +1 -1
- package/skills/arc/references/querying.md +1 -2
- package/skills/arc/references/resources.md +8 -6
- package/skills/arc/references/testing.md +1 -1
- package/skills/arc-code-review/references/arc-cheatsheet.md +1 -1
- package/skills/arc-code-review/references/recipe-scope-permissions.md +1 -1
- package/skills/arc-module-publishing/references/resource-assembly.md +2 -2
- package/dist/rateLimitKey-B1RxyGt3.mjs +0 -40
package/README.md
CHANGED
|
@@ -119,7 +119,8 @@ export default defineResource({
|
|
|
119
119
|
},
|
|
120
120
|
cache: { staleTime: 30, gcTime: 300, tags: ['catalog'] },
|
|
121
121
|
routes: [
|
|
122
|
-
{ method: 'GET', path: '/featured',
|
|
122
|
+
{ method: 'GET', path: '/featured', permissions: allowPublic(),
|
|
123
|
+
handler: async () => ({ data: await productRepository.getAll({ filters: { featured: true } }) }) }, // arc pipeline + MCP tool
|
|
123
124
|
],
|
|
124
125
|
actions: {
|
|
125
126
|
approve: { handler: approveOrder, permissions: requireRoles(['admin']) },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-C3tPz_Gt.mjs";
|
|
3
3
|
import { createEvent as createEvent$1, createEventRouter } from "@classytic/primitives/events";
|
|
4
4
|
// src/events/EventTransport.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as buildRequestScopeProjection } from "./projection-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as buildRequestScopeProjection } from "./projection-B4rqiJTi.mjs";
|
|
3
3
|
// src/hooks/HookSystem.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hook System
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
2
|
// src/idempotency/acquire.ts
|
|
3
3
|
async function acquireIdempotencyKey(store, key, requestId, lockTtlMs) {
|
|
4
4
|
if (typeof store.acquire === "function") return store.acquire(key, requestId, lockTtlMs);
|
package/dist/audit/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { d as UserBase } from "../base-HXNgPQww.mjs";
|
|
3
|
-
import "../index-
|
|
3
|
+
import "../index-DtHACefu.mjs";
|
|
4
4
|
import { FastifyPluginAsync } from "fastify";
|
|
5
5
|
import { RepositoryLike } from "@classytic/repo-core/adapter";
|
|
6
6
|
type AuditAction = "create" | "update" | "delete" | "restore" | "custom";
|
package/dist/audit/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as transactionContext } from "../transactionContext-
|
|
3
|
-
import { g as getUserId, i as getClientId } from "../types-
|
|
4
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as transactionContext } from "../transactionContext-BsQ5ortM.mjs";
|
|
3
|
+
import { g as getUserId, i as getClientId } from "../types-ZvdR7MVa.mjs";
|
|
4
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DY20Pibh.mjs";
|
|
5
5
|
import { and, anyOf, eq, gte, lt, lte } from "@classytic/repo-core/filter";
|
|
6
6
|
import fp from "fastify-plugin";
|
|
7
7
|
// src/audit/repository-audit-adapter.ts
|
package/dist/auth/audit.mjs
CHANGED
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Nt as AuthHelpers, Pt as AuthPluginOptions } from "../index-DtHACefu.mjs";
|
|
3
3
|
import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
|
|
4
4
|
import { t as ExternalOpenApiPaths } from "../externalPaths-BOqdq5wr.mjs";
|
|
5
5
|
import { i as RequestScope } from "../types-DnkIALZ8.mjs";
|
package/dist/auth/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-
|
|
3
|
-
import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-
|
|
4
|
-
import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-
|
|
5
|
-
import { n as requireSingleHeaderValue } from "../headers-
|
|
6
|
-
import { o as toJsonSchema } from "../schemaConverter-
|
|
7
|
-
import { n as declareRuntimeCapability } from "../runtimeCapabilities-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-CwpEK36a.mjs";
|
|
3
|
+
import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-Ukhmfmmx.mjs";
|
|
4
|
+
import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-CEyeDHtT.mjs";
|
|
5
|
+
import { n as requireSingleHeaderValue } from "../headers-Ib7BDgRI.mjs";
|
|
6
|
+
import { o as toJsonSchema } from "../schemaConverter-XoLKVpzG.mjs";
|
|
7
|
+
import { n as declareRuntimeCapability } from "../runtimeCapabilities-DY20Pibh.mjs";
|
|
8
8
|
import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
|
|
9
9
|
import { isProductionEnv } from "@classytic/primitives/environment";
|
|
10
10
|
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
2
|
import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
|
|
3
3
|
import { APIError, createAuthEndpoint, createAuthMiddleware, getOAuthState } from "better-auth/api";
|
|
4
4
|
import { makeSignature } from "better-auth/crypto";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as arcLog } from "./logger-
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as arcLog } from "./logger-DdMS0XC_.mjs";
|
|
3
|
+
import { n as PUBLIC_SCOPE, y as isAuthenticated } from "./types-ZvdR7MVa.mjs";
|
|
4
|
+
import { t as ArcError } from "./errors-Ukhmfmmx.mjs";
|
|
5
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BuzZ-r9z.mjs";
|
|
5
6
|
// src/permissions/authorizationDecision.ts
|
|
6
7
|
const log = arcLog("permissions:enforce");
|
|
7
8
|
/**
|
|
@@ -158,11 +159,12 @@ async function evaluateAndApplyPermission(check, context, request, reply, opts)
|
|
|
158
159
|
}
|
|
159
160
|
const { decision } = outcome;
|
|
160
161
|
if (decision.effect !== "allow") {
|
|
161
|
-
const
|
|
162
|
+
const authenticated = context.user != null || isAuthenticated(request.scope ?? PUBLIC_SCOPE);
|
|
163
|
+
const defaultMsg = opts?.defaultDenialMessage?.(context.user) ?? (authenticated ? "Permission denied" : "Authentication required");
|
|
162
164
|
const reason = decision.reason && decision.reason.length <= MAX_DENIAL_REASON_LENGTH ? decision.reason : defaultMsg;
|
|
163
|
-
const status =
|
|
165
|
+
const status = authenticated ? 403 : 401;
|
|
164
166
|
reply.code(status).send({
|
|
165
|
-
code:
|
|
167
|
+
code: authenticated ? "arc.forbidden" : "arc.unauthorized",
|
|
166
168
|
message: reason,
|
|
167
169
|
status
|
|
168
170
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as ArcError } from "./errors-Ukhmfmmx.mjs";
|
|
3
|
+
// src/utils/bootError.ts
|
|
4
|
+
/**
|
|
5
|
+
* One shape for every boot failure arc detects from configuration: a stable
|
|
6
|
+
* `code`, the module it belongs to (when one does), what is wrong, and a
|
|
7
|
+
* one-line `fix`. Codes are kebab-case like resource diagnostics
|
|
8
|
+
* (`crud-public-by-omission`); a module's own invariant codes are its own.
|
|
9
|
+
*
|
|
10
|
+
* Every problem found by one check is collected first and thrown together,
|
|
11
|
+
* so a deployment is fixed in one pass, not one boot per mistake.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Thrown by `createApp` for a configuration that cannot boot. `problems` lists
|
|
15
|
+
* every failure found; `code` is the single problem's code, or `boot-failed`
|
|
16
|
+
* when there are several.
|
|
17
|
+
*/
|
|
18
|
+
var ArcBootError = class extends ArcError {
|
|
19
|
+
name = "ArcBootError";
|
|
20
|
+
problems;
|
|
21
|
+
constructor(message, problems) {
|
|
22
|
+
const list = Object.freeze([...problems]);
|
|
23
|
+
super(message, {
|
|
24
|
+
code: list.length === 1 ? list[0].code : "boot-failed",
|
|
25
|
+
details: { problems: list }
|
|
26
|
+
});
|
|
27
|
+
this.problems = list;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/** One problem, thrown with its message verbatim. */
|
|
31
|
+
function bootError(problem) {
|
|
32
|
+
return new ArcBootError(problem.message, [problem]);
|
|
33
|
+
}
|
|
34
|
+
/** `header (N problems):` followed by one `[code] module "x": message` + `fix:` pair per problem. */
|
|
35
|
+
function formatBootProblems(header, problems) {
|
|
36
|
+
return `${header} (${`${problems.length} problem${problems.length === 1 ? "" : "s"}`}):\n${problems.map((p) => ` - [${p.code}]${p.module !== void 0 ? ` module "${p.module}":` : ""} ${p.message}\n fix: ${p.fix}`).join("\n")}`;
|
|
37
|
+
}
|
|
38
|
+
export { bootError as n, formatBootProblems as r, ArcBootError as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as conjoinPolicyFilters } from "./filter-merge-
|
|
3
|
-
import { D as toRepositoryFilter } from "./plugin-
|
|
4
|
-
import { i as guessDate, t as coerceByType } from "./fieldTypes-
|
|
5
|
-
import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as conjoinPolicyFilters } from "./filter-merge-BuzZ-r9z.mjs";
|
|
3
|
+
import { D as toRepositoryFilter } from "./plugin-D6hrdx-j.mjs";
|
|
4
|
+
import { i as guessDate, t as coerceByType } from "./fieldTypes-BtFpQO6I.mjs";
|
|
5
|
+
import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-BTQBh-Dr.mjs";
|
|
6
6
|
// src/core/aggregation/buildHandler.ts
|
|
7
7
|
/**
|
|
8
8
|
* Framework-agnostic aggregation execution. Runs safety guards,
|
package/dist/cache/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-
|
|
3
|
-
import { t as MemoryCacheStore } from "../memory-
|
|
4
|
-
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-DwvXJwUX.mjs";
|
|
3
|
+
import { t as MemoryCacheStore } from "../memory-Ay0haw9n.mjs";
|
|
4
|
+
import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-BgSc2bga.mjs";
|
|
5
5
|
// src/cache/redis.ts
|
|
6
6
|
/**
|
|
7
7
|
* Redis-backed cache store.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-Cy6j0m8_.mjs";
|
|
3
3
|
import fp from "fastify-plugin";
|
|
4
4
|
// src/plugins/caching.ts
|
|
5
5
|
var caching_exports = /* @__PURE__ */ __exportAll({ default: () => caching_default });
|
package/dist/cleanup/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { A as CleanupStepResult, B as VerificationResult, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeEvidence, I as PurgeResourceResult, L as PurgeStrategyKind, M as CleanupWriteFence, N as DEFAULT_CLEANUP_LIMITS, O as CleanupRunTransitionPatch, P as PurgeActor, R as PurgeVerificationSummary, S as CleanupRecipe, T as CleanupRunCreateResult, _ as CleanupPermissions, a as CleanupEvidenceStore, b as CleanupPlanItem, c as CleanupInput, d as CleanupLease, f as CleanupLimits, g as CleanupPermissionCheck, h as CleanupOutcomeStatus, i as CleanupContext, j as CleanupStepRunStatus, k as CleanupStepProgress, l as CleanupJob, m as CleanupManifest, n as CLEANUP_TERMINAL_STATUSES, o as CleanupExecutionContext, p as CleanupLogger, r as CleanupCancelRequest, s as CleanupFinalizationPayload, t as Availability, u as CleanupJobQueue, v as CleanupPlan, w as CleanupRun, x as CleanupProgressSummary, y as CleanupPlanDraft, z as VerificationCheck } from "../types-C0YJAiL0.mjs";
|
|
3
|
-
import { n as ArcModule } from "../types-
|
|
3
|
+
import { n as ArcModule } from "../types-CQhHTZXs.mjs";
|
|
4
4
|
import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
|
|
5
|
-
import { A as RequestWithExtras } from "../index-
|
|
5
|
+
import { A as RequestWithExtras } from "../index-DtHACefu.mjs";
|
|
6
6
|
import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
|
|
7
7
|
import { CleanupStep } from "@classytic/repo-core/cleanup";
|
|
8
8
|
/** Metadata + steps for {@link recipeFromSteps}. */
|
package/dist/cleanup/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as defineResource } from "../defineResource-
|
|
3
|
-
import { t as defineModule } from "../module-
|
|
4
|
-
import { g as getUserId } from "../types-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as defineResource } from "../defineResource-q8TsJpOm.mjs";
|
|
3
|
+
import { t as defineModule } from "../module-BLrTmMyk.mjs";
|
|
4
|
+
import { g as getUserId } from "../types-ZvdR7MVa.mjs";
|
|
5
5
|
import { createPurgeEvidence } from "@classytic/primitives/retention";
|
|
6
6
|
import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
|
|
7
7
|
// src/cleanup/errors.ts
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
import { F as ResourceDefinition,
|
|
2
|
+
import { F as ResourceDefinition, Mt as RateLimitConfig, Z as RouteSchemaOptions } from "../../index-DtHACefu.mjs";
|
|
3
|
+
import { n as ArcModule } from "../../types-CQhHTZXs.mjs";
|
|
4
|
+
/** A module's facts and the result of each invariant — evaluated without booting anything. */
|
|
5
|
+
export interface DescribedModule {
|
|
6
|
+
name: string;
|
|
7
|
+
facts: Record<string, unknown>;
|
|
8
|
+
invariants: {
|
|
9
|
+
code: string;
|
|
10
|
+
fix: string;
|
|
11
|
+
ok: boolean;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
3
15
|
export interface DescribedResource {
|
|
4
16
|
name: string;
|
|
5
17
|
displayName: string;
|
|
@@ -124,5 +136,10 @@ interface EventDescription {
|
|
|
124
136
|
* can call this directly.
|
|
125
137
|
*/
|
|
126
138
|
export declare function describeResource(resource: ResourceDefinition<unknown>, module?: string): DescribedResource;
|
|
139
|
+
/**
|
|
140
|
+
* Facts and invariant results for the modules given — the same evaluation boot runs, with the
|
|
141
|
+
* same cross-module `all` map (limited to these modules). Pure: nothing is booted.
|
|
142
|
+
*/
|
|
143
|
+
export declare function describeModules(modules: readonly Pick<ArcModule, "name" | "facts" | "invariants">[]): DescribedModule[];
|
|
127
144
|
export declare function describe(args: string[]): Promise<void>;
|
|
128
145
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as CRUD_OPERATIONS } from "../../constants-
|
|
3
|
-
import { n as
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as CRUD_OPERATIONS } from "../../constants-D9EiaO5s.mjs";
|
|
3
|
+
import { n as evaluateModuleInvariants } from "../../invariants-COekUeoh.mjs";
|
|
4
|
+
import { n as stringifyMeasureMap } from "../../ResourceRegistry-Ck7RFodL.mjs";
|
|
4
5
|
import { resolve } from "node:path";
|
|
5
6
|
import { pathToFileURL } from "node:url";
|
|
6
7
|
// src/cli/commands/describe.ts
|
|
@@ -269,6 +270,29 @@ function describeResource(resource, module) {
|
|
|
269
270
|
idField: resource.idField ?? "_id"
|
|
270
271
|
};
|
|
271
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Facts and invariant results for the modules given — the same evaluation boot runs, with the
|
|
275
|
+
* same cross-module `all` map (limited to these modules). Pure: nothing is booted.
|
|
276
|
+
*/
|
|
277
|
+
function describeModules(modules) {
|
|
278
|
+
const results = evaluateModuleInvariants(modules);
|
|
279
|
+
return modules.map((m) => ({
|
|
280
|
+
name: m.name,
|
|
281
|
+
facts: { ...m.facts ?? {} },
|
|
282
|
+
invariants: results.filter((r) => r.module === m.name).map(({ code, fix, ok, reason }) => ({
|
|
283
|
+
code,
|
|
284
|
+
fix,
|
|
285
|
+
ok,
|
|
286
|
+
...reason ? { reason } : {}
|
|
287
|
+
}))
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
/** A constructed module object (not a thunk) that declares facts or invariants. */
|
|
291
|
+
function isDescribableModule(value) {
|
|
292
|
+
if (!value || typeof value !== "object" || "_registryMeta" in value) return false;
|
|
293
|
+
const v = value;
|
|
294
|
+
return typeof v.name === "string" && (v.facts !== void 0 || Array.isArray(v.invariants));
|
|
295
|
+
}
|
|
272
296
|
async function describe(args) {
|
|
273
297
|
try {
|
|
274
298
|
const flags = new Set(args.filter((a) => a.startsWith("--")));
|
|
@@ -297,12 +321,19 @@ async function describe(args) {
|
|
|
297
321
|
function tryCollectRegistry(value) {
|
|
298
322
|
if (value && typeof value === "object" && "catalog" in value && "register" in value && "validate" in value && typeof value.catalog === "function") eventRegistry = value;
|
|
299
323
|
}
|
|
300
|
-
|
|
301
|
-
|
|
324
|
+
const modules = [];
|
|
325
|
+
const tryCollectModule = (value) => {
|
|
326
|
+
if (isDescribableModule(value) && !modules.includes(value)) modules.push(value);
|
|
327
|
+
};
|
|
328
|
+
for (const exported of Object.values(entryModule)) if (Array.isArray(exported)) {
|
|
329
|
+
exported.forEach(tryCollect);
|
|
330
|
+
exported.forEach(tryCollectModule);
|
|
331
|
+
} else {
|
|
302
332
|
tryCollect(exported);
|
|
303
333
|
tryCollectRegistry(exported);
|
|
334
|
+
tryCollectModule(exported);
|
|
304
335
|
}
|
|
305
|
-
if (resources.length === 0) throw new Error("No resource definitions found in entry file.\nMake sure your file exports defineResource() results:\n export const productResource = defineResource({ ... });");
|
|
336
|
+
if (resources.length === 0 && modules.length === 0) throw new Error("No resource definitions found in entry file.\nMake sure your file exports defineResource() results:\n export const productResource = defineResource({ ... });");
|
|
306
337
|
const filtered = filterResource ? resources.filter((r) => r.name === filterResource) : resources;
|
|
307
338
|
if (filterResource && filtered.length === 0) throw new Error(`Resource '${filterResource}' not found.\nAvailable: ${resources.map((r) => r.name).join(", ")}`);
|
|
308
339
|
const described = filtered.map((r) => describeResource(r, r._registryMeta?.module));
|
|
@@ -327,6 +358,7 @@ async function describe(args) {
|
|
|
327
358
|
$schema: "arc-describe/v1",
|
|
328
359
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
329
360
|
resources: described,
|
|
361
|
+
...modules.length > 0 ? { modules: describeModules(modules) } : {},
|
|
330
362
|
...eventCatalog?.length ? { eventCatalog } : {},
|
|
331
363
|
stats: {
|
|
332
364
|
totalResources: described.length,
|
|
@@ -347,4 +379,4 @@ async function describe(args) {
|
|
|
347
379
|
throw new Error(String(error));
|
|
348
380
|
}
|
|
349
381
|
}
|
|
350
|
-
export { describe, describeResource };
|
|
382
|
+
export { describe, describeModules, describeResource };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as buildOpenApiSpec } from "../../openapi-
|
|
3
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as buildOpenApiSpec } from "../../openapi-COrL_33P.mjs";
|
|
3
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-CijqjbHE.mjs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
// src/cli/commands/docs.ts
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Arc CLI - Doctor Command
|
|
4
4
|
*
|
|
5
5
|
* Health check utility that validates the development environment.
|
|
6
|
-
* Checks Node.js version, dependencies, configuration,
|
|
6
|
+
* Checks Node.js version, dependencies, configuration, the env variables the
|
|
7
|
+
* project's own dependencies and `.env.example` imply, and static notes
|
|
8
|
+
* (proxy trust, readiness checks). Static only: it never boots the app.
|
|
7
9
|
*/
|
|
8
10
|
export declare function doctor(_args?: string[]): Promise<void>;
|
|
@@ -1,13 +1,141 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
2
|
import { dirname, join, parse, resolve } from "node:path";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
// src/cli/commands/doctor.ts
|
|
5
5
|
/**
|
|
6
6
|
* Arc CLI - Doctor Command
|
|
7
7
|
*
|
|
8
8
|
* Health check utility that validates the development environment.
|
|
9
|
-
* Checks Node.js version, dependencies, configuration,
|
|
9
|
+
* Checks Node.js version, dependencies, configuration, the env variables the
|
|
10
|
+
* project's own dependencies and `.env.example` imply, and static notes
|
|
11
|
+
* (proxy trust, readiness checks). Static only: it never boots the app.
|
|
10
12
|
*/
|
|
13
|
+
/**
|
|
14
|
+
* Env vars implied by an installed dependency. `names[0]` is the one reported; any of `names`
|
|
15
|
+
* counts as set.
|
|
16
|
+
*/
|
|
17
|
+
const ENV_BY_DEPENDENCY = [
|
|
18
|
+
{
|
|
19
|
+
deps: ["better-auth"],
|
|
20
|
+
names: ["BETTER_AUTH_SECRET"],
|
|
21
|
+
detail: "required for Better Auth session encryption"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
deps: [
|
|
25
|
+
"@classytic/mongokit",
|
|
26
|
+
"mongoose",
|
|
27
|
+
"mongodb"
|
|
28
|
+
],
|
|
29
|
+
names: [
|
|
30
|
+
"MONGO_URI",
|
|
31
|
+
"MONGODB_URI",
|
|
32
|
+
"DATABASE_URL"
|
|
33
|
+
],
|
|
34
|
+
detail: "required at runtime for MongoDB"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
deps: ["ioredis", "bullmq"],
|
|
38
|
+
names: ["REDIS_URL"],
|
|
39
|
+
detail: "required at runtime for Redis"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
const ENV_TEMPLATES = [
|
|
43
|
+
".env.example",
|
|
44
|
+
".env.sample",
|
|
45
|
+
".env.template"
|
|
46
|
+
];
|
|
47
|
+
/** `KEY=` names from a dotenv-style file; empty when it is absent. */
|
|
48
|
+
function readEnvKeys(file) {
|
|
49
|
+
if (!existsSync(file)) return [];
|
|
50
|
+
try {
|
|
51
|
+
return readFileSync(file, "utf-8").split(/\r?\n/).map((line) => /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(line)?.[1]).filter((k) => k !== void 0);
|
|
52
|
+
} catch {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Env checks derived from the project, not a fixed list: a var is checked when an installed
|
|
58
|
+
* dependency needs it, or when the project's `.env.example` declares it. A var counts as set
|
|
59
|
+
* when it is in the environment or in `./.env` (doctor never boots or loads the app).
|
|
60
|
+
*/
|
|
61
|
+
function envChecks(allDeps, cwd) {
|
|
62
|
+
const configured = new Set(readEnvKeys(resolve(cwd, ".env")));
|
|
63
|
+
const isSet = (name) => Boolean(process.env[name]) || configured.has(name);
|
|
64
|
+
const out = [];
|
|
65
|
+
const covered = /* @__PURE__ */ new Set();
|
|
66
|
+
for (const rule of ENV_BY_DEPENDENCY) {
|
|
67
|
+
const dep = rule.deps.find((d) => allDeps[d]);
|
|
68
|
+
if (!dep) continue;
|
|
69
|
+
for (const n of rule.names) covered.add(n);
|
|
70
|
+
const found = rule.names.find(isSet);
|
|
71
|
+
if (found) out.push({
|
|
72
|
+
status: "pass",
|
|
73
|
+
label: `${found} set`
|
|
74
|
+
});
|
|
75
|
+
else {
|
|
76
|
+
const also = rule.names.slice(1);
|
|
77
|
+
out.push({
|
|
78
|
+
status: "warn",
|
|
79
|
+
label: `${rule.names[0]} not set`,
|
|
80
|
+
detail: `${rule.detail} (${dep} installed)${also.length ? `; also accepted: ${also.join(", ")}` : ""}`
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const template = ENV_TEMPLATES.find((f) => existsSync(resolve(cwd, f)));
|
|
85
|
+
if (template) for (const name of readEnvKeys(resolve(cwd, template))) {
|
|
86
|
+
if (covered.has(name)) continue;
|
|
87
|
+
covered.add(name);
|
|
88
|
+
if (!isSet(name)) out.push({
|
|
89
|
+
status: "warn",
|
|
90
|
+
label: `${name} not set`,
|
|
91
|
+
detail: `declared in ${template}`
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
const SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]s|tsx|jsx)$/;
|
|
97
|
+
const MAX_SCANNED_FILES = 2e3;
|
|
98
|
+
/** Concatenated source text under `src/` (or the project root), skipping node_modules/dist. */
|
|
99
|
+
function readProjectSource(cwd) {
|
|
100
|
+
const root = existsSync(resolve(cwd, "src")) ? resolve(cwd, "src") : cwd;
|
|
101
|
+
const chunks = [];
|
|
102
|
+
const stack = [root];
|
|
103
|
+
while (stack.length > 0 && chunks.length < MAX_SCANNED_FILES) {
|
|
104
|
+
const dir = stack.pop();
|
|
105
|
+
let entries;
|
|
106
|
+
try {
|
|
107
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
108
|
+
} catch {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
for (const e of entries) {
|
|
112
|
+
if (e.name === "node_modules" || e.name === "dist" || e.name.startsWith(".")) continue;
|
|
113
|
+
const full = join(dir, e.name);
|
|
114
|
+
if (e.isDirectory()) stack.push(full);
|
|
115
|
+
else if (SOURCE_EXTENSIONS.test(e.name)) try {
|
|
116
|
+
chunks.push(readFileSync(full, "utf-8"));
|
|
117
|
+
} catch {}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return chunks.join("\n");
|
|
121
|
+
}
|
|
122
|
+
/** Static notes arc cannot decide at boot: proxy trust and empty readiness. */
|
|
123
|
+
function sourceNotes(cwd) {
|
|
124
|
+
const source = readProjectSource(cwd);
|
|
125
|
+
if (!/createApp|createWorker/.test(source)) return [];
|
|
126
|
+
const notes = [];
|
|
127
|
+
if (!/\btrustProxy\b/.test(source)) notes.push({
|
|
128
|
+
status: "info",
|
|
129
|
+
label: "trustProxy not set in source",
|
|
130
|
+
detail: "preset 'production' defaults to false; behind a load balancer request.ip is then the proxy's address (rate limits, audit). Set it explicitly"
|
|
131
|
+
});
|
|
132
|
+
if (!/\bhealthChecks\b|\bchecks\s*:/.test(source)) notes.push({
|
|
133
|
+
status: "info",
|
|
134
|
+
label: "no readiness checks found in source",
|
|
135
|
+
detail: "/_health/ready can never report not_ready; add module healthChecks or arcPlugins.health.checks"
|
|
136
|
+
});
|
|
137
|
+
return notes;
|
|
138
|
+
}
|
|
11
139
|
async function doctor(_args = []) {
|
|
12
140
|
console.log("\nArc Doctor\n");
|
|
13
141
|
const results = [];
|
|
@@ -108,33 +236,18 @@ async function doctor(_args = []) {
|
|
|
108
236
|
status: "pass",
|
|
109
237
|
label: `better-auth ${allDeps["better-auth"]}`
|
|
110
238
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
severity: "warn",
|
|
114
|
-
detail: "required at runtime for MongoDB"
|
|
115
|
-
}, {
|
|
116
|
-
name: "BETTER_AUTH_SECRET",
|
|
117
|
-
severity: "warn",
|
|
118
|
-
detail: "required for Better Auth session encryption"
|
|
119
|
-
}]) if (process.env[env.name]) results.push({
|
|
120
|
-
status: "pass",
|
|
121
|
-
label: `${env.name} set`
|
|
122
|
-
});
|
|
123
|
-
else results.push({
|
|
124
|
-
status: env.severity,
|
|
125
|
-
label: `${env.name} not set`,
|
|
126
|
-
detail: env.detail
|
|
127
|
-
});
|
|
239
|
+
results.push(...envChecks(allDeps, cwd));
|
|
240
|
+
results.push(...sourceNotes(cwd));
|
|
128
241
|
let passCount = 0;
|
|
129
242
|
let warnCount = 0;
|
|
130
243
|
let failCount = 0;
|
|
131
244
|
for (const r of results) {
|
|
132
|
-
const icon = r.status === "pass" ? "[pass]" : r.status === "warn" ? "[warn]" : "[FAIL]";
|
|
245
|
+
const icon = r.status === "pass" ? "[pass]" : r.status === "warn" ? "[warn]" : r.status === "info" ? "[info]" : "[FAIL]";
|
|
133
246
|
const detail = r.detail ? ` (${r.detail})` : "";
|
|
134
247
|
console.log(` ${icon} ${r.label}${detail}`);
|
|
135
248
|
if (r.status === "pass") passCount++;
|
|
136
249
|
else if (r.status === "warn") warnCount++;
|
|
137
|
-
else failCount++;
|
|
250
|
+
else if (r.status === "fail") failCount++;
|
|
138
251
|
}
|
|
139
252
|
console.log(`\n${passCount} passed, ${warnCount} warnings, ${failCount} failures\n`);
|
|
140
253
|
if (failCount > 0) process.exitCode = 1;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
export { t as generate } from "../../generate-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as generate } from "../../generate-c4F39pk1.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
export { t as init } from "../../init-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
export { t as init } from "../../init-XY5slyuS.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
2
|
-
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
|
+
import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-CijqjbHE.mjs";
|
|
3
3
|
// src/cli/commands/introspect.ts
|
|
4
4
|
function describePermission(value) {
|
|
5
5
|
if (!value) return "none";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @classytic/arc v2.
|
|
1
|
+
/*! @classytic/arc v2.53.0 | MIT | https://classytic.com */
|
|
2
2
|
import { describe } from "./commands/describe.mjs";
|
|
3
3
|
import { exportDocs } from "./commands/docs.mjs";
|
|
4
4
|
import { doctor } from "./commands/doctor.mjs";
|
|
5
|
-
import { t as generate } from "../generate-
|
|
6
|
-
import { t as init } from "../init-
|
|
5
|
+
import { t as generate } from "../generate-c4F39pk1.mjs";
|
|
6
|
+
import { t as init } from "../init-XY5slyuS.mjs";
|
|
7
7
|
import { introspect } from "./commands/introspect.mjs";
|
|
8
8
|
export { describe, doctor, exportDocs, generate, init, introspect };
|