@classytic/arc 2.18.5 → 2.20.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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/bin/arc.js +37 -0
  3. package/dist/{BaseController-Dy6EQHjM.mjs → BaseController-D-MHZ27_.mjs} +4 -4
  4. package/dist/{ResourceRegistry-5fKZwhK_.mjs → ResourceRegistry-7RnrEWNP.mjs} +1 -1
  5. package/dist/{actionPermissions-h7DYDNMg.mjs → actionPermissions-C9RMiIpc.mjs} +2 -1
  6. package/dist/audit/index.mjs +1 -1
  7. package/dist/auth/index.d.mts +1 -1
  8. package/dist/auth/index.mjs +17 -6
  9. package/dist/{buildHandler-B0qvAguf.mjs → buildHandler-D_2ULWxZ.mjs} +3 -3
  10. package/dist/cache/index.mjs +2 -2
  11. package/dist/cli/commands/describe.d.mts +1 -1
  12. package/dist/cli/commands/describe.mjs +2 -2
  13. package/dist/cli/commands/docs.mjs +2 -2
  14. package/dist/cli/commands/generate.mjs +1 -1
  15. package/dist/cli/commands/init.mjs +1 -1
  16. package/dist/cli/commands/introspect.mjs +4 -13
  17. package/dist/cli/index.mjs +2 -2
  18. package/dist/{constants-gaEeMlz-.mjs → constants-DNre0wRg.mjs} +1 -1
  19. package/dist/core/index.d.mts +2 -2
  20. package/dist/core/index.mjs +4 -4
  21. package/dist/{core-ZnQBa5rh.mjs → core-CWhyGkiM.mjs} +136 -59
  22. package/dist/{createActionRouter-CagItpxI.mjs → createActionRouter-HlQso0jO.mjs} +8 -7
  23. package/dist/{createAggregationRouter-DVKroXhC.mjs → createAggregationRouter-5LzPzgw1.mjs} +5 -4
  24. package/dist/{createApp--703hQE1.mjs → createApp-D6uwzCKu.mjs} +210 -17
  25. package/dist/docs/index.d.mts +1 -1
  26. package/dist/docs/index.mjs +1 -1
  27. package/dist/encryption/index.d.mts +222 -0
  28. package/dist/encryption/index.mjs +270 -0
  29. package/dist/events/index.mjs +9 -6
  30. package/dist/factory/index.d.mts +3 -2
  31. package/dist/factory/index.mjs +2 -2
  32. package/dist/{fastify-augmentation-Cxb0ROIw.d.mts → fastify-augmentation-CCQJEDgh.d.mts} +12 -1
  33. package/dist/{generate-Brans3fW.mjs → generate-usRSdQmP.mjs} +4 -3
  34. package/dist/hooks/index.d.mts +1 -1
  35. package/dist/idempotency/index.mjs +1 -1
  36. package/dist/{index-CRKiiP5o.d.mts → index-CdFkIMEd.d.mts} +5 -0
  37. package/dist/{index-Dh0_RSTd.d.mts → index-DUa8WHz3.d.mts} +7 -7
  38. package/dist/{index-CHNQIhcb.d.mts → index-_--GyzcO.d.mts} +111 -2
  39. package/dist/index.d.mts +3 -3
  40. package/dist/index.mjs +6 -6
  41. package/dist/{init-Bqpt1Hxf.mjs → init-YH_nslQR.mjs} +87 -5
  42. package/dist/integrations/index.d.mts +1 -1
  43. package/dist/integrations/mcp/index.d.mts +2 -2
  44. package/dist/integrations/mcp/index.mjs +1 -1
  45. package/dist/integrations/mcp/testing.d.mts +1 -1
  46. package/dist/integrations/mcp/testing.mjs +1 -1
  47. package/dist/integrations/streamline.d.mts +17 -5
  48. package/dist/integrations/streamline.mjs +9 -5
  49. package/dist/{loadResourcesFromEntry-BTlFEx05.mjs → loadResourcesFromEntry-OMCvIEE7.mjs} +1 -1
  50. package/dist/{mcpPlugin-D1wuRD2c.mjs → mcpPlugin-CuW6L_uD.mjs} +148 -49
  51. package/dist/middleware/index.d.mts +1 -1
  52. package/dist/middleware/index.mjs +1 -1
  53. package/dist/module-JYH9V0I8.d.mts +384 -0
  54. package/dist/{openapi-xVJibapr.mjs → openapi-Dq6RbEGK.mjs} +3 -3
  55. package/dist/permissions/index.d.mts +1 -1
  56. package/dist/permissions/index.mjs +1 -1
  57. package/dist/{permissions-BPB1xqGf.mjs → permissions-CgbOLJZG.mjs} +10 -2
  58. package/dist/pipeline/index.d.mts +1 -1
  59. package/dist/plugins/index.d.mts +10 -5
  60. package/dist/plugins/index.mjs +3 -3
  61. package/dist/plugins/tracing-entry.mjs +1 -1
  62. package/dist/{pluralize-DccFV9R7.mjs → pluralize-BhrgwZb9.mjs} +3 -3
  63. package/dist/presets/filesUpload.d.mts +1 -1
  64. package/dist/presets/filesUpload.mjs +1 -1
  65. package/dist/presets/index.d.mts +16 -2
  66. package/dist/presets/index.mjs +1 -1
  67. package/dist/presets/multiTenant.d.mts +1 -1
  68. package/dist/presets/multiTenant.mjs +1 -1
  69. package/dist/presets/search.d.mts +1 -1
  70. package/dist/presets/search.mjs +3 -2
  71. package/dist/{presets-BtyFwTO4.mjs → presets-DWsYQdbV.mjs} +1 -1
  72. package/dist/{queryCachePlugin-emHb0CuX.mjs → queryCachePlugin-DzqLN904.mjs} +2 -2
  73. package/dist/{registerRoute-CPmdkZGu.mjs → registerRoute-DGSREwPw.mjs} +20 -2
  74. package/dist/registry/index.d.mts +1 -1
  75. package/dist/registry/index.mjs +2 -2
  76. package/dist/{registry-Bm9LjWKs.mjs → registry-vcOCtPij.mjs} +1 -1
  77. package/dist/{schemaIR-D1MJwqmp.mjs → schemaIR-ajetw3Fv.mjs} +1 -42
  78. package/dist/scim/index.mjs +2 -2
  79. package/dist/sync/changelog.d.mts +2 -0
  80. package/dist/sync/changelog.mjs +2 -0
  81. package/dist/testing/index.d.mts +2 -2
  82. package/dist/testing/index.mjs +2 -2
  83. package/dist/types/index.d.mts +2 -2
  84. package/dist/{types-CmkknLzI.d.mts → types-BHMKlMBU.d.mts} +53 -195
  85. package/dist/{types-D60PFwfG.d.mts → types-C9b2HR5W.d.mts} +1 -1
  86. package/dist/utils/index.d.mts +1 -1
  87. package/dist/utils/index.mjs +1 -1
  88. package/dist/{utils-C6QQ9-hd.mjs → utils-ChjYQpjn.mjs} +1400 -1400
  89. package/dist/{validate-CRcaWzp2.mjs → validate-C2mGgSXg.mjs} +3 -3
  90. package/package.json +22 -8
  91. package/skills/arc/SKILL.md +10 -0
  92. package/skills/arc/references/mcp.md +2 -0
