@venizia/ignis-filter 0.3.0 → 0.3.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAwB","sourcesContent":["export * from './operators';\nexport * from './order';\nexport * from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/common/operators.ts"],"names":[],"mappings":";;;AAAA,8DAAsE;AAEtE,8KAA8K;AAE9K,qDAAqD;AACrD,MAAa,KAAK;aACA,SAAI,GAAG,MAAM,CAAC;aACd,QAAG,GAAG,KAAK,CAAC;aACZ,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9D,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IACnD,CAAC;;AAPH,sBAQC;AAED,0GAA0G;AAC1G,MAAM,oBAAoB,GAAG,CAAC,IAAoC,EAAW,EAAE;IAC7E,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAE3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,0BAAQ,EAAC;YACb,OAAO,EAAE,mDAAmD,EAAE,yCAAyC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,E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,SAAS,EAAE,GAAG,IAAI,CAAC;QAC3B,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC/C,SAAS;YACX,CAAC;YAED,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;YAE5B,IAAI,EAAE,KAAK,IAAI,CAAC,OAAO,IAAI,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnD,MAAM,cAAc,GAAG,oBAAoB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;gBAC3D,UAAU,GAAG,UAAU,IAAI,cAAc,CAAC;gBAC1C,SAAS;YACX,CAAC;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,UAAU,GAAG,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;;AApHH,wCAqHC","sourcesContent":["import { getError, type TConstValue } from '@venizia/ignis-inversion';\n\n// Neutral filter vocabulary shared by every connector. Support differs per engine - unsupported operators throw at translation time rather than being removed from this list.\n\n/** Sort direction constants for order by clauses. */\nexport class Sorts {\n static readonly DESC = 'desc';\n static readonly ASC = 'asc';\n static readonly SCHEMA_SET = new Set([Sorts.ASC, Sorts.DESC]);\n\n static isValid(value: string): boolean {\n return Sorts.SCHEMA_SET.has(value.toLowerCase());\n }\n}\n\n/** Asserts a between-style operand is a two-element tuple and reports whether both bounds are numbers. */\nconst validateNumericRange = (opts: { op: string; value: unknown }): boolean => {\n const { op, value } = opts;\n\n if (!Array.isArray(value) || value.length !== 2) {\n throw getError({\n message: `[QueryOperators][hasNumericComparison] Invalid '${op}' value | Expected: [min, max] | Got: ${JSON.stringify(value)}`,\n });\n }\n\n return value.every(v => typeof v === 'number');\n};\n\n/** Query operators for building where conditions (comparison, pattern, null, array, logical). */\nexport class QueryOperators {\n static readonly EQ = 'eq';\n static readonly NE = 'ne';\n static readonly NEQ = 'neq';\n\n static readonly GT = 'gt';\n static readonly GTE = 'gte';\n\n static readonly LT = 'lt';\n static readonly LTE = 'lte';\n\n static readonly LIKE = 'like';\n static readonly NOT_LIKE = 'nlike';\n static readonly ILIKE = 'ilike';\n static readonly NOT_ILIKE = 'nilike';\n\n static readonly IS = 'is';\n static readonly IS_NOT = 'isn';\n static readonly REGEXP = 'regexp';\n static readonly IREGEXP = 'iregexp';\n\n static readonly IN = 'in';\n static readonly INQ = 'inq';\n static readonly NIN = 'nin';\n\n static readonly EXISTS = 'exists';\n static readonly NOT_EXISTS = 'notExists';\n\n static readonly BETWEEN = 'between';\n static readonly NOT_BETWEEN = 'notBetween';\n\n // Subquery operators: the operand is a Drizzle SQL object built in code, never a request value.\n static readonly IN_SQL = 'inSql';\n static readonly NOT_IN_SQL = 'ninSql';\n\n // Array Column Operators (PostgreSQL specific)\n static readonly CONTAINS = 'contains'; // @> array contains\n static readonly CONTAINED_BY = 'containedBy'; // <@ array is contained by\n static readonly OVERLAPS = 'overlaps'; // && array overlaps\n\n static readonly NOT = 'not';\n static readonly AND = 'and';\n static readonly OR = 'or';\n\n static readonly SCHEME_SET = new Set([\n this.EQ,\n this.NE,\n this.NEQ,\n this.GT,\n this.GTE,\n this.LT,\n this.LTE,\n this.LIKE,\n this.NOT_LIKE,\n this.ILIKE,\n this.NOT_ILIKE,\n this.IS,\n this.IS_NOT,\n this.REGEXP,\n this.IREGEXP,\n this.IN,\n this.INQ,\n this.NIN,\n this.EXISTS,\n this.NOT_EXISTS,\n this.BETWEEN,\n this.NOT_BETWEEN,\n this.IN_SQL,\n this.NOT_IN_SQL,\n this.CONTAINS,\n this.CONTAINED_BY,\n this.OVERLAPS,\n this.NOT,\n this.AND,\n this.OR,\n ]);\n\n static readonly LOGICAL_GROUP_OPERATORS = new Set([this.AND, this.OR]);\n\n static readonly NUMERIC_COMPARISON_OPERATORS = new Set([\n this.GT,\n this.GTE,\n this.LT,\n this.LTE,\n this.BETWEEN,\n this.NOT_BETWEEN,\n ]);\n\n /** Checks if operators contain numeric comparisons (used for JSON path numeric casting). */\n static hasNumericComparison(opts: { operators: Record<string, any> }): boolean {\n const { operators } = opts;\n let hasNumeric = false;\n\n for (const op in operators) {\n if (!this.NUMERIC_COMPARISON_OPERATORS.has(op)) {\n continue;\n }\n\n const value = operators[op];\n\n if (op === this.BETWEEN || op === this.NOT_BETWEEN) {\n const isNumericRange = validateNumericRange({ op, value });\n hasNumeric = hasNumeric || isNumericRange;\n continue;\n }\n\n if (typeof value === 'number') {\n hasNumeric = true;\n }\n }\n\n return hasNumeric;\n }\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\nexport type TQueryOperator = TConstValue<typeof QueryOperators>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/common/order.ts"],"names":[],"mappings":";;;AAAA,8DAAoD;AACpD,2CAAoC;AAGpC,4GAA4G;AAC5G,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAEtD,8FAA8F;AAC9F,MAAM,UAAU,GAAG,CAAC,IAAuB,EAAU,EAAE,CACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAChC,cAAc,EACd,SAAS,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAC3E,CAAC;AAEJ,qFAAqF;AACrF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,CA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,8CAA8C;SAC3H,CAAC,CAAC;IACL,CAAC;IAED,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAEhF,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAA,0BAAQ,EAAC;YACb,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,gDAAgD,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,8BAA8B;SAC7G,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;AAC1D,CAAC,CAAC;AAjDW,QAAA,eAAe,mBAiD1B","sourcesContent":["import { getError } from '@venizia/ignis-inversion';\nimport { Sorts } from './operators';\nimport type { TParsedOrderEntry, TSortDirection } from './types';\n\n/** Characters `JSON.stringify` leaves raw that still break a log line: DEL, C1 controls, U+2028, U+2029. */\nconst RAW_AFTER_JSON = /[\\u007f-\\u009f\\u2028\\u2029]/g;\n\n/** The entry quoted for an error message: JSON-escaped, and on one line whatever it holds. */\nconst quoteEntry = (opts: { entry: string }): string =>\n JSON.stringify(opts.entry).replace(\n RAW_AFTER_JSON,\n character => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`,\n );\n\n// ASCII whitespace: space, tab, line feed, vertical tab, form feed, carriage return.\nconst isSeparator = (code: number): boolean => code === 32 || (code >= 9 && code <= 13);\n\nconst toSortDirection = (opts: { direction: string }): TSortDirection | undefined => {\n const { direction } = opts;\n\n // The spellings callers write, compared without allocating; anything else is lowercased.\n switch (direction) {\n case 'ASC':\n case 'asc': {\n return Sorts.ASC;\n }\n case 'DESC':\n case 'desc': {\n return Sorts.DESC;\n }\n default: {\n const lowered = direction.toLowerCase();\n return lowered === Sorts.ASC || lowered === Sorts.DESC ? lowered : undefined;\n }\n }\n};\n\n/**\n * Reads one order entry - `field` or `field direction`, tokens separated by whitespace, direction\n * `ASC` or `DESC` in any case (default `ASC`). Throws a 400 naming the whole entry when the field is\n * missing, the direction is unknown, or the entry has more than two tokens.\n */\nexport const parseOrderEntry = (opts: { entry: string }): TParsedOrderEntry => {\n const { entry } = opts;\n const trimmed = entry.trim();\n const length = trimmed.length;\n\n if (length === 0) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Order entry has no field | entry: ${quoteEntry({ entry })}`,\n });\n }\n\n let fieldEnd = 0;\n while (fieldEnd < length && !isSeparator(trimmed.charCodeAt(fieldEnd))) {\n fieldEnd++;\n }\n\n if (fieldEnd === length) {\n return { field: trimmed, direction: Sorts.ASC };\n }\n\n // `trimmed` ends on a non-separator, so a direction token follows the gap.\n let directionStart = fieldEnd + 1;\n while (isSeparator(trimmed.charCodeAt(directionStart))) {\n directionStart++;\n }\n\n let directionEnd = directionStart + 1;\n while (directionEnd < length && !isSeparator(trimmed.charCodeAt(directionEnd))) {\n directionEnd++;\n }\n\n if (directionEnd !== length) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Too many tokens | entry: ${quoteEntry({ entry })} | Expected: '<field>' or '<field> ASC|DESC'`,\n });\n }\n\n const direction = toSortDirection({ direction: trimmed.slice(directionStart) });\n\n if (!direction) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Invalid direction | entry: ${quoteEntry({ entry })} | Expected: 'ASC' or 'DESC'`,\n });\n }\n\n return { field: trimmed.slice(0, fieldEnd), direction };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":";AAAA,gTAAgT"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":";AAAA,gTAAgT","sourcesContent":["/** The filter shape, free of any runtime import. The zod schemas that validate this shape over HTTP stay in `@venizia/ignis-core` - they parse query strings and pull in the OpenAPI layer, which is a server concern. Do not import a value here; the purity guard fails if this file resolves to anything. */\n\nimport type { TConstValue } from '@venizia/ignis-inversion';\nimport type { Sorts } from './operators';\n\n/** Fields selection - an array of field names to include, or an object keyed by field name (`true` includes, `false` excludes). */\nexport type TFields<T = any> = Partial<{ [K in keyof T]: boolean }> | Array<keyof T>;\n\n/**\n * Branded read-shape for a timestamp column normalized to ISO 8601 (`isoTimestamp` in\n * `@venizia/ignis-connectors`), whose `toDriver` accepts a `Date` even though the column reads\n * back as `string`. A plain `text` column stays bare `string` and is untouched by this brand -\n * only a column built with it is eligible for the `Date` widening below.\n */\nexport type TIsoTimestamp = string & { readonly isoTimestampBrand: unique symbol };\n\n/** Adds `Date` to a branded `TIsoTimestamp` value type; every other type passes through unchanged. */\ntype TWidenIsoTimestamp<V> = V extends TIsoTimestamp ? V | Date : V;\n\n/**\n * A SQL fragment built in code - a Drizzle `SQL` or `SQLWrapper` - named structurally so this\n * package stays free of Drizzle. JSON from a request can never satisfy it.\n */\nexport type TSqlFragment = { getSQL(): unknown };\n\n/** Field-level comparison operators, mirrored 1:1 from `QueryOperators` in `common/operators.ts`. */\nexport type TWhereOperators<V> = {\n eq?: V;\n ne?: V;\n neq?: V;\n gt?: V;\n gte?: V;\n lt?: V;\n lte?: V;\n like?: V;\n nlike?: V;\n ilike?: V;\n nilike?: V;\n is?: V | null;\n isn?: V | null;\n regexp?: V;\n iregexp?: V;\n in?: V[];\n inq?: V[];\n nin?: V[];\n exists?: boolean;\n notExists?: boolean;\n between?: [V, V];\n notBetween?: [V, V];\n inSql?: TSqlFragment;\n ninSql?: TSqlFragment;\n contains?: V | V[];\n containedBy?: V | V[];\n overlaps?: V | V[];\n not?: V | TWhereOperators<V>;\n};\n\n/**\n * A field's condition - a bare scalar (implicit `eq`), `null` (implicit `is`), or an operator\n * object. A `TIsoTimestamp` column also accepts a `Date`, inside the operator object as well as\n * bare - the column's own `toDriver` already converts one.\n */\nexport type TWhereValue<V> = TWidenIsoTimestamp<V> | null | TWhereOperators<TWidenIsoTimestamp<V>>;\n\n/** `true` when a column value can hold JSON: `unknown`, `any` or an object other than a `Date` or a `TIsoTimestamp`. */\ntype TIsJsonValue<V> = unknown extends V\n ? true\n : V extends Date | TIsoTimestamp\n ? false\n : V extends object\n ? true\n : false;\n\n/** The columns of `T` whose value can hold JSON - the only columns a JSON-path key may start with. */\nexport type TJsonColumnKey<T> = {\n [K in keyof T & string]: TIsJsonValue<NonNullable<T[K]>> extends true ? K : never;\n}[keyof T & string];\n\n/** A JSON-path key on a JSON column of `T`: `metadata.a.b` or `metadata[0]`. */\nexport type TJsonPathKey<T> = `${TJsonColumnKey<T>}.${string}` | `${TJsonColumnKey<T>}[${string}`;\n\n/**\n * Query conditions for selecting data - column keys, JSON-path keys on JSON columns, and nested\n * `and` / `or`. A JSON-path value is `unknown` so a `Record<string, unknown>` still assigns.\n */\nexport type TWhere<T = any> = { [key in keyof T]?: TWhereValue<T[key]> } & {\n [key in TJsonPathKey<T>]?: unknown;\n} & {\n and?: TWhere<T>[];\n or?: TWhere<T>[];\n};\n\n/** Single relation inclusion configuration. */\nexport type TInclusion = {\n relation: string;\n scope?: TFilter;\n shouldSkipDefaultFilter?: boolean;\n};\n\n/** Maximum number of items to return. Defaults to 10 for top-level list queries. */\nexport type TLimit = number | undefined;\n\n/** Number of items to offset for pagination. */\nexport type TOffset = number | undefined;\n\n/** Number of items to skip for pagination. */\nexport type TSkip = number | undefined;\n\n/** Sorting order for results - regular columns (`fieldName ASC`) and JSON/JSONB paths (`metadata.field DESC`). */\nexport type TOrderBy = string[] | undefined;\n\n/** A sort direction, exactly the `Sorts` values. */\nexport type TSortDirection = TConstValue<typeof Sorts>;\n\n/** One order entry read by `parseOrderEntry`: the field as written, the direction lower-cased. */\nexport type TParsedOrderEntry = { field: string; direction: TSortDirection };\n\n/** An order direction in either case. */\ntype TOrderDirection = TSortDirection | Uppercase<TSortDirection>;\n\n/** A column of `T` or a JSON-path key on one of its JSON columns. */\ntype TOrderKey<T> = (keyof T & string) | TJsonPathKey<T>;\n\n/** One typed order entry, opt-in through `satisfies TOrderEntry<T>[]` - `TFilter.order` stays `string[]`. */\nexport type TOrderEntry<T> = TOrderKey<T> | `${TOrderKey<T>} ${TOrderDirection}`;\n\n/** Comprehensive filter configuration used across all repository query methods. */\nexport type TFilter<T = any> = {\n where?: TWhere<T>;\n fields?: TFields;\n include?: TInclusion[];\n order?: string[];\n limit?: number;\n offset?: number;\n skip?: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB","sourcesContent":["export * from './common';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/schemas/builder.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAIxB,sXAAsX;AACtX,wTAAwT;AAExT,MAAM,iBAAiB,GAAqB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC;AAEtD,MAAM,iBAAiB,GAAG,CAAC,IAAsC,EAAE,EAAE;IAC1E,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,iBAAiB,CAAC;IAErD;;;;;OAKG;IACH,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE;QACtE,WAAW,EAAE,+EAA+E;QAC5F,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACpB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE;QACvE,WAAW,EAAE,2CAA2C;QACxD,QAAQ,EAAE,C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;gBAC7C,KAAK,EAAE,CAAC,gBAAgB,CAAC;aAC1B,CAAC;YACF,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE;gBAC5D,IAAI,EAAE,EAAE;gBACR,KAAK,EAAE,EAAE;aACV,CAAC;YACF,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE;aAC1E,CAAC;SACH;KACF,CACF,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,YAAY;QACZ,eAAe;QACf,WAAW;QACX,YAAY;QACZ,aAAa;QACb,UAAU;QACV,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC;AArLW,QAAA,iBAAiB,qBAqL5B","sourcesContent":["import { z } from 'zod';\n\nimport type { TSchemaDecorator } from './common';\n\n/** The schemas are built by a factory rather than declared at module scope because documentation metadata has to be injected. `.openapi()` returns a NEW schema instead of mutating, and three of these decorations sit on inner nodes of a nested tree, so a consumer cannot annotate them after the tree is composed - the outer node would still hold the undecorated children. */\n/** Built with plain `zod`, never `@hono/zod-openapi`: the OpenAPI layer pulls in Hono, and these schemas must stay usable in a browser. `@hono/zod-openapi` declares `zod` as a peer, so it patches the same prototype - a server that imports it can decorate these schemas even though they were built without it. */\n\nconst identityDecorator: TSchemaDecorator = schema => schema;\n\nexport const buildQuerySchemas = (opts?: { decorate?: TSchemaDecorator }) => {\n const decorate = opts?.decorate ?? identityDecorator;\n\n /**\n * `int().nonnegative()`, not a bare `number()`. A NEGATIVE limit is not a smaller page - Drizzle\n * renders the LIMIT clause only when the value is `>= 0`, so `filter={\"limit\":-1}` emitted a\n * `select` with no LIMIT at all and returned the whole table. A fractional limit reaches the\n * driver as `LIMIT 1.5` and errors there instead of here.\n */\n const LimitSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Maximum number of items to return. Defaults to 10 for top-level list queries.',\n examples: [1, 2, 3],\n });\n\n const OffsetSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Number of items to offset for pagination.',\n examples: [1, 2, 3],\n });\n\n const SkipSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Number of items to skip for pagination.',\n examples: [1, 2, 3],\n });\n\n const OrderBySchema = decorate(z.array(z.string()).optional(), {\n description:\n \"Sorting order for results. Supports regular columns ('fieldName ASC') and JSON/JSONB paths ('metadata.field DESC', 'data.nested[0].value ASC').\",\n examples: [\n 'id DESC',\n 'createdAt ASC',\n 'metadata.priority DESC',\n 'data.nested.value ASC',\n 'items[0].score DESC',\n ],\n });\n\n const FieldsSchema = decorate(\n z.record(z.string(), z.boolean()).or(z.array(z.string())).optional(),\n {\n description:\n 'Fields selection - either an array of field names to include, or an object with field names as keys and boolean values (true to include, false to exclude)',\n examples: [\n JSON.stringify(['id', 'name', 'email']),\n JSON.stringify({ id: true, name: true }),\n JSON.stringify({ id: true, name: true, email: true, fullName: false }),\n ],\n },\n );\n\n /** @internal Recursive schema for where clause validation with nested AND/OR. */\n const RecursiveWhereSchema: z.ZodType<any> = z.lazy(() =>\n z.record(z.string(), z.any()).and(\n z.object({\n and: z.array(RecursiveWhereSchema).optional(),\n or: z.array(RecursiveWhereSchema).optional(),\n }),\n ),\n );\n\n const WhereSchema = decorate(\n z.union([\n RecursiveWhereSchema,\n z\n .string()\n // A caught parse, never a bare `JSON.parse`. zod lets a thrown SyntaxError escape\n // `safeParse`, so the controller's validation hook never ran and `?where=not-json` surfaced\n // as a 500 with a stack - for what is simply a malformed query string.\n .transform((val, ctx) => {\n if (!val) {\n return undefined;\n }\n\n try {\n return JSON.parse(val);\n } catch {\n ctx.addIssue({ code: 'custom', message: 'where must be valid JSON' });\n return z.NEVER;\n }\n })\n .pipe(RecursiveWhereSchema),\n ]),\n { type: 'object', description: 'Query conditions for selecting data.' },\n );\n\n /** Zod schema for including related entities in queries with optional nested filtering. */\n const InclusionSchema = decorate(\n z\n .array(\n z.object({\n relation: decorate(z.string(), { description: 'Model relation name' }),\n scope: decorate(\n z\n .lazy((): z.ZodType<any> => FilterSchema) // eslint-disable-line @typescript-eslint/no-use-before-define\n .optional(),\n { description: 'Model relation filter' },\n ),\n // `shouldSkipDefaultFilter` is deliberately NOT on the wire schema. It stays on the\n // internal `TInclusion` type, so server-side callers keep it, but a client could\n // otherwise send `include[].shouldSkipDefaultFilter` and the relation would be emitted\n // with no where clause at all - erasing the `@model` defaultFilter that implements\n // soft-delete and the static visibility scopes.\n }),\n )\n .optional(),\n {\n description: 'Define related models to include in the response.',\n examples: [\n JSON.stringify({ include: [{ relation: 'posts' }] }),\n JSON.stringify({ include: [{ relation: 'posts', scope: { limit: 5 } }] }),\n ],\n },\n );\n\n /** @internal Filter schema object definition. */\n const InternalFilterSchema = z.object({\n where: WhereSchema.optional(),\n fields: FieldsSchema,\n include: InclusionSchema,\n order: OrderBySchema,\n limit: LimitSchema,\n offset: OffsetSchema,\n skip: SkipSchema,\n });\n\n /** Comprehensive Zod schema for repository query filtering. Supports object and JSON string formats. */\n const FilterSchema = decorate(\n z\n .union([\n InternalFilterSchema,\n z\n .string()\n // Same reason as `where` above: a malformed filter is the caller's mistake, so it has to\n // become a validation issue rather than an uncaught throw.\n .transform((val, ctx) => {\n if (!val) {\n return {};\n }\n\n try {\n return JSON.parse(val);\n } catch {\n ctx.addIssue({ code: 'custom', message: 'filter must be valid JSON' });\n return z.NEVER;\n }\n })\n .pipe(InternalFilterSchema),\n ])\n .optional(),\n {\n type: 'object',\n description:\n 'A comprehensive filter object for querying data, including conditions, field selection, relations, pagination, and sorting.',\n examples: [\n JSON.stringify({ where: { name: 'John Doe' }, limit: 10 }),\n JSON.stringify({\n fields: { id: true, name: true, email: true },\n order: ['createdAt DESC'],\n }),\n JSON.stringify({ include: [{ relation: 'posts', scope: { limit: 5 } }] }),\n JSON.stringify({\n where: { or: [{ status: 'active' }, { isPublished: true }] },\n skip: 20,\n limit: 10,\n }),\n JSON.stringify({\n where: { and: [{ role: 'admin' }, { createdAt: { gte: 'YYYY-MM-DD' } }] },\n }),\n ],\n },\n );\n\n return {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n };\n};\n\nexport type TQuerySchemas = ReturnType<typeof buildQuerySchemas>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schemas/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schemas/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB","sourcesContent":["export * from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/schemas/common/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/schemas/common/types.ts"],"names":[],"mappings":"","sourcesContent":["/** The metadata a schema carries for documentation. Structural on purpose - naming the OpenAPI library's type here would pull it into a browser bundle, which is the whole thing this package avoids. */\nexport type TSchemaMetadata = {\n description?: string;\n type?: string;\n examples?: Array<unknown>;\n};\n\n/** Applies documentation metadata to a schema and returns it. A server passes an OpenAPI decorator; a browser passes nothing and gets the identity. */\nexport type TSchemaDecorator = <TSchema>(schema: TSchema, metadata: TSchemaMetadata) => TSchema;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA8C;AAE9C,4CAA0B;AAC1B,2CAAyB;AAEzB,+JAA+J;AAClJ,KAST,IAAA,2BAAiB,GAAE,EARrB,oBAAY,oBACZ,oBAAY,oBACZ,uBAAe,uBACf,mBAAW,mBACX,oBAAY,oBACZ,qBAAa,qBACb,kBAAU,kBACV,mBAAW,kBACW"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA8C;AAE9C,4CAA0B;AAC1B,2CAAyB;AAEzB,+JAA+J;AAClJ,KAST,IAAA,2BAAiB,GAAE,EARrB,oBAAY,oBACZ,oBAAY,oBACZ,uBAAe,uBACf,mBAAW,mBACX,oBAAY,oBACZ,qBAAa,qBACb,kBAAU,kBACV,mBAAW,kBACW","sourcesContent":["import { buildQuerySchemas } from './builder';\n\nexport * from './builder';\nexport * from './common';\n\n/** Ready-to-use schemas with no documentation metadata attached - the browser case, and the reason most consumers never touch `buildQuerySchemas` directly. */\nexport const {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n} = buildQuerySchemas();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC","sourcesContent":["export * from './operators';\nexport * from './order';\nexport * from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/common/operators.ts"],"names":[],"mappings":"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AU,IAAI,cAAc,CAAC;gBAC1C,SAAS;YACX,CAAC;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,UAAU,GAAG,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC","sourcesContent":["import { getError, type TConstValue } from '@venizia/ignis-inversion';\n\n// Neutral filter vocabulary shared by every connector. Support differs per engine - unsupported operators throw at translation time rather than being removed from this list.\n\n/** Sort direction constants for order by clauses. */\nexport class Sorts {\n static readonly DESC = 'desc';\n static readonly ASC = 'asc';\n static readonly SCHEMA_SET = new Set([Sorts.ASC, Sorts.DESC]);\n\n static isValid(value: string): boolean {\n return Sorts.SCHEMA_SET.has(value.toLowerCase());\n }\n}\n\n/** Asserts a between-style operand is a two-element tuple and reports whether both bounds are numbers. */\nconst validateNumericRange = (opts: { op: string; value: unknown }): boolean => {\n const { op, value } = opts;\n\n if (!Array.isArray(value) || value.length !== 2) {\n throw getError({\n message: `[QueryOperators][hasNumericComparison] Invalid '${op}' value | Expected: [min, max] | Got: ${JSON.stringify(value)}`,\n });\n }\n\n return value.every(v => typeof v === 'number');\n};\n\n/** Query operators for building where conditions (comparison, pattern, null, array, logical). */\nexport class QueryOperators {\n static readonly EQ = 'eq';\n static readonly NE = 'ne';\n static readonly NEQ = 'neq';\n\n static readonly GT = 'gt';\n static readonly GTE = 'gte';\n\n static readonly LT = 'lt';\n static readonly LTE = 'lte';\n\n static readonly LIKE = 'like';\n static readonly NOT_LIKE = 'nlike';\n static readonly ILIKE = 'ilike';\n static readonly NOT_ILIKE = 'nilike';\n\n static readonly IS = 'is';\n static readonly IS_NOT = 'isn';\n static readonly REGEXP = 'regexp';\n static readonly IREGEXP = 'iregexp';\n\n static readonly IN = 'in';\n static readonly INQ = 'inq';\n static readonly NIN = 'nin';\n\n static readonly EXISTS = 'exists';\n static readonly NOT_EXISTS = 'notExists';\n\n static readonly BETWEEN = 'between';\n static readonly NOT_BETWEEN = 'notBetween';\n\n // Subquery operators: the operand is a Drizzle SQL object built in code, never a request value.\n static readonly IN_SQL = 'inSql';\n static readonly NOT_IN_SQL = 'ninSql';\n\n // Array Column Operators (PostgreSQL specific)\n static readonly CONTAINS = 'contains'; // @> array contains\n static readonly CONTAINED_BY = 'containedBy'; // <@ array is contained by\n static readonly OVERLAPS = 'overlaps'; // && array overlaps\n\n static readonly NOT = 'not';\n static readonly AND = 'and';\n static readonly OR = 'or';\n\n static readonly SCHEME_SET = new Set([\n this.EQ,\n this.NE,\n this.NEQ,\n this.GT,\n this.GTE,\n this.LT,\n this.LTE,\n this.LIKE,\n this.NOT_LIKE,\n this.ILIKE,\n this.NOT_ILIKE,\n this.IS,\n this.IS_NOT,\n this.REGEXP,\n this.IREGEXP,\n this.IN,\n this.INQ,\n this.NIN,\n this.EXISTS,\n this.NOT_EXISTS,\n this.BETWEEN,\n this.NOT_BETWEEN,\n this.IN_SQL,\n this.NOT_IN_SQL,\n this.CONTAINS,\n this.CONTAINED_BY,\n this.OVERLAPS,\n this.NOT,\n this.AND,\n this.OR,\n ]);\n\n static readonly LOGICAL_GROUP_OPERATORS = new Set([this.AND, this.OR]);\n\n static readonly NUMERIC_COMPARISON_OPERATORS = new Set([\n this.GT,\n this.GTE,\n this.LT,\n this.LTE,\n this.BETWEEN,\n this.NOT_BETWEEN,\n ]);\n\n /** Checks if operators contain numeric comparisons (used for JSON path numeric casting). */\n static hasNumericComparison(opts: { operators: Record<string, any> }): boolean {\n const { operators } = opts;\n let hasNumeric = false;\n\n for (const op in operators) {\n if (!this.NUMERIC_COMPARISON_OPERATORS.has(op)) {\n continue;\n }\n\n const value = operators[op];\n\n if (op === this.BETWEEN || op === this.NOT_BETWEEN) {\n const isNumericRange = validateNumericRange({ op, value });\n hasNumeric = hasNumeric || isNumericRange;\n continue;\n }\n\n if (typeof value === 'number') {\n hasNumeric = true;\n }\n }\n\n return hasNumeric;\n }\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\nexport type TQueryOperator = TConstValue<typeof QueryOperators>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/common/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,4GAA4G;AAC5G,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAEtD,8FAA8F;AAC9F,MAAM,UAAU,GAAG,CAAC,IAAuB,EAAU,EAAE,CACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAChC,cAAc,EACd,SAAS,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAC3E,CAAC;AAEJ,qFAAqF;AACrF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AAExF,MAAM,eAAe,GAAG,CAAC,IAA2B,EAA8B,EAAE;IAClF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAE3B,yFAAyF;IACzF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,OAAO,KAAK,CAAC,GAAG,CAAC;QACnB,CAAC;QACD,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;QACD,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AC,EAAE,SAAS,EAAE,CAAC;AAC1D,CAAC,CAAC","sourcesContent":["import { getError } from '@venizia/ignis-inversion';\nimport { Sorts } from './operators';\nimport type { TParsedOrderEntry, TSortDirection } from './types';\n\n/** Characters `JSON.stringify` leaves raw that still break a log line: DEL, C1 controls, U+2028, U+2029. */\nconst RAW_AFTER_JSON = /[\\u007f-\\u009f\\u2028\\u2029]/g;\n\n/** The entry quoted for an error message: JSON-escaped, and on one line whatever it holds. */\nconst quoteEntry = (opts: { entry: string }): string =>\n JSON.stringify(opts.entry).replace(\n RAW_AFTER_JSON,\n character => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`,\n );\n\n// ASCII whitespace: space, tab, line feed, vertical tab, form feed, carriage return.\nconst isSeparator = (code: number): boolean => code === 32 || (code >= 9 && code <= 13);\n\nconst toSortDirection = (opts: { direction: string }): TSortDirection | undefined => {\n const { direction } = opts;\n\n // The spellings callers write, compared without allocating; anything else is lowercased.\n switch (direction) {\n case 'ASC':\n case 'asc': {\n return Sorts.ASC;\n }\n case 'DESC':\n case 'desc': {\n return Sorts.DESC;\n }\n default: {\n const lowered = direction.toLowerCase();\n return lowered === Sorts.ASC || lowered === Sorts.DESC ? lowered : undefined;\n }\n }\n};\n\n/**\n * Reads one order entry - `field` or `field direction`, tokens separated by whitespace, direction\n * `ASC` or `DESC` in any case (default `ASC`). Throws a 400 naming the whole entry when the field is\n * missing, the direction is unknown, or the entry has more than two tokens.\n */\nexport const parseOrderEntry = (opts: { entry: string }): TParsedOrderEntry => {\n const { entry } = opts;\n const trimmed = entry.trim();\n const length = trimmed.length;\n\n if (length === 0) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Order entry has no field | entry: ${quoteEntry({ entry })}`,\n });\n }\n\n let fieldEnd = 0;\n while (fieldEnd < length && !isSeparator(trimmed.charCodeAt(fieldEnd))) {\n fieldEnd++;\n }\n\n if (fieldEnd === length) {\n return { field: trimmed, direction: Sorts.ASC };\n }\n\n // `trimmed` ends on a non-separator, so a direction token follows the gap.\n let directionStart = fieldEnd + 1;\n while (isSeparator(trimmed.charCodeAt(directionStart))) {\n directionStart++;\n }\n\n let directionEnd = directionStart + 1;\n while (directionEnd < length && !isSeparator(trimmed.charCodeAt(directionEnd))) {\n directionEnd++;\n }\n\n if (directionEnd !== length) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Too many tokens | entry: ${quoteEntry({ entry })} | Expected: '<field>' or '<field> ASC|DESC'`,\n });\n }\n\n const direction = toSortDirection({ direction: trimmed.slice(directionStart) });\n\n if (!direction) {\n throw getError({\n statusCode: 400,\n message: `[parseOrderEntry] Invalid direction | entry: ${quoteEntry({ entry })} | Expected: 'ASC' or 'DESC'`,\n });\n }\n\n return { field: trimmed.slice(0, fieldEnd), direction };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,gTAAgT"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,gTAAgT","sourcesContent":["/** The filter shape, free of any runtime import. The zod schemas that validate this shape over HTTP stay in `@venizia/ignis-core` - they parse query strings and pull in the OpenAPI layer, which is a server concern. Do not import a value here; the purity guard fails if this file resolves to anything. */\n\nimport type { TConstValue } from '@venizia/ignis-inversion';\nimport type { Sorts } from './operators';\n\n/** Fields selection - an array of field names to include, or an object keyed by field name (`true` includes, `false` excludes). */\nexport type TFields<T = any> = Partial<{ [K in keyof T]: boolean }> | Array<keyof T>;\n\n/**\n * Branded read-shape for a timestamp column normalized to ISO 8601 (`isoTimestamp` in\n * `@venizia/ignis-connectors`), whose `toDriver` accepts a `Date` even though the column reads\n * back as `string`. A plain `text` column stays bare `string` and is untouched by this brand -\n * only a column built with it is eligible for the `Date` widening below.\n */\nexport type TIsoTimestamp = string & { readonly isoTimestampBrand: unique symbol };\n\n/** Adds `Date` to a branded `TIsoTimestamp` value type; every other type passes through unchanged. */\ntype TWidenIsoTimestamp<V> = V extends TIsoTimestamp ? V | Date : V;\n\n/**\n * A SQL fragment built in code - a Drizzle `SQL` or `SQLWrapper` - named structurally so this\n * package stays free of Drizzle. JSON from a request can never satisfy it.\n */\nexport type TSqlFragment = { getSQL(): unknown };\n\n/** Field-level comparison operators, mirrored 1:1 from `QueryOperators` in `common/operators.ts`. */\nexport type TWhereOperators<V> = {\n eq?: V;\n ne?: V;\n neq?: V;\n gt?: V;\n gte?: V;\n lt?: V;\n lte?: V;\n like?: V;\n nlike?: V;\n ilike?: V;\n nilike?: V;\n is?: V | null;\n isn?: V | null;\n regexp?: V;\n iregexp?: V;\n in?: V[];\n inq?: V[];\n nin?: V[];\n exists?: boolean;\n notExists?: boolean;\n between?: [V, V];\n notBetween?: [V, V];\n inSql?: TSqlFragment;\n ninSql?: TSqlFragment;\n contains?: V | V[];\n containedBy?: V | V[];\n overlaps?: V | V[];\n not?: V | TWhereOperators<V>;\n};\n\n/**\n * A field's condition - a bare scalar (implicit `eq`), `null` (implicit `is`), or an operator\n * object. A `TIsoTimestamp` column also accepts a `Date`, inside the operator object as well as\n * bare - the column's own `toDriver` already converts one.\n */\nexport type TWhereValue<V> = TWidenIsoTimestamp<V> | null | TWhereOperators<TWidenIsoTimestamp<V>>;\n\n/** `true` when a column value can hold JSON: `unknown`, `any` or an object other than a `Date` or a `TIsoTimestamp`. */\ntype TIsJsonValue<V> = unknown extends V\n ? true\n : V extends Date | TIsoTimestamp\n ? false\n : V extends object\n ? true\n : false;\n\n/** The columns of `T` whose value can hold JSON - the only columns a JSON-path key may start with. */\nexport type TJsonColumnKey<T> = {\n [K in keyof T & string]: TIsJsonValue<NonNullable<T[K]>> extends true ? K : never;\n}[keyof T & string];\n\n/** A JSON-path key on a JSON column of `T`: `metadata.a.b` or `metadata[0]`. */\nexport type TJsonPathKey<T> = `${TJsonColumnKey<T>}.${string}` | `${TJsonColumnKey<T>}[${string}`;\n\n/**\n * Query conditions for selecting data - column keys, JSON-path keys on JSON columns, and nested\n * `and` / `or`. A JSON-path value is `unknown` so a `Record<string, unknown>` still assigns.\n */\nexport type TWhere<T = any> = { [key in keyof T]?: TWhereValue<T[key]> } & {\n [key in TJsonPathKey<T>]?: unknown;\n} & {\n and?: TWhere<T>[];\n or?: TWhere<T>[];\n};\n\n/** Single relation inclusion configuration. */\nexport type TInclusion = {\n relation: string;\n scope?: TFilter;\n shouldSkipDefaultFilter?: boolean;\n};\n\n/** Maximum number of items to return. Defaults to 10 for top-level list queries. */\nexport type TLimit = number | undefined;\n\n/** Number of items to offset for pagination. */\nexport type TOffset = number | undefined;\n\n/** Number of items to skip for pagination. */\nexport type TSkip = number | undefined;\n\n/** Sorting order for results - regular columns (`fieldName ASC`) and JSON/JSONB paths (`metadata.field DESC`). */\nexport type TOrderBy = string[] | undefined;\n\n/** A sort direction, exactly the `Sorts` values. */\nexport type TSortDirection = TConstValue<typeof Sorts>;\n\n/** One order entry read by `parseOrderEntry`: the field as written, the direction lower-cased. */\nexport type TParsedOrderEntry = { field: string; direction: TSortDirection };\n\n/** An order direction in either case. */\ntype TOrderDirection = TSortDirection | Uppercase<TSortDirection>;\n\n/** A column of `T` or a JSON-path key on one of its JSON columns. */\ntype TOrderKey<T> = (keyof T & string) | TJsonPathKey<T>;\n\n/** One typed order entry, opt-in through `satisfies TOrderEntry<T>[]` - `TFilter.order` stays `string[]`. */\nexport type TOrderEntry<T> = TOrderKey<T> | `${TOrderKey<T>} ${TOrderDirection}`;\n\n/** Comprehensive filter configuration used across all repository query methods. */\nexport type TFilter<T = any> = {\n where?: TWhere<T>;\n fields?: TFields;\n include?: TInclusion[];\n order?: string[];\n limit?: number;\n offset?: number;\n skip?: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAA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EAAE;aACV,CAAC;YACF,IAAI,CAAC,SAAS,CAAC;gBACb,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE;aAC1E,CAAC;SACH;KACF,CACF,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,YAAY;QACZ,eAAe;QACf,WAAW;QACX,YAAY;QACZ,aAAa;QACb,UAAU;QACV,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport type { TSchemaDecorator } from './common';\n\n/** The schemas are built by a factory rather than declared at module scope because documentation metadata has to be injected. `.openapi()` returns a NEW schema instead of mutating, and three of these decorations sit on inner nodes of a nested tree, so a consumer cannot annotate them after the tree is composed - the outer node would still hold the undecorated children. */\n/** Built with plain `zod`, never `@hono/zod-openapi`: the OpenAPI layer pulls in Hono, and these schemas must stay usable in a browser. `@hono/zod-openapi` declares `zod` as a peer, so it patches the same prototype - a server that imports it can decorate these schemas even though they were built without it. */\n\nconst identityDecorator: TSchemaDecorator = schema => schema;\n\nexport const buildQuerySchemas = (opts?: { decorate?: TSchemaDecorator }) => {\n const decorate = opts?.decorate ?? identityDecorator;\n\n /**\n * `int().nonnegative()`, not a bare `number()`. A NEGATIVE limit is not a smaller page - Drizzle\n * renders the LIMIT clause only when the value is `>= 0`, so `filter={\"limit\":-1}` emitted a\n * `select` with no LIMIT at all and returned the whole table. A fractional limit reaches the\n * driver as `LIMIT 1.5` and errors there instead of here.\n */\n const LimitSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Maximum number of items to return. Defaults to 10 for top-level list queries.',\n examples: [1, 2, 3],\n });\n\n const OffsetSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Number of items to offset for pagination.',\n examples: [1, 2, 3],\n });\n\n const SkipSchema = decorate(z.number().int().nonnegative().optional(), {\n description: 'Number of items to skip for pagination.',\n examples: [1, 2, 3],\n });\n\n const OrderBySchema = decorate(z.array(z.string()).optional(), {\n description:\n \"Sorting order for results. Supports regular columns ('fieldName ASC') and JSON/JSONB paths ('metadata.field DESC', 'data.nested[0].value ASC').\",\n examples: [\n 'id DESC',\n 'createdAt ASC',\n 'metadata.priority DESC',\n 'data.nested.value ASC',\n 'items[0].score DESC',\n ],\n });\n\n const FieldsSchema = decorate(\n z.record(z.string(), z.boolean()).or(z.array(z.string())).optional(),\n {\n description:\n 'Fields selection - either an array of field names to include, or an object with field names as keys and boolean values (true to include, false to exclude)',\n examples: [\n JSON.stringify(['id', 'name', 'email']),\n JSON.stringify({ id: true, name: true }),\n JSON.stringify({ id: true, name: true, email: true, fullName: false }),\n ],\n },\n );\n\n /** @internal Recursive schema for where clause validation with nested AND/OR. */\n const RecursiveWhereSchema: z.ZodType<any> = z.lazy(() =>\n z.record(z.string(), z.any()).and(\n z.object({\n and: z.array(RecursiveWhereSchema).optional(),\n or: z.array(RecursiveWhereSchema).optional(),\n }),\n ),\n );\n\n const WhereSchema = decorate(\n z.union([\n RecursiveWhereSchema,\n z\n .string()\n // A caught parse, never a bare `JSON.parse`. zod lets a thrown SyntaxError escape\n // `safeParse`, so the controller's validation hook never ran and `?where=not-json` surfaced\n // as a 500 with a stack - for what is simply a malformed query string.\n .transform((val, ctx) => {\n if (!val) {\n return undefined;\n }\n\n try {\n return JSON.parse(val);\n } catch {\n ctx.addIssue({ code: 'custom', message: 'where must be valid JSON' });\n return z.NEVER;\n }\n })\n .pipe(RecursiveWhereSchema),\n ]),\n { type: 'object', description: 'Query conditions for selecting data.' },\n );\n\n /** Zod schema for including related entities in queries with optional nested filtering. */\n const InclusionSchema = decorate(\n z\n .array(\n z.object({\n relation: decorate(z.string(), { description: 'Model relation name' }),\n scope: decorate(\n z\n .lazy((): z.ZodType<any> => FilterSchema) // eslint-disable-line @typescript-eslint/no-use-before-define\n .optional(),\n { description: 'Model relation filter' },\n ),\n // `shouldSkipDefaultFilter` is deliberately NOT on the wire schema. It stays on the\n // internal `TInclusion` type, so server-side callers keep it, but a client could\n // otherwise send `include[].shouldSkipDefaultFilter` and the relation would be emitted\n // with no where clause at all - erasing the `@model` defaultFilter that implements\n // soft-delete and the static visibility scopes.\n }),\n )\n .optional(),\n {\n description: 'Define related models to include in the response.',\n examples: [\n JSON.stringify({ include: [{ relation: 'posts' }] }),\n JSON.stringify({ include: [{ relation: 'posts', scope: { limit: 5 } }] }),\n ],\n },\n );\n\n /** @internal Filter schema object definition. */\n const InternalFilterSchema = z.object({\n where: WhereSchema.optional(),\n fields: FieldsSchema,\n include: InclusionSchema,\n order: OrderBySchema,\n limit: LimitSchema,\n offset: OffsetSchema,\n skip: SkipSchema,\n });\n\n /** Comprehensive Zod schema for repository query filtering. Supports object and JSON string formats. */\n const FilterSchema = decorate(\n z\n .union([\n InternalFilterSchema,\n z\n .string()\n // Same reason as `where` above: a malformed filter is the caller's mistake, so it has to\n // become a validation issue rather than an uncaught throw.\n .transform((val, ctx) => {\n if (!val) {\n return {};\n }\n\n try {\n return JSON.parse(val);\n } catch {\n ctx.addIssue({ code: 'custom', message: 'filter must be valid JSON' });\n return z.NEVER;\n }\n })\n .pipe(InternalFilterSchema),\n ])\n .optional(),\n {\n type: 'object',\n description:\n 'A comprehensive filter object for querying data, including conditions, field selection, relations, pagination, and sorting.',\n examples: [\n JSON.stringify({ where: { name: 'John Doe' }, limit: 10 }),\n JSON.stringify({\n fields: { id: true, name: true, email: true },\n order: ['createdAt DESC'],\n }),\n JSON.stringify({ include: [{ relation: 'posts', scope: { limit: 5 } }] }),\n JSON.stringify({\n where: { or: [{ status: 'active' }, { isPublished: true }] },\n skip: 20,\n limit: 10,\n }),\n JSON.stringify({\n where: { and: [{ role: 'admin' }, { createdAt: { gte: 'YYYY-MM-DD' } }] },\n }),\n ],\n },\n );\n\n return {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n };\n};\n\nexport type TQuerySchemas = ReturnType<typeof buildQuerySchemas>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schemas/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schemas/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/schemas/common/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/schemas/common/types.ts"],"names":[],"mappings":"","sourcesContent":["/** The metadata a schema carries for documentation. Structural on purpose - naming the OpenAPI library's type here would pull it into a browser bundle, which is the whole thing this package avoids. */\nexport type TSchemaMetadata = {\n description?: string;\n type?: string;\n examples?: Array<unknown>;\n};\n\n/** Applies documentation metadata to a schema and returns it. A server passes an OpenAPI decorator; a browser passes nothing and gets the identity. */\nexport type TSchemaDecorator = <TSchema>(schema: TSchema, metadata: TSchemaMetadata) => TSchema;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,+JAA+J;AAC/J,MAAM,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,GAAG,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,+JAA+J;AAC/J,MAAM,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,GAAG,iBAAiB,EAAE,CAAC","sourcesContent":["import { buildQuerySchemas } from './builder';\n\nexport * from './builder';\nexport * from './common';\n\n/** Ready-to-use schemas with no documentation metadata attached - the browser case, and the reason most consumers never touch `buildQuerySchemas` directly. */\nexport const {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n} = buildQuerySchemas();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-filter",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Engine-neutral query filter vocabulary for TypeScript: the `{ where, order, limit, offset, skip, fields, include }` shape, comparison/pattern/null/array/logical operators, and sort direction constants. Isomorphic by construction - no node builtins and no server-only peer, so the same filter language serves a server repository and a browser data layer.",
5
5
  "keywords": [
6
6
  "browser",
@@ -70,7 +70,7 @@
70
70
  "prepublishOnly": "make rebuild"
71
71
  },
72
72
  "dependencies": {
73
- "@venizia/ignis-inversion": "0.3.0",
73
+ "@venizia/ignis-inversion": "0.3.2",
74
74
  "zod": "^4.5.4"
75
75
  },
76
76
  "devDependencies": {