@metaobjectsdev/codegen-ts-tanstack 0.8.1-rc.1 → 0.9.0-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaobjectsdev/codegen-ts-tanstack",
3
- "version": "0.8.1-rc.1",
3
+ "version": "0.9.0-rc.1",
4
4
  "description": "TanStack codegen for metaobjects — emits hooks and column definitions for TanStack Query and Table.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,8 +33,8 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@metaobjectsdev/metadata": "0.8.1-rc.1",
37
- "@metaobjectsdev/codegen-ts": "0.8.1-rc.1",
36
+ "@metaobjectsdev/metadata": "0.9.0-rc.1",
37
+ "@metaobjectsdev/codegen-ts": "0.9.0-rc.1",
38
38
  "ts-poet": "^6.10.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,20 +0,0 @@
1
- /**
2
- * Minimal local types mirroring FilterAllowlist from @metaobjectsdev/runtime-ts/drizzle-fastify.
3
- * Inlined so codegen-ts-tanstack doesn't need a runtime-ts dependency.
4
- */
5
- export interface FilterFieldRule {
6
- readonly ops: readonly string[];
7
- readonly subType: string;
8
- readonly leadingWildcard: boolean;
9
- }
10
- export type FilterAllowlist = Readonly<Record<string, FilterFieldRule>>;
11
- /**
12
- * Validate a data-grid `@filter` value against the entity's FilterAllowlist.
13
- * Returns an array of error messages (empty if all valid).
14
- *
15
- * Recurses through or/and composition. Reuses the same validation rules the
16
- * server-side parseFilterParams applies at runtime — but here it runs at codegen
17
- * time so authors get errors before the metadata reaches production.
18
- */
19
- export declare function validateGridFilter(filter: Record<string, unknown>, allowlist: FilterAllowlist, contextLabel: string): string[];
20
- //# sourceMappingURL=grid-filter-validate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-filter-validate.d.ts","sourceRoot":"","sources":["../src/grid-filter-validate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,SAAS,EAAE,eAAe,EAC1B,YAAY,EAAE,MAAM,GACnB,MAAM,EAAE,CA+BV"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Validate a data-grid `@filter` value against the entity's FilterAllowlist.
3
- * Returns an array of error messages (empty if all valid).
4
- *
5
- * Recurses through or/and composition. Reuses the same validation rules the
6
- * server-side parseFilterParams applies at runtime — but here it runs at codegen
7
- * time so authors get errors before the metadata reaches production.
8
- */
9
- export function validateGridFilter(filter, allowlist, contextLabel) {
10
- const errors = [];
11
- for (const [key, value] of Object.entries(filter)) {
12
- if (key === "or" || key === "and") {
13
- const subs = Array.isArray(value) ? value : [];
14
- for (const sub of subs) {
15
- errors.push(...validateGridFilter(sub, allowlist, contextLabel));
16
- }
17
- continue;
18
- }
19
- const rule = allowlist[key];
20
- if (!rule) {
21
- errors.push(`[grid-filter] ${contextLabel} @filter references disallowed field "${key}". ` +
22
- `Allowed: ${Object.keys(allowlist).join(", ") || "(no filterable fields)"}`);
23
- continue;
24
- }
25
- if (typeof value === "object" && value !== null && !Array.isArray(value)) {
26
- for (const op of Object.keys(value)) {
27
- if (!rule.ops.includes(op)) {
28
- errors.push(`[grid-filter] ${contextLabel} @filter references disallowed (field, op) "${key}.${op}". ` +
29
- `Allowed ops for ${key}: ${rule.ops.join(", ")}`);
30
- }
31
- }
32
- }
33
- // bare value → eq sugar. eq is always allowed (every subtype includes it).
34
- }
35
- return errors;
36
- }
37
- //# sourceMappingURL=grid-filter-validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-filter-validate.js","sourceRoot":"","sources":["../src/grid-filter-validate.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA+B,EAC/B,SAA0B,EAC1B,YAAoB;IAEpB,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAA8B,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;YAC9F,CAAC;YACD,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,CAAC,IAAI,CACT,iBAAiB,YAAY,yCAAyC,GAAG,KAAK;gBAC9E,YAAY,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,wBAAwB,EAAE,CAC5E,CAAC;YACF,SAAS;QACX,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzE,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;oBAC3B,MAAM,CAAC,IAAI,CACT,iBAAiB,YAAY,+CAA+C,GAAG,IAAI,EAAE,KAAK;wBAC1F,mBAAmB,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjD,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,2EAA2E;IAC7E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}