package/README.md CHANGED
@@ -126,7 +126,7 @@ export default defineResource({
126
126
  });
127
127
  ```
128
128
 
129
- Auto-generates: `GET /products`, `GET /products/:id`, `POST /products`, `PATCH /products/:id`, `DELETE /products/:id` + softDelete adds `GET /products/deleted`, `POST /products/:id/restore` + slugLookup adds `GET /products/by-slug/:slug` + custom routes + `POST /products/:id/action`.
129
+ Auto-generates: `GET /products`, `GET /products/:id`, `POST /products`, `PATCH /products/:id`, `DELETE /products/:id` + softDelete adds `GET /products/deleted`, `POST /products/:id/restore` + slugLookup adds `GET /products/slug/:slug` + custom routes + `POST /products/:id/action`.
130
130
 
131
131
  ### Resource shorthands
132
132
 
package/bin/arc.js CHANGED
@@ -60,8 +60,30 @@ if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
60
60
 
61
61
  const [command, subcommand, ...rest] = args;
62
62
 
63
+ // Per-command usage — `arc <command> --help` prints this instead of falling
64
+ // through to the command (where `--help` was mistaken for an argument).
65
+ const COMMAND_ALIASES = { new: 'init', g: 'generate', i: 'introspect', desc: 'describe', d: 'docs' };
66
+ const COMMAND_HELP = {
67
+ init: 'Usage: arc init [name] [--jwt|--better-auth] [--mongokit|--custom] [--api-key]\n [--multi|--single] [--js] [--edge] [--docker|--no-docker] [--skip-install] [--force]\n Scaffold a new arc project (prompts when run in a TTY without a name).',
68
+ generate: 'Usage: arc generate <resource|controller|model|repository|schemas|mcp> <name> [--mcp]\n Aliases: g; types r/c/m/repo/s. Name must be kebab-case (letters, digits, hyphens).',
69
+ introspect: 'Usage: arc introspect <entry-file>\n Print a human-readable summary of the resources an entry file exports.',
70
+ describe: 'Usage: arc describe <entry-file> [--json] [--pretty] [--entry <file>]\n Describe resources; --json emits machine output for AI agents.',
71
+ docs: 'Usage: arc docs <entry-file> [output.json] [--entry <file>]\n Export the generated OpenAPI document.',
72
+ doctor: 'Usage: arc doctor\n Diagnose common arc setup issues (exit 1 on hard failures).',
73
+ };
74
+
63
75
  async function main() {
64
76
  try {
77
+ // `arc <command> --help` / `-h` → command-specific usage, exit 0.
78
+ const canonicalCommand = COMMAND_ALIASES[command] ?? command;
79
+ if (
80
+ COMMAND_HELP[canonicalCommand] &&
81
+ [subcommand, ...rest].some((a) => a === '--help' || a === '-h')
82
+ ) {
83
+ console.log(COMMAND_HELP[canonicalCommand]);
84
+ return;
85
+ }
86
+
65
87
  switch (command) {
66
88
  case 'init':
67
89
  case 'new':
@@ -310,6 +332,21 @@ function parseInitOptions(rawArgs) {
310
332
  case '-f':
311
333
  opts.force = true;
312
334
  break;
335
+
336
+ case '--help':
337
+ case '-h':
338
+ // Handled by the per-command help short-circuit in main(); ignore here.
339
+ break;
340
+
341
+ default:
342
+ // Surface typos instead of silently scaffolding with defaults — a
343
+ // dropped `--jwt` / `--mongokit` would change the whole project. Warn
344
+ // (non-fatal, to stderr) rather than error, since a scaffolder should
345
+ // stay forgiving.
346
+ if (arg.startsWith('-')) {
347
+ console.error(`Warning: unknown flag "${arg}" (ignored). Run "arc init --help".`);
348
+ }
349
+ break;
313
350
  }
314
351
  }
315
352
 
@@ -1,11 +1,11 @@
1
- import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-gaEeMlz-.mjs";
1
+ import { h as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD } from "./constants-DNre0wRg.mjs";
2
2
  import { arcLog } from "./logger/index.mjs";
3
3
  import { d as createDomainError, f as createError, i as NotFoundError, r as ForbiddenError } from "./errors-DkO8Nk6-.mjs";
4
4
  import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-bHblZ9YN.mjs";
5
- import { M as scheduleBackground, N as simpleEqualityMatcher, j as getUserId, k as ArcQueryParser } from "./utils-C6QQ9-hd.mjs";
6
- import { t as buildQueryKey } from "./keys-Cd316u_y.mjs";
7
- import { F as applyFieldWritePermissions, L as resolveEffectiveRoles } from "./permissions-BPB1xqGf.mjs";
5
+ import { N as simpleEqualityMatcher, _ as ArcQueryParser, r as scheduleBackground, t as getUserId } from "./utils-ChjYQpjn.mjs";
6
+ import { F as applyFieldWritePermissions, L as resolveEffectiveRoles } from "./permissions-CgbOLJZG.mjs";
8
7
  import { t as getUserRoles } from "./types-XTApa8b6.mjs";
8
+ import { t as buildQueryKey } from "./keys-Cd316u_y.mjs";
9
9
  //#region src/core/AccessControl.ts
10
10
  const log = arcLog("access-control");
11
11
  var AccessControl = class {
@@ -1,4 +1,4 @@
1
- import "./constants-gaEeMlz-.mjs";
1
+ import "./constants-DNre0wRg.mjs";
2
2
  //#region src/registry/ResourceRegistry.ts
3
3
  /**
4
4
  * Resource Registry
@@ -1,5 +1,5 @@
1
1
  import { b as isElevated, c as getOrgId, g as getUserId, n as PUBLIC_SCOPE, x as isMember } from "./types-bHblZ9YN.mjs";
2
- import { L as resolveEffectiveRoles, P as applyFieldReadPermissions } from "./permissions-BPB1xqGf.mjs";
2
+ import { L as resolveEffectiveRoles, P as applyFieldReadPermissions } from "./permissions-CgbOLJZG.mjs";
3
3
  import { t as getUserRoles } from "./types-XTApa8b6.mjs";
4
4
  import { t as executePipeline } from "./pipe-BOLmGIxa.mjs";
5
5
  import { isPaginatedResult, toCanonicalList } from "@classytic/repo-core/pagination";
@@ -247,6 +247,7 @@ function sendControllerResponse(reply, response, request) {
247
247
  function createFastifyHandler(controllerMethod) {
248
248
  return async (req, reply) => {
249
249
  sendControllerResponse(reply, await controllerMethod(createRequestContext(req)), req);
250
+ return reply;
250
251
  };
251
252
  }
252
253
  /**
@@ -108,7 +108,7 @@ function extractUserId(user) {
108
108
  */
109
109
  function detectChanges(before, after) {
110
110
  const changes = [];
111
- const allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);
111
+ const allKeys = /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)]);
112
112
  for (const key of allKeys) {
113
113
  if (key.startsWith("_") || key === "updatedAt") continue;
114
114
  if (JSON.stringify(before[key]) !== JSON.stringify(after[key])) changes.push(key);
@@ -1,4 +1,4 @@
1
- import { Bt as AuthHelpers, Vt as AuthPluginOptions } from "../index-CHNQIhcb.mjs";
1
+ import { Ht as AuthPluginOptions, Vt as AuthHelpers } from "../index-_--GyzcO.mjs";
2
2
  import { c as PermissionCheck } from "../fields-C7ahdGYf.mjs";
3
3
  import { t as ExternalOpenApiPaths } from "../externalPaths-BE6wFpYv.mjs";
4
4
  import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-BXG-HGwG.mjs";
@@ -1,5 +1,5 @@
1
1
  import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-DkO8Nk6-.mjs";
2
- import { _ as requireTeamMembership, m as requireOrgRole, p as requireOrgMembership } from "../permissions-BPB1xqGf.mjs";
2
+ import { _ as requireTeamMembership, m as requireOrgRole, p as requireOrgMembership } from "../permissions-CgbOLJZG.mjs";
3
3
  import { n as normalizeRoles, t as getUserRoles } from "../types-XTApa8b6.mjs";
4
4
  import { a as toJsonSchema } from "../schemaConverter-U0MnO9vd.mjs";
5
5
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -317,11 +317,20 @@ function toFetchRequest(request) {
317
317
  else if (contentType.includes("application/json") || contentType.includes("text/") || !contentType) body = JSON.stringify(request.body);
318
318
  else request.log?.warn?.("toFetchRequest: cannot reconstruct %s body without rawBody plugin", contentType);
319
319
  }
320
- return new Request(url, {
320
+ const init = {
321
321
  method: request.method,
322
322
  headers,
323
323
  body
324
+ };
325
+ const fetchRequest = new Request(url, init);
326
+ Object.defineProperty(fetchRequest, "clone", {
327
+ configurable: true,
328
+ writable: true,
329
+ value() {
330
+ return new Request(url, init);
331
+ }
324
332
  });
333
+ return fetchRequest;
325
334
  }
326
335
  /**
327
336
  * Pipe a Fetch API Response back into Fastify's reply.
@@ -1045,7 +1054,7 @@ var MemorySessionStore = class {
1045
1054
  const userSessions = this.userIndex.get(userId);
1046
1055
  if (!userSessions) return;
1047
1056
  for (const sessionId of userSessions) if (sessionId !== currentSessionId) this.sessions.delete(sessionId);
1048
- if (userSessions.has(currentSessionId)) this.userIndex.set(userId, new Set([currentSessionId]));
1057
+ if (userSessions.has(currentSessionId)) this.userIndex.set(userId, /* @__PURE__ */ new Set([currentSessionId]));
1049
1058
  else this.userIndex.delete(userId);
1050
1059
  }
1051
1060
  /**
@@ -1151,9 +1160,10 @@ function createSessionManager(options) {
1151
1160
  metadata
1152
1161
  };
1153
1162
  await store.set(sessionId, sessionData);
1163
+ const signedId = signSessionId(sessionId, secret);
1154
1164
  return {
1155
1165
  sessionId,
1156
- cookie: buildSetCookieHeader(cookieName, signSessionId(sessionId, secret), maxAgeSeconds, cookieOptions)
1166
+ cookie: buildSetCookieHeader(cookieName, signedId, maxAgeSeconds, cookieOptions)
1157
1167
  };
1158
1168
  }
1159
1169
  /**
@@ -1248,7 +1258,8 @@ function createSessionManager(options) {
1248
1258
  if (Date.now() - session.updatedAt > updateAgeMs) {
1249
1259
  const updatedSession = await refreshSession(sessionId);
1250
1260
  if (updatedSession) {
1251
- const newCookie = buildSetCookieHeader(cookieName, signSessionId(sessionId, secret), maxAgeSeconds, cookieOptions);
1261
+ const signedId = signSessionId(sessionId, secret);
1262
+ const newCookie = buildSetCookieHeader(cookieName, signedId, maxAgeSeconds, cookieOptions);
1252
1263
  reply.header("Set-Cookie", newCookie);
1253
1264
  request.session = {
1254
1265
  ...updatedSession,
@@ -1291,7 +1302,7 @@ function mirrorTrustedOriginsFromCors(options) {
1291
1302
  const { corsOrigins, canonicalUrl } = options;
1292
1303
  if (corsOrigins === true) return ["*"];
1293
1304
  if (!corsOrigins) return [canonicalUrl];
1294
- return Array.from(new Set([canonicalUrl, ...corsOrigins]));
1305
+ return Array.from(/* @__PURE__ */ new Set([canonicalUrl, ...corsOrigins]));
1295
1306
  }
1296
1307
  //#endregion
1297
1308
  export { MemorySessionStore, authPlugin_default as authPlugin, authPlugin as authPluginFn, createBetterAuthAdapter, createSessionManager, extractBetterAuthOpenApi, mirrorTrustedOriginsFromCors };
@@ -1,4 +1,4 @@
1
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-CRcaWzp2.mjs";
1
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-C2mGgSXg.mjs";
2
2
  //#region src/core/aggregation/buildHandler.ts
3
3
  /**
4
4
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -193,7 +193,7 @@ const OPERATOR_SHORTHAND = {
193
193
  size: "$size",
194
194
  type: "$type"
195
195
  };
196
- const SHORTHAND_RANGE_OPS = new Set([
196
+ const SHORTHAND_RANGE_OPS = /* @__PURE__ */ new Set([
197
197
  "gt",
198
198
  "gte",
199
199
  "lt",
@@ -239,7 +239,7 @@ function expandShorthandOperators(value) {
239
239
  */
240
240
  function extractCallerFilter(query) {
241
241
  const out = {};
242
- const reserved = new Set([
242
+ const reserved = /* @__PURE__ */ new Set([
243
243
  "page",
244
244
  "limit",
245
245
  "after",
@@ -1,6 +1,6 @@
1
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-Cd316u_y.mjs";
2
1
  import { t as MemoryCacheStore } from "../memory-CLXA2VeJ.mjs";
3
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-emHb0CuX.mjs";
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-Cd316u_y.mjs";
3
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-DzqLN904.mjs";
4
4
  //#region src/cache/redis.ts
5
5
  /**
6
6
  * Redis-backed cache store.
@@ -1,4 +1,4 @@
1
- import { V as ResourceDefinition, it as RateLimitConfig, mt as RouteSchemaOptions } from "../../index-CHNQIhcb.mjs";
1
+ import { V as ResourceDefinition, ht as RouteSchemaOptions, it as RateLimitConfig } from "../../index-_--GyzcO.mjs";
2
2
 
3
3
  //#region src/cli/commands/describe.d.ts
4
4
  interface DescribedResource {
@@ -1,5 +1,5 @@
1
- import { t as CRUD_OPERATIONS } from "../../constants-gaEeMlz-.mjs";
2
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-5fKZwhK_.mjs";
1
+ import { t as CRUD_OPERATIONS } from "../../constants-DNre0wRg.mjs";
2
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-7RnrEWNP.mjs";
3
3
  import { resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  //#region src/cli/commands/describe.ts
@@ -1,5 +1,5 @@
1
- import { t as buildOpenApiSpec } from "../../openapi-xVJibapr.mjs";
2
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-BTlFEx05.mjs";
1
+ import { t as buildOpenApiSpec } from "../../openapi-Dq6RbEGK.mjs";
2
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-OMCvIEE7.mjs";
3
3
  import { dirname, resolve } from "node:path";
4
4
  import { mkdirSync, writeFileSync } from "node:fs";
5
5
  //#region src/cli/commands/docs.ts
@@ -1,2 +1,2 @@
1
- import { t as generate } from "../../generate-Brans3fW.mjs";
1
+ import { t as generate } from "../../generate-usRSdQmP.mjs";
2
2
  export { generate };
@@ -1,2 +1,2 @@
1
- import { t as init } from "../../init-Bqpt1Hxf.mjs";
1
+ import { t as init } from "../../init-YH_nslQR.mjs";
2
2
  export { init };
@@ -1,4 +1,4 @@
1
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-BTlFEx05.mjs";
1
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-OMCvIEE7.mjs";
2
2
  //#region src/cli/commands/introspect.ts
3
3
  function describePermission(value) {
4
4
  if (!value) return "none";
@@ -10,19 +10,10 @@ function describePermission(value) {
10
10
  async function introspect(args) {
11
11
  console.log("Introspecting Arc resources...\n");
12
12
  const entryPath = args[0];
13
- if (!entryPath) {
14
- console.log("Usage: arc introspect <entry-file>\n");
15
- console.log("Where entry-file exports your defineResource() results.");
16
- console.log("Example: arc introspect ./src/resources.js");
17
- return;
18
- }
13
+ if (!entryPath) throw new Error("Missing entry-file argument\nUsage: arc introspect <entry-file>\nWhere entry-file exports your defineResource() results.\nExample: arc introspect ./src/resources.js");
19
14
  const { registry, registered } = await loadResourcesFromEntry(entryPath);
20
- if (registered === 0) {
21
- console.log("No resource definitions found in entry file.");
22
- console.log("\nMake sure your file exports defineResource() results:");
23
- console.log(" export const productResource = defineResource({ ... });");
24
- return;
25
- }
15
+ if (registered === 0) throw new Error(`No resource definitions found in "${entryPath}".\nMake sure the file exports defineResource() results:
16
+ export const productResource = defineResource({ ... });`);
26
17
  const resources = registry.getAll();
27
18
  console.log(`Found ${resources.length} resource(s):\n`);
28
19
  resources.forEach((resource, index) => {
@@ -1,7 +1,7 @@
1
1
  import { describe } from "./commands/describe.mjs";
2
2
  import { exportDocs } from "./commands/docs.mjs";
3
3
  import { doctor } from "./commands/doctor.mjs";
4
- import { t as generate } from "../generate-Brans3fW.mjs";
5
- import { t as init } from "../init-Bqpt1Hxf.mjs";
4
+ import { t as generate } from "../generate-usRSdQmP.mjs";
5
+ import { t as init } from "../init-YH_nslQR.mjs";
6
6
  import { introspect } from "./commands/introspect.mjs";
7
7
  export { describe, doctor, exportDocs, generate, init, introspect };
@@ -73,7 +73,7 @@ const MAX_FILTER_DEPTH = 10;
73
73
  * filter. See `ArcQueryParser.parseFilters()` for the unwrap step that
74
74
  * merges `q.filter[*]` back into the top-level filter map.
75
75
  */
76
- const RESERVED_QUERY_PARAMS = Object.freeze(new Set([
76
+ const RESERVED_QUERY_PARAMS = Object.freeze(/* @__PURE__ */ new Set([
77
77
  "page",
78
78
  "limit",
79
79
  "sort",
@@ -1,3 +1,3 @@
1
- import { $t as BaseController, At as AggregationRateLimit, B as defineResource, Ct as AggMeasureShorthand, Dt as AggregationIndexHint, Et as AggregationDateRangeRequirement, Fn as ControllerConfigurableOptions, In as ControllerConstructionOptions, Ln as ListResult, Ot as AggregationMaterializedContext, Pn as BaseControllerOptions, Rn as BodySanitizer, St as AggMeasureInput, Tt as AggregationConfig, V as ResourceDefinition, an as SlugMixin, cn as BaseCrudController, dn as AccessControl, en as SoftDeleteExt, fn as AccessControlConfig, in as SlugExt, jt as AggregationsMap, kt as AggregationMaterializedResult, ln as QueryResolver, nn as TreeExt, on as BulkExt, rn as TreeMixin, sn as BulkMixin, tn as SoftDeleteMixin, un as QueryResolverConfig, wt as AggregationCacheConfig, zn as BodySanitizerConfig } from "../index-CHNQIhcb.mjs";
2
- import { A as MAX_FILTER_DEPTH, C as DEFAULT_SORT, D as HOOK_PHASES, E as HOOK_OPERATIONS, F as RESERVED_QUERY_PARAMS, I as SYSTEM_FIELDS, M as MAX_SEARCH_LENGTH, N as MUTATION_OPERATIONS, O as HookOperation, P as MutationOperation, S as DEFAULT_MAX_LIMIT, T as DEFAULT_UPDATE_METHOD, _ as defineAggregation, a as createRequestContext, b as DEFAULT_ID_FIELD, c as sendControllerResponse, d as getEntityQuery, f as defineResourceVariants, g as createPermissionMiddleware, h as createCrudRouter, i as createFastifyHandler, j as MAX_REGEX_LENGTH, k as HookPhase, l as getEntityId, m as defineAction, n as isFieldReadable, o as getControllerContext, p as DefineActionConfig, r as createCrudHandlers, s as getControllerScope, t as collectReadBlockedFields, u as getEntityIdField, v as CRUD_OPERATIONS, w as DEFAULT_TENANT_FIELD, x as DEFAULT_LIMIT, y as CrudOperation } from "../index-Dh0_RSTd.mjs";
1
+ import { At as AggregationMaterializedResult, B as defineResource, Bn as BodySanitizerConfig, Ct as AggMeasureInput, Dt as AggregationDateRangeRequirement, Et as AggregationConfig, Fn as BaseControllerOptions, In as ControllerConfigurableOptions, Ln as ControllerConstructionOptions, Mt as AggregationsMap, Ot as AggregationIndexHint, Rn as ListResult, Tt as AggregationCacheConfig, V as ResourceDefinition, an as SlugExt, cn as BulkMixin, dn as QueryResolverConfig, en as BaseController, fn as AccessControl, in as TreeMixin, jt as AggregationRateLimit, kt as AggregationMaterializedContext, ln as BaseCrudController, nn as SoftDeleteMixin, on as SlugMixin, pn as AccessControlConfig, rn as TreeExt, sn as BulkExt, tn as SoftDeleteExt, un as QueryResolver, wt as AggMeasureShorthand, zn as BodySanitizer } from "../index-_--GyzcO.mjs";
2
+ import { A as MAX_FILTER_DEPTH, C as DEFAULT_SORT, D as HOOK_PHASES, E as HOOK_OPERATIONS, F as RESERVED_QUERY_PARAMS, I as SYSTEM_FIELDS, M as MAX_SEARCH_LENGTH, N as MUTATION_OPERATIONS, O as HookOperation, P as MutationOperation, S as DEFAULT_MAX_LIMIT, T as DEFAULT_UPDATE_METHOD, _ as defineAggregation, a as createRequestContext, b as DEFAULT_ID_FIELD, c as sendControllerResponse, d as getEntityQuery, f as defineResourceVariants, g as createPermissionMiddleware, h as createCrudRouter, i as createFastifyHandler, j as MAX_REGEX_LENGTH, k as HookPhase, l as getEntityId, m as defineAction, n as isFieldReadable, o as getControllerContext, p as DefineActionConfig, r as createCrudHandlers, s as getControllerScope, t as collectReadBlockedFields, u as getEntityIdField, v as CRUD_OPERATIONS, w as DEFAULT_TENANT_FIELD, x as DEFAULT_LIMIT, y as CrudOperation } from "../index-DUa8WHz3.mjs";
3
3
  export { AccessControl, type AccessControlConfig, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, type DefineActionConfig, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, MutationOperation, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };
@@ -1,5 +1,5 @@
1
- import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "../constants-gaEeMlz-.mjs";
2
- import { a as BulkMixin, c as collectReadBlockedFields, f as AccessControl, i as SlugMixin, l as isFieldReadable, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController, u as BodySanitizer } from "../BaseController-Dy6EQHjM.mjs";
3
- import { a as defineResource, c as createCrudRouter, i as defineResourceVariants, l as createPermissionMiddleware, n as getEntityIdField, o as ResourceDefinition, r as getEntityQuery, s as defineAction, t as getEntityId, u as defineAggregation } from "../core-ZnQBa5rh.mjs";
4
- import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-h7DYDNMg.mjs";
1
+ import { a as DEFAULT_SORT, c as HOOK_OPERATIONS, d as MAX_REGEX_LENGTH, f as MAX_SEARCH_LENGTH, h as SYSTEM_FIELDS, i as DEFAULT_MAX_LIMIT, l as HOOK_PHASES, m as RESERVED_QUERY_PARAMS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MUTATION_OPERATIONS, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as MAX_FILTER_DEPTH } from "../constants-DNre0wRg.mjs";
2
+ import { a as BulkMixin, c as collectReadBlockedFields, f as AccessControl, i as SlugMixin, l as isFieldReadable, n as TreeMixin, o as BaseCrudController, r as SoftDeleteMixin, s as QueryResolver, t as BaseController, u as BodySanitizer } from "../BaseController-D-MHZ27_.mjs";
3
+ import { a as defineResource, c as createCrudRouter, i as defineResourceVariants, l as createPermissionMiddleware, n as getEntityIdField, o as ResourceDefinition, r as getEntityQuery, s as defineAction, t as getEntityId, u as defineAggregation } from "../core-CWhyGkiM.mjs";
4
+ import { a as createCrudHandlers, c as getControllerContext, l as getControllerScope, o as createFastifyHandler, s as createRequestContext, u as sendControllerResponse } from "../actionPermissions-C9RMiIpc.mjs";
5
5
  export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, collectReadBlockedFields, createCrudHandlers, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, defineAction, defineAggregation, defineResource, defineResourceVariants, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, sendControllerResponse };